It is intended for use in testing ECMAScript libraries outside of a browser environment.
This file is standalone, with no dependencies on other files.
As a side-effect of loading this file, the global variable "document" will become an instance of BUFakeDocument, if the variable "document" is not already defined.
The implementation is at least as complete as most browsers are today :) .
The main feature lacking is document.write()
.
Here are the functions and attributes not yet implemented:
We have not implemented these Node methods Node Node.cloneNode(Boolean deep) void Node.normalize()
We do support: UIEvent, MouseEvent, HTMLEvent but not: MutationEvent
We have no special support for these attributes of HTMLDocument: title, referrer, domain, URL, body, images, applets, links, forms, anchors, cookie We have no special support for these attributes of HTMLElement: id, title, lang, dir, className Or for any of the other HTML* classes ( http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html ): HTMLHtmlElement, HTMLHeadElement, HTMLLinkELement, HTMLTitleElement, HTMLMetaElement, HTMLBaseElement, HTMLIsIndexElement, HTMLStyleElement, HTMLBodyElement, ... Or for these tag-specific attributes ( http://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY ): BODY.onload, BODY.onunload, ...
We do not support these methods of HTMLDocument: open(), close(), write(text), writeln(text)
We need a BUFakeCharacterData subclass of BUFakeNode This can be a Comment, Text, or CDATA node. We need to support the special attributes of those 3 node types too. The methods are: String BUFakeCharacterData.substringData(long offset, long count) void BUFakeCharacterData.appendData(String arg) void BUFakeCharacterData.insertData(long offset, String arg) void BUFakeCharacterData.deleteData(long offset, long count) void BUFakeCharacterData.insertData(long offset, long count, String arg)
None of the xml-ish methods (ending in "NS") are implemented, nor are the Node member variables namespaceURI, prefix, localName.
We have no support for these interfaces: Entity, EntityReference, DocumentType, ProcessingInstruction, Notation, DocumentFragment
We have only very partial support for DOMImplementation.
This implements a HTML-style DOM. In particular, node names are uppercased when returned by API functions, regardless of their letter case when created.
All methods that return a NodeList in the specification are implemented here to return an Array. These Arrays are not "live", unlike a DOM NodeList. They also do not support the item(number)
interface.
Node.attributes is implemented as an object which is both an Array (with numerical index) and an associative array (with name index). It is "live". It does not implement item(number)
or any of the other methods of NamedNodeMap.
Note that while Document.getEementsByName does return an Array, we do not implement support for duplicate uses of the same name.
We do not enforce that any member attributes are readonly.
We do not attempt to synchronize the values of aliased properties (for example, Element nodeName and tagName, or Attr nodeName and name).
Licensed under the Academic Free License 1.2 http://www.opensource.org/licenses/academic.php