Prev | Current Page 730 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Elements in the DOM are organized in a hierarchy of nodes. The DOM adopted by haXe is
the one defined by the W3C and tries to avoid mapping definitions available only on certain browsers.
The idea is to be as standard as possible. The DOM mapping does not add any functionality or tries to
resolve any compatibility issue; it is straight mapping, admittedly with some dark areas of features not
implemented, of the W3C definition. The advantage for the developer is that he has all the flexibility to
build what he needs from scratch and the output file is not encumbered with potentially unused
features. The biggest disadvantage is that he or she will have to solve browser - specific issues when
encountered.
The package includes a file Dom.hx that maps the definitions of the HTML Elements to haXe types.
Figure 14 - 2 shows the definitions included in the file. Note that those definitions are not external classes
but just plain typedef and, thus, they cannot be created using the standard instantiation statement but
by using the proper methods provided by the DOM environment.


Pages:
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742