summaryrefslogtreecommitdiff
path: root/libdom
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
commite7366bf41f68cfe07e9ea03fc4a398baecbae651 (patch)
tree5bb9c3cbe7eab7e70ff1ebd65d9de59a694762df /libdom
downloadnetsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.gz
netsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.bz2
Initial conversion from MediaWiki, 20170204
Diffstat (limited to 'libdom')
-rw-r--r--libdom/core_support_status.mdwn254
-rw-r--r--libdom/events_support_status.mdwn115
-rw-r--r--libdom/minimalsubset.mdwn99
-rw-r--r--libdom/the_mutationevent_generation.mdwn96
4 files changed, 564 insertions, 0 deletions
diff --git a/libdom/core_support_status.mdwn b/libdom/core_support_status.mdwn
new file mode 100644
index 0000000..428b761
--- /dev/null
+++ b/libdom/core_support_status.mdwn
@@ -0,0 +1,254 @@
+[[!meta title="LibDOM/Core Support Status"]]
+[[!meta author="Struggleyb"]]
+[[!meta date="2009-08-14T09:09:29Z"]]
+
+
+[[!toc]]
+
+DOM Level 1
+-----------
+
+The DOMTS test result for this level are:
+
+ Total: 527
+ Passed: 421
+ Failed: 106
+ Conversion Error: 2
+ Compile Error: 19
+ Run Error: 52
+ Not Support: 33
+
+The errors mostly root from our XML parser, libxml's SAX parsing ability
+is not very well for entity and namespace. The errors will be fixed
+after we change a XML parser.
+
+
+ DocumentFragment: All
+
+ Document:
+ docType: Yes
+ implementation: Yes
+ documentElement: Yes
+ createDocument: Yes
+ createDocumentFragment: Yes
+ createTextNode: Yes
+ createComment: Yes
+ createCdataSection: Yes
+ createProcessingInstruction: Yes
+ createAttribute: Yes
+ createEntityReference: Yes
+ getElementsByTagName: Yes
+
+ Node:
+ nodeName: Yes
+ nodeValue: Yes
+ nodeType: Yes
+ parentNode: Yes
+ childNodes: Yes
+ firstChild: Yes
+ lastChild: Yes
+ previousSibling: Yes
+ nextSibling: Yes
+ attributes: Yes
+ inserBefore: Yes
+ replaceChild: Yes
+ removeChild: Yes
+ appendChild: Yes
+ hasChildNodes: Yes
+ cloneNode: Yes
+
+ NodeList:
+ item: Yes
+ length: Yes
+
+ NamedNodeMap:
+ getNamedItem: Yes
+ setNamedItem: Yes
+ removeNamedItem: Yes
+ item: Yes
+ length: Yes
+
+ CharacterData:
+ data: Yes
+ length: Yes
+ substringData: Yes
+ appendData: Yes
+ insertData: Yes
+ deleteData: Yes
+ replaceData: Yes
+
+ Attr:
+ name: Yes
+ specified: Yes
+ value: Yes
+
+ Element:
+ tagName: Yes
+ getAttribute: Yes
+ setAttribute: Yes
+ removeAttribute: Yes
+ getAttributeNode: Yes
+ setAttributeNode: Yes
+ removeAttributeNode: Yes
+ getElementsByTagName: Yes
+ normalize: No
+
+ Text:
+ splitText: Yes
+
+ Comment: All
+
+ CDATASection: All
+
+ DocumentType:
+ name: Yes
+ entities: No
+ notations: No
+
+ Notatoin: No Interface
+
+ Entity: No Interface
+
+ EntityReference: All
+
+ ProcessingInstruction: All
+
+DOM Level 2
+-----------
+
+The DOMTS test result for this level are:
+
+ Total: 282
+ Passed: 171
+ Failed: 111
+ Conversion Error: 5
+ Compile Error: 14
+ Run Error: 90
+ Not Support: 18
+
+The errors mostly root from our XML parser, libxml's SAX parsing ability
+is not very well for entity and namespace. The errors will be fixed
+after we change a XML parser.
+
+
+ DOMImplementation:
+ hasFeature: Yes
+ createDocumentType: Yes
+ createDocument: Yes
+
+ Document:
+ importNode: Yes
+ createElementNS: Yes
+ createAttributeNS: Yes
+ getElementsByTagNameNS: Yes
+ getElementById: Yes
+
+ Node:
+ normalize: No
+ isSupported: Yes
+ namespaceURI: No
+ prefix: No
+ localName: Yes
+ hasAttributes: Yes
+
+ NamedNodeMap:
+ getNamedItemNS: Yes
+ setNamedItemNS: Yes
+ removeNamedItemNS: Yes
+
+ Attr:
+ ownerElement: Yes
+
+ Element:
+ getAttributeNS: Yes
+ setAttributeNS: Yes
+ removeAttributeNS: Yes
+ getAttributeNodeNS: Yes
+ setAttributeNodeNS: Yes
+ getElementsByTagNameNS: Yes
+ hasAttribute: Yes
+ hasAttributeNS: Yes
+
+ DocumentType:
+ publicId: Yes
+ systemId: Yes
+ internalSubset: No
+
+DOM Level 3
+-----------
+
+The DOMTS test result for this level are:
+
+ Total: 722
+ Passed: 82
+ Failed: 640
+ Conversion Error: 135
+ Compile Error: 313
+ Run Error: 92
+ Not Support: 100
+
+We did not support many features in level 3 now. After we change our XML
+parser, we should support now.
+
+
+ DOMStringList: No Interface
+
+ NameList: No Interface
+
+ DOMImplementationList: All
+
+ DOMImplementationSource: All
+
+ DOMImplementation:
+ hasFeature: No
+
+ Document:
+ inputEncoding: No
+ xmlEncoding: No
+ xmlStandalone: No
+ xmlVersion: No
+ strictErrorChecking: No
+ documentURI: Yes
+ adoptNode: Yes
+ domConfig: No
+ normalizeDocument: No
+ renameNode: No
+
+ Node:
+ compareDocumentPosition: No
+ textContent: Yes
+ isSameNode: Yes
+ lookupPrefix: No
+ isDefaultNamespace: No
+ lookupNamespaceURI: No
+ isEqualNode: Yes
+ getFeature: Yes
+ setUserData: Yes
+ getUserData: Yes
+
+ Attr:
+ schemaTypeInfo: No
+ isId: Yes
+
+ Element:
+ schemaTypeInfo: No
+ setIdAttribute: Yes
+ setIdAttributeNS: Yes
+ setIdAttributeNode: Yes
+
+ Text:
+ isElementContentWhitespace: No
+ wholeText: No
+ replaceWholeText: No
+
+ TypeInfo: No
+
+ UserDataHandler: All
+
+ DOMError: No Interface
+
+ DOMErrorHandler: No Interface
+
+ DOMLocator: No Interface
+
+ DOMConfiguration: No Interface
diff --git a/libdom/events_support_status.mdwn b/libdom/events_support_status.mdwn
new file mode 100644
index 0000000..4f92122
--- /dev/null
+++ b/libdom/events_support_status.mdwn
@@ -0,0 +1,115 @@
+[[!meta title="LibDOM/Events Support Status"]]
+[[!meta author="Struggleyb"]]
+[[!meta date="2009-08-14T09:08:39Z"]]
+
+
+[[!toc]]
+
+Level 1
+-------
+
+ Level 1 has No Events model defined at all. ^_^
+
+Level 2
+-------
+
+The DOMTS test result for this level are:
+
+ Total: 26
+ Passed: 19
+ Failed: 7
+ Conversion Error: 5
+ Compile Error: 1
+ Run Error: 1
+ Not Support: 0
+
+The errors mostly root from our conversion script, there are many new
+XML elements need to be converted before all the testcase's XML file can
+be converted successfully. But there are only 6 test cases failed, I
+don't think it worth the work to write a more complex conversion script
+to just deal with 6 trivial test cases. So, just leave it as this.
+
+
+ EventTarget:
+ addEventListener: Yes
+ removeEventListener: Yes
+ dispatchEvent: Yes
+
+ EventListener: All
+
+ Event:
+ type: Yes
+ target: Yes
+ currentTarget: Yes
+ eventPhase: Yes
+ bubbles: Yes
+ cancelable: Yes
+ timeStamp: Yes
+ stopPropagation: Yes
+ preventDefault: Yes
+ initEvent: Yes
+
+ EventException: All
+
+ DocumentEvent:
+ createEvent: Yes
+
+ UIEvent:
+ view: Yes(But no AbstractView support!)
+ detail: Yes
+ initUIEvent: Yes
+
+ MouseEvent: All
+
+ MutationEvent: All
+
+Level 3
+-------
+
+The DOMTS test result for this level are:
+
+ Total: 1
+ Passed: 0
+ Failed: 1
+ Conversion Error: 1
+ Compile Error: 0
+ Run Error: 0
+ Not Support: 0
+
+The errors mostly root from our conversion script, there are many new
+XML elements need to be converted before all the testcase's XML file can
+be converted successfully. But there are only 1 test case failed, I
+don't think it worth the work to write a more complex conversion script
+to just deal with 6 trivial test cases. So, just leave it as this.
+
+
+ Event:
+ namespaceURI: No
+ stopImmediatePropagation: Yes
+ defaultPrevented: Yes
+ initEventNS: Yes
+
+ CustomEvent: All
+
+ EventTarget:
+ addEventListenerNS: No
+ removeEventListenerNS: No
+
+ DocumentEvent:
+ canDispatch: No
+
+ UIEvent: All
+
+ TextEvent: All
+
+ KeyboardEvent: All
+
+ MouseEvent: All
+
+ MouseMultiWheelEvent: All
+
+ MouseWheelEvent: All
+
+ MutationEvent: All
+
+ MutationNameEvent: All
diff --git a/libdom/minimalsubset.mdwn b/libdom/minimalsubset.mdwn
new file mode 100644
index 0000000..808a5f3
--- /dev/null
+++ b/libdom/minimalsubset.mdwn
@@ -0,0 +1,99 @@
+[[!meta title="LibDOM/MinimalSubset"]]
+[[!meta author="Tlsa"]]
+[[!meta date="2012-03-31T09:51:42Z"]]
+
+
+[[!toc]]
+
+Overview
+--------
+
+This page enumerates the minimal subset required before it's worth
+integrating LibDOM with NetSurf's current engine:
+
+- Core (Document, Element, Attribute, etc)
+- EventTarget
+- HTMLDocument, HTMLElement
+
+With the above interfaces, we can create an HTMLDocument instance per
+page and create a tree of HTMLElement instances for the content.
+Specialised HTMLElement subclasses can be added as required.
+
+Current Status
+--------------
+
+We now have all the above interfaces implemented (to some level of
+completeness). The example dom-structure-dump code is now capable of
+building an HTMLDocument using HTMLElement nodes and not leaking dynamic
+resources.
+
+Before integration can proceed, the following (at least) needs doing:
+
+- <s>We need to invent an API to permit comparison of classes to
+ satisfy LibCSS' has\_class selection callback's needs.</s>
+ - <s>Implement this API</s>.
+
+Once the above things are complete, integration may proceed as follows:
+
+- <s>Remove the parser binding infrastructure from NetSurf's HTML
+ content handler and replace it with instantiation of LibDOM.</s>
+- <s>Port the box tree constructor to the LibDOM API</s>
+- <s>Fix up anything else that expects a libxml tree (save complete is
+ a likely candidate)</s>
+- Construct form gadgets during box tree construction & register them
+ with the relevant DOM node
+
+In order to not have memory consumption issues and performance
+regressions, we also need to to:
+
+- <s>Replace the hash table of EventListeners on an EventTarget with a
+ linked list, or similar -- the current implementation is both a
+ memory hog and broken.</s>
+- <s>Replace the hash tables for Attributes attached to Element nodes
+ with linked lists, or similar. Again, this is currently wasting
+ memory for no benefit.</s>
+- The Hubbub parser binding needs bringing into sync with the feature
+ set of the parser binding used in NetSurf. Feature parity must be
+ ensured to avoid regressions. Specifically:
+ - <s>There needs to be a way to set the quirks mode of a document,
+ and retrieve it (i.e. specialised API on HTMLDocument)</s>
+ - Form association needs implementing (i.e. specialised API on
+ HTMLFormElement)
+ - Fix the mess that is/implement HTMLCollection,
+ HTMLOptionsCollection, HTMLFormElement, HTMLInputElement,
+ HTMLSelectElement, HTMLOptionElement, HTMLTextareaElement
+ (May get away with just HTMLCollection and HTMLFormElement
+ initially)
+ - HTMLCollection can \*not\* assume that the collection
+ contents all live beneath a fixed root node
+ (particularly for form inputs)
+ - Register form control elements with their form
+ - Work out when to deregister them again
+ - <s>Class/id attribute optimisations need retaining (see
+ below)</s>
+- <s>HTMLElement needs to gain optimisations for class attributes
+ (i.e. pre-parse the value string into individual class identifiers).
+ See NetSurf's existing Hubbub binding for an approximation of what's
+ needed -- HTMLElement.setAttr(NS) is probably where this needs to
+ live (or possibly implement it in Element.setAttr(NS) or
+ Attr.setValue if we want the same behaviour for XML documents). </s>
+
+The above work can be done in parallel with the integration work but
+must be completed before a release can occur.
+
+To tidy things up before a libdom release, we need to do the following:
+
+- Get speed back to pre-libdom.
+- Sort out DOM events.
+- Cleanup idea:
+ - Every point in netsurf which uses libdom should ensure any time
+ it passes a pointer to a dom\_node pointer, it makes it NULL
+ first.
+ - Then every API in libdom which takes a pointer to a dom\_node
+ pointer in order to return a dom\_node pointer, it asserts that
+ the pointer points to a NULL.
+ - Then once we're sure that no user is asserting we alter that
+ assert to an "if not NULL, unref and set to NULL"
+ - Then we can simplify callers, often into for() loops rather than
+ complex while loops with unreffings.
+
diff --git a/libdom/the_mutationevent_generation.mdwn b/libdom/the_mutationevent_generation.mdwn
new file mode 100644
index 0000000..ae00db3
--- /dev/null
+++ b/libdom/the_mutationevent_generation.mdwn
@@ -0,0 +1,96 @@
+[[!meta title="LibDOM/The MutationEvent generation"]]
+[[!meta author="Struggleyb"]]
+[[!meta date="2009-08-09T10:20:48Z"]]
+
+
+[[!toc]]
+
+Events with Methods Generate them
+---------------------------------
+
+
+ DOMSubtreeModified:
+
+
+ DOMNodeRemovedFromDocument:
+ Node.replaceChild
+ Node.removeChild
+ Element.removeAttribute
+ Element.setAttributeNode
+ Element.removeAttributeNode
+ Element.removeAttributeNS
+ Element.setAttributeNodeNS
+
+ DOMNodeInsertedIntoDocument:
+ Node.insertBefore
+ Node.replaceChild
+ Node.appendChild
+ Element.setAttribute
+ Element.setAttributeNode
+ Element.setAttributeNS
+ Element.setAttributeNodeNS
+
+ DOMNodeInserted:
+ Node.insertBefore
+ Node.replaceChild
+ Node.appendChild
+ Element.setAttribute
+ Element.setAttributeNode
+ Element.setAttributeNS
+ Element.setAttributeNodeNS
+
+ DOMNodeRemoved:
+ Node.replaceChild
+ Node.removeChild
+ Element.removeAttribute
+ Element.setAttributeNode
+ Element.removeAttributeNode
+ Element.removeAttributeNS
+ Element.setAttributeNodeNS
+
+ DOMAttrModified:
+ Element.setAttribute
+ Element.removeAttribute
+ Element.setAttributeNode
+ Element.removeAttributeNode
+ Element.setAttributeNS
+ Element.removeAttributeNS
+ Element.setAttributeNodeNS
+
+ DOMCharacterDataModified:
+ Node.nodeValue
+ CharacterData.data
+ CharacterData.appendData
+ CharacterData.deleteData
+ CharacterData.insertData
+ CharacterData.replaceData
+ ProcessingInstruction.data
+
+#### Some Event Generation Order consideration
+
+As above, some changes of DOM caused by certain API can emit multiple
+Events. In some situation, the DOM spec define the order of the events.
+For example, when an Attr is removed from an element, the implementation
+should send the following events as the following order:
+
+ DOMNodeRemoved
+ DOMAttrModified
+ DOMSubtreeModified
+
+But in other situation, the events order are not specified. For example,
+when an Attr is added to an element, the implement should may send:
+
+ DOMNodeInserted
+ DOMAttrModified
+ DOMSubtreeModified
+
+or
+
+ DOMAttrModified
+ DOMNodeInserted
+ DOMSubtreeModified
+
+The point here is, the DOMAttrModified and DOMNodeInserted can be
+dispatched in any order, but the DOMSubtreeModified event should always
+the last event after bunch of events.
+