Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

xml/fix_dom.java File Reference


Detailed Description

Utility file - attempts to bring up the builtin DOM objects to DOM compliance.

This does not provide any additional functionality; for that see other files.

Note that some libraries take the approach of extending the builtin DOM objects of non-IE browsers to have non-standard IE methods like insertAdjacentHTML or innerHTML. We don't do that. Instead, such utilities are in burst.xml.DomUtil, not attached to builtin objects.

Internet Explorer

It is unfortunately difficult to do much about Internet Explorer. In IE, the DOM inheritance hierarchy (Object/Node/Element/HTMLElement) is not available. There is no HTMLElement, let alone HTMLElement.prototype. All DOM objects are just Object.

That makes it rather hard to add or fix functions on those objects.

Also, IE has no getter/setter ability like Moz does for adding variables from the "outside". Apparently JScript v7 ("JScript.Net") has setters and getters but that isn't in IE6, and just works for extending properties and not methods.

An IE "behavior" with an onpropertychange might be used to add a custom property, though not a method.

One workaround of having only Object instances available, would be to iterate through all nodes in the current document and add methods to those instances. See discussion at http://groups.google.com/groups?selm=3D610C83.2AAFCF67%40agricoreunited.com But apparently that doesn't work on text nodes (nodeType 3), and it seems like a lot of overhead. It also doesn't solve the problem of dynamically added nodes.

So right now, the only thing we fix for IE is the lack of Node constants like ELEMENT_NODE.

Mozilla

In Moz, it is possible to extend the DOM objects, for example to add an implementation of createNodeIterator method. (Note that apparently at least NS6.1 PR1 did not have HTMLElement.prototype).

Moz also has the setter/getter mechanism for adding attributes.

Right now, we aren't doing anything for Moz.

Author:
Copyright 2003 Mark D. Anderson (mda@discerning.com)

Licensed under the Academic Free License 1.2 http://www.opensource.org/licenses/academic.php


Generated on Tue Nov 30 04:03:08 2004 for BurstProject by doxygen 1.3.4