- From: W3C Community Development Team <team-community-process@w3.org>
- Date: Mon, 21 Sep 2015 16:37:24 +0000
- To: public-argumentation@w3.org
Innovations for the document object model[1] are presented, interfaces DOMFactoryResolver and DOMFactory, towards a document object model 5 (DOM5). The DOMFactoryResolver interface is utilized to obtain DOMFactory factories with which to create objects implementing Element. DOMFactoryResolver resembles Java's java.lang.ClassLoader[3] and DOMFactory resembles Java's java.lang.Class[2]. As XML parsers parse, parsing encounters the URI of XML elements, as per XML namespaces and elements' names. The URI can be utilized with DOMFactoryResolver to obtain DOMFactory factories with which to create the objects implementing Element. The approach greatly increases the extensibility of the document object model. Implementations of DOMFactoryResolver can, utilizing URI as URL, download DOMFactory serializations, e.g. XML or WebAssembly[4], can utilize cached downloaded serializations, or can utilize built-in implementations. interface DOMFactory { [NewObject] Element createElementNS(Document document, DOMString? namespace, DOMString qualifiedName); ... }; interface DOMFactoryResolver { DOMFactory? resolve(DOMString? namespace, DOMString qualifiedName); ... }; interface DOMImplementation { [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId); [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null, optional DOMFactoryResolver? resolver = null); [NewObject] Document createHTMLDocument(optional DOMString title, optional DOMFactoryResolver? resolver = null); boolean hasFeature(); }; [Constructor] interface Document : Node { [SameObject] readonly attribute DOMImplementation implementation; readonly attribute DOMString URL; readonly attribute DOMString documentURI; readonly attribute DOMString origin; readonly attribute DOMString compatMode; readonly attribute DOMString characterSet; readonly attribute DOMString contentType; readonly attribute DocumentType? doctype; readonly attribute DOMFactoryResolver? resolver; readonly attribute Element? documentElement; HTMLCollection getElementsByTagName(DOMString localName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); [NewObject] Element createElement(DOMString localName); [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName); [NewObject] DocumentFragment createDocumentFragment(); [NewObject] Text createTextNode(DOMString data); [NewObject] Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); Node importNode(Node node, optional boolean deep = false); Node adoptNode(Node node); [NewObject] Event createEvent(DOMString interface); [NewObject] Range createRange(); [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); }; interface XMLDocument : Document {}; [1] http://www.w3.org/TR/dom/ [2] https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html [3] https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html [4] https://www.w3.org/community/webassembly/ ---------- This post sent on Argumentation Community Group 'Document Object Model 5' https://www.w3.org/community/argumentation/2015/09/21/document-object-model-5/ Learn more about the Argumentation Community Group: https://www.w3.org/community/argumentation
Received on Monday, 21 September 2015 16:37:28 UTC