Comparison of layout engines (Document Object Model)

From Wikipedia, the free encyclopedia.

The following tables compare DOM compatibility and support for a number of layout engines. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date. Unless otherwise specified in footnotes, comparisons are based on the stable versions without any add-ons, extensions or external programs.

For features that are fully supported (based on DOM Level 2 or DOM Level 3 modules that are under W3C Recommendation), an exact version number is given if it is certain that the feature was added in such version. DOM Level 0 and DOM Level 3 modules that are still under development are not included.

Contents

[edit] Explanation of the tables

[edit] Engine nomenclature

Rather than the names of web browsers, the names of the underlying engines are used. The browsers that use the various engines are listed below.

Layout Engine Used By
Trident (also known as MSHTML) Internet Explorer 4, 5, 6, 7, 8
Tasman Internet Explorer for Mac; MSN for Mac OS X
Gecko All Mozilla software, including Firefox; Galeon; Flock; also Epiphany
WebKit Safari; Shiira; iCab 4; Epiphany; Adobe Air; Google Chrome; Midori; OmniWeb; Adobe Dreamweaver CS4;
KHTML Konqueror
Presto Opera; Nintendo DS Browser; Internet Channel; future Adobe Systems products
iCab iCab 1-3
Prince XML Prince XML
Amaya Amaya

[edit] Values

Values indicate the level of support in the most recent version of the layout engine, or (if a version number is given) in the specified version. Version numbers without any other value indicate the version at which the layout engine first fully supported the feature.

Value Meaning
Yes Indicates that the layout engine fully supports this property when valid values are used.
No Indicates that this property is completely ignored.
Partial Indicates that the property is understood, but that not all values are supported. Supported values are implemented correctly.
Incorrect Indicates that the property is understood, but that it is not implemented correctly in all cases.
Experimental Indicates that the property is provided in experimental form under an alternative name, generally with only partial functionality.

[edit] General overview

Trident Tasman Gecko WebKit KHTML Presto iCab
DOM1 6.0 Yes 1.0 85 Yes 7.0 Yes
DOM2 Minor Minor Major Major Major Major Major
DOM3 No No Minor Minor Minor Minor Minor

[edit] Core (Fundamental)

The interfaces within this section are considered fundamental, and must be fully implemented by all conforming implementations of the DOM, including all HTML DOM implementations.

Trident Tasman Gecko WebKit[1] KHTML Presto iCab
Exception DOMException
DOM1 code  ?  ? 1.0  ?  ? 7.0  ?
Interface DOMStringList
DOM3 length No No 1.6 No  ? 9.0  ?
contains() No No 1.6 No  ? 9.0  ?
item() No No 1.6 No  ? 9.0  ?
Interface NameList
DOM3 length No No 1.6 No No No No
getName() No No 1.6 No No No No
getNamespaceURI() No No 1.6 No No No No
contains() No No 1.6 No No No No
containsNS() No No 1.6 No No No No
Interface DOMImplementationList
DOM3 length No No No No No No No
item() No No No No No No No
Interface DOMImplementationSource
DOM3 getDOMImplementation() No No No No No No No
getDOMImplementationList() No No No No No No No
Interface DOMImplementation
DOM1 hasFeature() 6.0  ? 1.0 Yes  ? 7.0  ?
DOM2 createDocumentType() No No 1.0 Yes  ? 8.0  ?
createDocument() No No 1.0 Yes  ? 8.0  ?
DOM3 getFeature() No No No No  ? 8.0  ?
Interface DocumentFragment
DOM1 (no properties) 6.0 No 1.0  ?  ? 7.0  ?
Interface Document
DOM1 doctype No Yes 1.0 Yes  ? 7.0  ?
implementation 6.0 Yes 1.0 Yes  ? 7.0  ?
documentElement 5.0 Yes 1.0 Yes  ? 7.0  ?
createElement() 4.0 Yes 1.0 Yes  ? 7.0  ?
createDocumentFragment() 6.0 No 1.0 Yes  ? 7.0  ?
createTextNode() 5.0 Yes 1.0 Yes  ? 7.0  ?
createComment() 6.0 No 1.0 Yes  ? 7.0  ?
createCDATASection() No No 1.0 Yes  ? 8.0  ?
createProcessingInstruction() No  ? 1.7 Yes  ? 8.0  ?
createAttribute() 5.0 Yes 1.0 Yes  ? 7.0  ?
createEntityReference() No  ? 1.0 Yes  ? No  ?
getElementsByTagName() 5.0 Yes 1.0 Yes  ? 7.0  ?
DOM2 importNode() No No 1.0 Yes  ? 7.0  ?
createElementNS() No No 1.0 Yes  ? 8.0  ?
createAttributeNS() No No 1.0 Yes  ? 8.0  ?
getElementsByTagNameNS() No No 1.0 Yes  ? 8.0  ?
getElementById() Incorrect Yes 1.0 Yes  ? 9.5  ?
DOM3 inputEncoding No No 1.7 No  ? No  ?
xmlEncoding No No 1.7 No  ? No  ?
xmlStandalone No No 1.7 No  ? No  ?
xmlVersion No No 1.7 No  ? No  ?
domConfig No No 1.7 No  ? No  ?
strictErrorChecking No No 1.7 No  ? No  ?
documentURI No No 1.7 No  ? No  ?
adoptNode() No No 1.7 Yes  ? 9.0  ?
normalizeDocument() No No 1.7 No  ? No  ?
renameNode() No No 1.7 No  ? No  ?
Interface Node
DOM1 nodeName 5.0 Yes 1.0 Yes  ? 7.0  ?
nodeValue 5.0 1.0  ?  ?
nodeType 5.0 1.0  ?  ?
parentNode 5.0 1.0  ?  ?
childNodes 5.0 1.0  ?  ?
firstChild 5.0 1.0  ?  ?
lastChild 5.0 1.0  ?  ?
previousSibling 5.0 1.0  ?  ?
nextSibling 5.0 1.0  ?  ?
attributes 5.0 1.0  ?  ?
ownerDocument 5.0 1.9  ?  ?
insertBefore() 5.0 Partial  ?  ?
replaceChild() 5.0 Partial  ?  ?
removeChild() 5.0 Partial  ?  ?
appendChild() 5.0 Partial  ?  ?
hasChildNodes() 6.0[2] 1.0  ?  ?
cloneNode() 5.0 1.0  ?  ?
DOM2 namespaceURI 5.0 Yes 1.0 Yes  ? 7.0  ?
prefix 5.0  ? 7.0  ?
localName 5.0  ? 7.0  ?
isSupported() No  ? 7.0  ?
hasAttributes() No  ? 7.0  ?
DOM3 baseURI No No 1.7 Yes  ? No  ?
textContent No 1.7  ? 9.0  ?
compareDocumentPosition() No 1.7  ? 9.5  ?
isSameNode() Partial 1.8  ? 9.5  ?
lookupPrefix() No 1.7  ? 9.0  ?
isDefaultNamespace() No 1.7  ? 9.0  ?
lookupNamespaceURI() No 1.7  ? 9.0  ?
isEqualNode() No 1.9  ? No  ?
getFeature() No 1.7  ? 9.0  ?
setUserData() No 1.7  ? No  ?
getUserData() No 1.7  ? No  ?
Interface NodeList
DOM1 length 5.0 Yes 1.0 Yes  ? 7.0  ?
item()  ?  ?
Interface NamedNodeMap
DOM1 length 5.0 Yes 1.0 Yes  ? 7.0  ?
getNamedItem()  ?  ?
setNamedItem()  ?  ?
removeNamedItem()  ?  ?
item()  ?  ?
DOM2 getNamedItemNS() No No 1.0 Yes  ? 7.0  ?
setNamedItemNS()  ?  ?
removeNamedItemNS()  ?  ?
Interface CharacterData
DOM1 data 4.0 Yes 1.0 Yes  ? 7.0  ?
length  ?  ?
substringData()  ?  ?
appendData()  ?  ?
insertData()  ?  ?
deleteData()  ?  ?
replaceData()  ?  ?
Interface Attr
DOM1 name 6.0  ? 1.0 Yes  ? 7.0  ?
specified Incorrect Incorrect Incorrect Yes  ?
value 6.0  ? 1.0  ?  ?
DOM2 ownerElement No  ? 1.0 Yes  ? 7.0  ?
DOM3 schemaTypeInfo No No No No  ? No  ?
isId  ?  ?
Interface Element
DOM1 tagName 4.0 Yes 1.0 Yes  ? 7.0  ?
getAttribute() Incorrect Yes  ?  ?
setAttribute() Incorrect Yes  ?  ?
removeAttribute() Incorrect Yes  ?  ?
getAttributeNode() 6.0 Yes  ?  ?
setAttributeNode() No Yes  ?  ?
removeAttributeNode() No Yes  ?  ?
getElementsByTagName() 4.0 Yes  ?  ?
normalize() No No  ?  ?
DOM2 getAttributeNS() No Yes 1.0 Yes  ? 8.0  ?
setAttributeNS() Yes  ?  ?
removeAttributeNS() Yes  ?  ?
getAttributeNodeNS() Yes  ?  ?
setAttributeNodeNS() Yes  ?  ?
getElementsByTagNameNS() No  ?  ?
hasAttribute() Yes  ?  ?
hasAttributeNS() Yes  ?  ?
DOM3 schemaTypeInfo No No No No  ? No  ?
setIdAttribute()  ?  ?
setIdAttributeNS()  ?  ?
setIdAttributeNode()  ?  ?
Interface Text
DOM1 splitText() No Yes 1.0 Yes  ? 7.0  ?
DOM3 isElementContentWhitespace No No 1.9.1 No  ? No  ?
wholeText 1.9.1  ? 9.5  ?
replaceWholeText() 1.9.1  ? 9.5  ?
Interface Comment
DOM1 (no properties) 6.0 No 1.0 Yes  ? 7.0  ?
Interface TypeInfo
DOM3 typeName No No No No No No No
typeNamespace
isDerivedFrom()
Interface UserDataHandler
DOM3 handle() No No No No No No No
Interface DOMError
DOM3 severity No No No No No 9.0 No
message 9.0
type 9.0
relatedException No
relatedData 9.0
location 9.0
Interface DOMErrorHandler
DOM3 handleError() No No No No No 9.0 No
Interface DOMLocator
DOM3 lineNumber No No No No No 9.0 No
columnNumber
byteOffset
utf16Offset
relatedNode
uri
Interface DOMConfiguration
DOM3 parameterNames No No No No  ? 9.0  ?
setParameter()  ?  ?
getParameter()  ?  ?
canSetParameter()  ?  ?

[edit] Trident Core (Fundamental) notes

  1. docType returns true when checked but always contains null.
  2. getElementById() — returns elements with name attribute set to value being found, not only id. Present in IE7. [1]
  3. getAttribute(), setAttribute(), removeAttribute() — returns, sets, and removes, respectively, the corresponding DOM property instead of the string value of the attribute. For example, element.getAttribute('onclick') returns element.onclick, which is a reference to a function and not a string. Another example: element.removeAttribute('class') does not work as expected; element.removeAttribute('className') must be called instead. getAttribute and setAttribute with 'style' as their parameter don't work, but the inline style can be retrieved by setting the non-standard iFlags parameter to 2 (i.e. by calling element.getAttribute('style',2)), or accessed using the Node.style property. [2]
  4. AttributeNode.specified — Does not set specified to true if ownerElement should be null.
  5. Node.isSameNode — isSameNode is only supported for XML documents, not HTML ones.

[edit] Tasman Core (Fundamental) notes

  1. AttributeNode.specified — Does not set specified to true if ownerElement should be null.

[edit] Gecko Core (Fundamental) notes

  1. insertBefore(), replaceChild(), removeChild(), appendChild() — Fails on Attr nodes [3]. appendChild does not work as expected for DocumentFragment nodes prior to 1.8 [4].
  2. createEntityReference() — Supported, but returns null when the method is checked [5].
  3. AttributeNode.specified — Does not set specified to true if ownerElement is null [6]. As it also does not create Attribute Nodes for default values specified in the DTD, it renders this property absolutely useless.
  4. wholeText, replaceWholeText() — See Bug 421765 on Bugzilla

[edit] Presto Core (Fundamental) notes

  1. getElementById() — Versions prior to Opera 9.50 returns elements with name attribute set to value being found, not only id [7].
  2. URI attribute value — In versions prior to Opera 9, all URI attribute values are resolved to full URI. Hence the value from getAttribute() and getAttributeNode() could be wrong if relative URIs are used.
  3. Attributes that are not supported in the layout engine are still parsed and available through DOM. E.g. char and charoff are available under .ch and .chOff.
  4. In Opera 8.54 methods DOMImplementation.createDocument and DOMDocument.createElementNS both fail to accept any non-empty namespace URI. They work in Opera 9 Beta 2 and they may also have worked before (somebody with Opera 8, please check.) The symptom is that the namespaceURI property is null/empty and serialization gives wrong result.

[edit] Core (Extended)

The interfaces defined here form part of the DOM Core specification, but objects that expose these interfaces will never be encountered in a DOM implementation that deals only with HTML.

Trident Tasman Gecko WebKit[1] KHTML Presto iCab
Interface CDATASection
DOM1 (no properties) No No 1.0 Yes  ? 9.0  ?
Interface DocumentType
DOM1 name No No 1.0 Yes  ? 8.0  ?
entities No No No [8] Yes  ? 8.0  ?
notations No No No [9] Yes  ? 8.0  ?
DOM2 publicId No No 1.0 Yes  ? 8.0  ?
systemId No No 1.0 Yes  ? 8.0  ?
internalSubset No No 1.0 Yes  ? 8.0  ?
Interface Notation
DOM1 publicId No No 1.0 Yes  ? 9.0  ?
systemId No No 1.0 Yes  ? 9.0  ?
Interface Entity
DOM1 publicId No No 1.0 Yes  ? No  ?
systemId No No 1.0 Yes  ? No  ?
notationName No No 1.0 Yes  ? No  ?
DOM3 inputEncoding No No No No  ? No  ?
xmlEncoding No No No No  ? No  ?
xmlVersion No No No No  ? No  ?
Interface EntityReference
DOM1 (no properties) No No 1.0 Yes  ? No  ?
Interface ProcessingInstruction
DOM1 target No No 1.0 Yes  ? 9.0  ?
data No No 1.0 Yes  ? 9.0  ?

[edit] HTML

The interfaces found within this section are not mandatory. This section extends the DOM Core API to describe objects and methods specific to HTML documents, and XHTML documents. In general, the functionality needed to manipulate hierarchical document structures, elements, and attributes will be found in the core section; functionality that depends on the specific elements defined in HTML will be found in this section. Elements deprecated since HTML 4.01 are not listed. Some elements and attributes listed here are deprecated in XHTML 1.1. For example, presentation attributes, image maps, frames and targets.

Trident Tasman Gecko WebKit KHTML Presto iCab
Interface HTMLCollection
DOM1 length 7.0  ? 1.0  ?  ? 7.0  ?
item() 7.0  ? 1.0  ?  ? 7.0  ?
namedItem() 7.0  ? 1.0  ?  ? 7.0  ?
Interface HTMLOptionsCollection
DOM2 length  ?  ? 1.0  ?  ? 9.0  ?
item()  ?  ? 1.0  ?  ? 9.0  ?
namedItem()  ?  ? 1.0  ?  ? 9.0  ?
Interface HTMLDocument
DOM1 title 3.0 Yes 1.0  ?  ? 7.0  ?
referrer 3.0 Yes 1.0  ?  ? 7.0  ?
domain 4.0 Yes 1.0  ?  ? 7.0  ?
URL 4.0 Yes 1.0  ?  ? 7.0  ?
body 4.0 Yes 1.0  ?  ? 7.0  ?
images 4.0 Yes 1.0  ?  ? 7.0  ?
applets 4.0 Yes 1.0  ?  ? 7.0  ?
links 3.0 Yes 1.0  ?  ? 7.0  ?
forms 3.0 Yes 1.0  ?  ? 7.0  ?
anchors 3.0 Yes 1.0  ?  ? 7.0  ?
cookie 3.0 Yes 1.0  ?  ? 7.0  ?
open() 3.0 Yes 1.0  ?  ? 7.0  ?
close() 3.0 Yes 1.0  ?  ? 7.0  ?
write() 3.0 Yes 1.0  ?  ? 7.0  ?
writeln() 3.0 Yes 1.0  ?  ? 7.0  ?
getElementsByName() Yes  ? 1.0  ?  ? 7.0  ?
Interface HTMLElement
DOM1 id 4.0 Yes 1.0  ?  ? 7.0  ?
title 4.0 Yes 1.0  ?  ? 7.0  ?
lang 4.0 Yes 1.0  ?  ? 7.0  ?
dir 5.0 Yes 1.0  ?  ? 7.0  ?
className 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLHtmlElement
DOM1 version 6.0  ? 1.0  ?  ? 9.0  ?
Interface HTMLHeadElement
DOM1 profile Incorrect  ? 1.0  ?  ? 8.0  ?
Interface HTMLLinkElement
DOM1 disabled 4.0 Yes 1.0  ?  ? 7.0  ?
charset 4.0 Yes 1.0  ?  ? 7.0  ?
href Incorrect Yes 1.0  ?  ? 7.0  ?
hreflang 4.0 Yes 1.0  ?  ? 7.0  ?
media 4.0 Yes 1.0  ?  ? 7.0  ?
rel 4.0 Yes 1.0  ?  ? 7.0  ?
rev 4.0 Yes 1.0  ?  ? 7.0  ?
target 4.0 Yes 1.0  ?  ? 7.0  ?
type 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLTitleElement
DOM1 text 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLMetaElement
DOM1 content 4.0 Yes 1.0  ?  ? 7.0  ?
httpEquiv 4.0 Yes 1.0  ?  ? 7.0  ?
name 4.0 Yes 1.0  ?  ? 7.0  ?
scheme 6.0  ? 1.0  ?  ? 9.0  ?
Interface HTMLBaseElement
DOM1 href Incorrect Yes 1.0  ?  ? 9.0  ?
target 4.0 Yes 1.0  ?  ? 9.0  ?
Interface HTMLStyleElement
DOM2 disabled  ?  ? 1.0  ?  ? 7.0  ?
media 4.0 Yes 1.0  ?  ? 7.0  ?
type 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLBodyElement
DOM1 aLink 4.0 Yes 1.0  ?  ? 7.0  ?
background Incorrect Yes 1.0  ?  ? 7.0  ?
bgColor 4.0 Yes 1.0  ?  ? 7.0  ?
link 4.0 Yes 1.0  ?  ? 7.0  ?
text 4.0 Yes 1.0  ?  ? 7.0  ?
vLink 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLFormElement
DOM1 elements 3.0 Yes 1.0  ?  ? 7.0  ?
length 3.0 Yes 1.0  ?  ? 7.0  ?
name 3.0 Yes 1.0  ?  ? 7.0  ?
acceptEncoding  ?  ? 1.0  ?  ? 7.0  ?
action Incorrect Yes 1.9  ?  ? 7.0  ?
enctype 4.0 Yes 1.0  ?  ? 7.0  ?
method 3.0 Yes 1.0  ?  ? 7.0  ?
target 3.0 Yes 1.0  ?  ? 7.0  ?
submit() 3.0 Yes 1.0  ?  ? 7.0  ?
reset() 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLSelectElement
DOM1 type 4.0 Yes 1.0  ?  ? 7.0  ?
selectedIndex 3.0 Yes 1.0  ?  ? 7.0  ?
value 4.0 Yes 1.0  ?  ? 7.0  ?
length 3.0 Yes 1.0  ?  ? 7.0  ?
form  ?  ? 1.0  ?  ? 7.0  ?
options 3.0 Yes 1.0  ?  ? 7.0  ?
disabled 5.0 Yes 1.0  ?  ? 7.0  ?
multiple 5.0 Yes 1.0  ?  ? 7.0  ?
name 3.0 Yes 1.0  ?  ? 7.0  ?
size 4.0 Yes 1.0  ?  ? 7.0  ?
tabIndex  ?  ? 1.0  ?  ? 7.0  ?
add()  ?  ? 1.0  ?  ? 7.0  ?
remove()  ?  ? 1.0  ?  ? 7.0  ?
blur() 3.0 Yes 1.0  ?  ? 7.0  ?
focus() 3.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLOptGroupElement
DOM1 disabled  ?  ? 1.0  ?  ? 9.0  ?
label No Yes 1.0  ?  ? 9.0  ?
Interface HTMLOptionElement
DOM1 form 4.0 Yes 1.0  ?  ? 7.0  ?
defaultSelected 4.0 Yes 1.0  ?  ? 7.0  ?
text 4.0 Yes 1.0  ?  ? 7.0  ?
index  ?  ? 1.0  ?  ? 7.0  ?
disabled  ?  ? 1.0  ?  ? 7.0  ?
label 6.0 Yes 1.0  ?  ? 9.0  ?
selected 4.0 Yes 1.0  ?  ? 7.0  ?
value 4.0 Yes 1.0  ?  ? 7.0  ?
Interface HTMLInputElement
DOM1 defaultValue 3.0 Yes 1.0  ?  ? 7.0  ?
defaultChecked 3.0 Yes 1.0  ?  ? 7.0  ?
form 3.0 Yes 1.0  ?  ? 7.0  ?
accept  ?  ? 1.0  ?  ? 7.0  ?
accesskey  ?  ? 1.0  ?  ? 7.