HTML and CSS Reference
In-Depth Information
Listing 6-5. Creating the DataGrid for the RSS Reader
<mx:DataGrid id="entries" width="{reader.width-15}"
dataProvider="{httpRSS.result.rss.channel.item}"
cellPress=
"{body.htmlText=httpRSS.result.rss.channel.item[entries.selectedIndex].description}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="title" headerText="Title" />
<mx:DataGridColumn columnName="pubDate" headerText="Date" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
Finally, a TextArea needs to be created using the mx:TextArea tag, and a button needs to be created with a click
event handler to call the send() method on the HTTPService object (Listing 6-6).
Listing 6-6. The TextArea and the Button
<mx:TextArea id="body" editable="false" width="{reader.width-15}" height="400" />
<mx:Button label="Load
RSS channel items" click="{httpRSS.send()}" />
HTML5 APIs
HTML5 provides much more than just new structuring elements. HTML5 supports many features that were available
originally through plug-ins or sophisticated code only [6]. Beyond markup elements and attributes, HTML5 specifies
Application Programming Interfaces (APIs) as well [7]. A native drawing API, native sockets, and so on, eliminate the
problems associated with plug-ins.
The HTML5 APIs have separate specifications under W3C standardization. Some of the most frequently used
HTML5 APIs are discussed in the following sections.
The HTML5 Canvas API
The canvas markup element was introduced with HTML5, and the second level of the HTML Canvas 2D Context [8]
was published on December 17, 2012. The HTML5 canvas allows dynamic, scriptable rendering of 2D shapes and
bitmap images on a drawing surface.
the htMl5 canvas has no built-in scene graph, which is a general data structure to arrange the logical (and
often spatial) representation of a graphical scene. the scene graph is commonly used by vector-based graphical systems,
including SVg. in SVg, all drawn shapes are stored as an object in the scene graph or the doM and then rendered as
bitmap graphics. Consequently, if the SVg object attributes are changed, the browser can automatically rerender the
scene, which is not possible on the canvas. From this point of view, SVg graphics are more advanced than shapes on the
htMl5 canvas.
Note
 
 
Search WWH ::




Custom Search