summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-09-07 16:06:44 +0100
committerSteve Block <steveblock@google.com>2010-09-07 16:36:45 +0100
commiteff69b907ef2cd3a9af0351287a929c66f58e3f6 (patch)
treec0d8835711b71631a15c3fb20d93c195ee3d5064 /LayoutTests/fast
parent66945f3db6c497fb182ef8a187b8c69e683dbb26 (diff)
downloadexternal_webkit-eff69b907ef2cd3a9af0351287a929c66f58e3f6.zip
external_webkit-eff69b907ef2cd3a9af0351287a929c66f58e3f6.tar.gz
external_webkit-eff69b907ef2cd3a9af0351287a929c66f58e3f6.tar.bz2
Adds a number of fast/ LayoutTest directories to the triaged set
Tests are added at r66079. All tests pass fast/constructors/ fast/cookies/ fast/dom/Attr/ fast/dom/CSSStyleDeclaration/ fast/dom/DOMImplementation/ fast/dom/DeviceMotion/ fast/dom/EntityReference/ fast/dom/HTMLAnchorElement/ fast/dom/HTMLButtonElement/ fast/dom/HTMLFontElement/ fast/dom/HTMLFormElement/ fast/dom/HTMLHtmlElement/ fast/dom/HTMLKeygenElement/ fast/dom/HTMLLabelElement/ fast/dom/HTMLMetaElement/ fast/dom/HTMLTableRowElement/ fast/dom/HTMLTableSectionElement/ fast/dom/Node/ fast/dom/NodeList/ fast/dom/Selection/ fast/dom/StyleSheet/ fast/dom/Text/ fast/dom/TreeWalker/ fast/dom/beforeload/ fast/dom/getElementsByClassName/ fast/leaks/ Change-Id: I9a2c401151f7abf5bb22b764b1327022ab651e04
Diffstat (limited to 'LayoutTests/fast')
-rw-r--r--LayoutTests/fast/constructors/constructor-as-function-crash-expected.txt13
-rw-r--r--LayoutTests/fast/constructors/constructor-as-function-crash.html32
-rw-r--r--LayoutTests/fast/cookies/local-file-can-set-cookies-expected.txt11
-rw-r--r--LayoutTests/fast/cookies/local-file-can-set-cookies.html23
-rw-r--r--LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt25
-rw-r--r--LayoutTests/fast/dom/Attr/access-after-element-destruction.html13
-rw-r--r--LayoutTests/fast/dom/Attr/child-nodes-cache-expected.txt3
-rw-r--r--LayoutTests/fast/dom/Attr/child-nodes-cache.html38
-rw-r--r--LayoutTests/fast/dom/Attr/child-nodes-length-cache-expected.txt3
-rw-r--r--LayoutTests/fast/dom/Attr/child-nodes-length-cache.html38
-rw-r--r--LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js55
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt12
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt34
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt5
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html18
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js14
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js41
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js15
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js13
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt11
-rw-r--r--LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html13
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt51
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html13
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt1
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype.html32
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt31
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html13
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title-expected.txt5
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title.html9
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/detached-doctype-expected.txt5
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/detached-doctype.html29
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html17
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js146
-rw-r--r--LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js100
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt30
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/create-event.html12
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt65
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html12
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html12
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js29
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js68
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js32
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt18
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/window-property.html12
-rw-r--r--LayoutTests/fast/dom/EntityReference/readonly-exceptions-expected.txt23
-rw-r--r--LayoutTests/fast/dom/EntityReference/readonly-exceptions.html13
-rw-r--r--LayoutTests/fast/dom/EntityReference/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/EntityReference/script-tests/readonly-exceptions.js33
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js70
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js115
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js72
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js71
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js49
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js80
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js49
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js49
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt29
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt39
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt27
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt27
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt25
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt29
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt23
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html13
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt31
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html13
-rw-r--r--LayoutTests/fast/dom/HTMLButtonElement/value/getset-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLButtonElement/value/getset.html27
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js58
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt41
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/size-attribute.html13
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/adopt-assertion-expected.txt3
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/adopt-assertion.html16
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash.html41
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document-expected.txt27
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html13
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter-expected.txt10
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter.html24
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js37
-rw-r--r--LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt2
-rw-r--r--LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html17
-rw-r--r--LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt6
-rw-r--r--LayoutTests/fast/dom/HTMLHtmlElement/set-version.html24
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt6
-rw-r--r--LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html40
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/click-label-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/click-label.html43
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/focus-label-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/focus-label.html32
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/form/test1-expected.txt7
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/form/test1.html46
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/label-control-expected.txt51
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/label-control.html13
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js65
-rw-r--r--LayoutTests/fast/dom/HTMLMetaElement/meta-attributes-expected.txt10
-rw-r--r--LayoutTests/fast/dom/HTMLMetaElement/meta-attributes.html28
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt37
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/cells.html13
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html28
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js56
-rw-r--r--LayoutTests/fast/dom/HTMLTableSectionElement/rows-expected.txt24
-rw-r--r--LayoutTests/fast/dom/HTMLTableSectionElement/rows.html13
-rw-r--r--LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js44
-rw-r--r--LayoutTests/fast/dom/Node/DOMNodeRemovedEvent-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html13
-rw-r--r--LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt5
-rw-r--r--LayoutTests/fast/dom/Node/default-namespace-empty-argument.html8
-rw-r--r--LayoutTests/fast/dom/Node/fragment-mutation-expected.txt17
-rw-r--r--LayoutTests/fast/dom/Node/fragment-mutation.html148
-rw-r--r--LayoutTests/fast/dom/Node/initial-values-expected.txt151
-rw-r--r--LayoutTests/fast/dom/Node/initial-values.html13
-rw-r--r--LayoutTests/fast/dom/Node/isEqualNode-expected.txt13
-rw-r--r--LayoutTests/fast/dom/Node/isEqualNode.html13
-rw-r--r--LayoutTests/fast/dom/Node/mutation-blur-expected.txt4
-rw-r--r--LayoutTests/fast/dom/Node/mutation-blur.html73
-rw-r--r--LayoutTests/fast/dom/Node/normalize-expected.txt12
-rw-r--r--LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt15
-rw-r--r--LayoutTests/fast/dom/Node/normalize-with-cdata.html13
-rw-r--r--LayoutTests/fast/dom/Node/normalize.html213
-rw-r--r--LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js12
-rw-r--r--LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/Node/script-tests/initial-values.js205
-rw-r--r--LayoutTests/fast/dom/Node/script-tests/isEqualNode.js13
-rw-r--r--LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js22
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt3
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1.html25
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2-expected.txt3
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2.html42
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt3
-rw-r--r--LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3.html18
-rw-r--r--LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt2
-rw-r--r--LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html56
-rw-r--r--LayoutTests/fast/dom/NodeList/childNodes-reset-cache-expected.txt3
-rw-r--r--LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html36
-rw-r--r--LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt10
-rw-r--r--LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing.html77
-rw-r--r--LayoutTests/fast/dom/NodeList/item-by-id-with-no-document-expected.txt1
-rw-r--r--LayoutTests/fast/dom/NodeList/item-by-id-with-no-document.html13
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt23
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-assignment.html30
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt12
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html13
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt18
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-with-index.html38
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt16
-rw-r--r--LayoutTests/fast/dom/NodeList/nodelist-item-with-name.html30
-rw-r--r--LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html12
-rw-r--r--LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js8
-rw-r--r--LayoutTests/fast/dom/Selection/getRangeAt-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Selection/getRangeAt.html13
-rw-r--r--LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js33
-rw-r--r--LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt14
-rw-r--r--LayoutTests/fast/dom/StyleSheet/css-medialist-item.html13
-rw-r--r--LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt10
-rw-r--r--LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html13
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2-expected.txt3
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html37
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-expected.txt3
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html33
-rw-r--r--LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js16
-rw-r--r--LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js8
-rw-r--r--LayoutTests/fast/dom/Text/replaceWholeText-expected.txt13
-rw-r--r--LayoutTests/fast/dom/Text/replaceWholeText.html13
-rw-r--r--LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js16
-rw-r--r--LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt36
-rw-r--r--LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt53
-rw-r--r--LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt21
-rw-r--r--LayoutTests/fast/dom/TreeWalker/filter-throw.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt14
-rw-r--r--LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt16
-rw-r--r--LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js55
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js81
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js32
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js21
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js23
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js58
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js27
-rw-r--r--LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js60
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt33
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-reject.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt35
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt16
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html13
-rw-r--r--LayoutTests/fast/dom/TreeWalker/traversal-skip.html13
-rw-r--r--LayoutTests/fast/dom/beforeload/flash-before-load-expected.txt1
-rw-r--r--LayoutTests/fast/dom/beforeload/flash-before-load.html18
-rw-r--r--LayoutTests/fast/dom/beforeload/frame-before-load-expected.txt1
-rw-r--r--LayoutTests/fast/dom/beforeload/frame-before-load.html17
-rw-r--r--LayoutTests/fast/dom/beforeload/image-before-load-expected.txt1
-rw-r--r--LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt2
-rw-r--r--LayoutTests/fast/dom/beforeload/image-before-load-innerHTML.html25
-rw-r--r--LayoutTests/fast/dom/beforeload/image-before-load.html16
-rw-r--r--LayoutTests/fast/dom/beforeload/image-object-before-load-expected.txt2
-rw-r--r--LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt2
-rw-r--r--LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML.html32
-rw-r--r--LayoutTests/fast/dom/beforeload/image-object-before-load.html31
-rw-r--r--LayoutTests/fast/dom/beforeload/link-before-load-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/link-before-load.html30
-rw-r--r--LayoutTests/fast/dom/beforeload/pi-before-load-expected.txt1
-rw-r--r--LayoutTests/fast/dom/beforeload/pi-before-load.xhtml41
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html49
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener.html48
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html25
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener.html47
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener.html25
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener.html28
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener.html47
-rw-r--r--LayoutTests/fast/dom/beforeload/resources/fail.css5
-rw-r--r--LayoutTests/fast/dom/beforeload/resources/fail.js1
-rw-r--r--LayoutTests/fast/dom/beforeload/resources/print.js9
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load-dynamic-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load-dynamic.html29
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load-xhtml-expected.txt3
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load-xhtml.xhtml28
-rw-r--r--LayoutTests/fast/dom/beforeload/script-before-load.html17
-rw-r--r--LayoutTests/fast/dom/beforeload/video-before-load-expected.txt2
-rw-r--r--LayoutTests/fast/dom/beforeload/video-before-load.html17
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/001-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/001.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/002-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/002.html13
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/003-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/003.html15
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/004-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/004.html15
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/005-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/005.html15
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/006-expected.txt3
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/006.html17
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/007-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/007.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/008-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/008.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/009-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/009.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/010-expected.txt3
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/010.xml12
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/011-expected.txt3
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/011.xml19
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/012-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/012.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/013-expected.txt3
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/013.html17
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/014-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/014.html14
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/015-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/015.html14
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/001.html13
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/002.html12
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/003.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt1
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/array/004.html11
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt26
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html54
-rw-r--r--LayoutTests/fast/dom/getElementsByClassName/resources/common.js21
-rw-r--r--LayoutTests/fast/leaks/001-expected.txt4
-rw-r--r--LayoutTests/fast/leaks/001.html22
-rw-r--r--LayoutTests/fast/leaks/002-expected.txt4
-rw-r--r--LayoutTests/fast/leaks/002.html20
-rw-r--r--LayoutTests/fast/leaks/003-expected.txt4
-rw-r--r--LayoutTests/fast/leaks/003.html-disabled61
302 files changed, 6854 insertions, 0 deletions
diff --git a/LayoutTests/fast/constructors/constructor-as-function-crash-expected.txt b/LayoutTests/fast/constructors/constructor-as-function-crash-expected.txt
new file mode 100644
index 0000000..cf56e2e
--- /dev/null
+++ b/LayoutTests/fast/constructors/constructor-as-function-crash-expected.txt
@@ -0,0 +1,13 @@
+Calling bindings constructors as function should throw an exception and not cause a crash.
+
+PASS: EventSource
+PASS: MessageChannel
+PASS: SharedWorker
+PASS: WebGLArrayBuffer
+PASS: WebKitCSSMatrix
+PASS: WebKitPoint
+PASS: WebSocket
+PASS: Worker
+PASS: XMLHttpRequest
+PASS: XSLTProcessor
+
diff --git a/LayoutTests/fast/constructors/constructor-as-function-crash.html b/LayoutTests/fast/constructors/constructor-as-function-crash.html
new file mode 100644
index 0000000..29e20d3
--- /dev/null
+++ b/LayoutTests/fast/constructors/constructor-as-function-crash.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+ <title>Calling bindings constructors as function should not cause a crash</title>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function runTest()
+ {
+ // List of constructors to test.
+ var constructors = ["EventSource", "MessageChannel", "SharedWorker", "WebGLArrayBuffer", "WebKitCSSMatrix", "WebKitPoint", "WebSocket", "Worker", "XMLHttpRequest", "XSLTProcessor"];
+ var result = document.getElementById("result");
+ for (var i in constructors) {
+ try {
+ var func = constructors[i] + "()";
+ eval(func);
+ result.innerHTML += "FAIL";
+ }
+ catch (e) {
+ result.innerHTML += "PASS";
+ }
+ result.innerHTML += ": " + constructors[i] + "<br/>";
+ }
+ }
+
+ </script>
+</head>
+<body onload="runTest()">
+ <p>Calling <code>bindings</code> constructors as function should throw an exception and not cause a crash.</p>
+ <div id="result"></div>
+</html>
+
diff --git a/LayoutTests/fast/cookies/local-file-can-set-cookies-expected.txt b/LayoutTests/fast/cookies/local-file-can-set-cookies-expected.txt
new file mode 100644
index 0000000..0886317
--- /dev/null
+++ b/LayoutTests/fast/cookies/local-file-can-set-cookies-expected.txt
@@ -0,0 +1,11 @@
+This test checks that a local file can set cookies. See: rdar://problem/5379090 REGRESSION: Cannot set cookies for local files
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.cookie.indexOf('ppkcookie1=testcookie') is -1
+PASS document.cookie.indexOf('ppkcookie1=testcookie') >= 0 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/cookies/local-file-can-set-cookies.html b/LayoutTests/fast/cookies/local-file-can-set-cookies.html
new file mode 100644
index 0000000..10468ae
--- /dev/null
+++ b/LayoutTests/fast/cookies/local-file-can-set-cookies.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<title>Local File Can Set Cookies</title>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ description('This test checks that a local file can set cookies. See: rdar://problem/5379090 REGRESSION: Cannot set cookies for local files');
+
+ shouldBe("document.cookie.indexOf('ppkcookie1=testcookie')", "-1");
+ document.cookie = 'ppkcookie1=testcookie';
+ shouldBeTrue("document.cookie.indexOf('ppkcookie1=testcookie') >= 0");
+
+ var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt b/LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt
new file mode 100644
index 0000000..8c09132
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt
@@ -0,0 +1,25 @@
+Tests that accessing Attr after its Element has been destroyed works without crashing.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS attributes.length is 1
+PASS attributes[0] is attributes.item(0)
+PASS attributes.getNamedItem('a') is attributes.item(0)
+PASS attributes.item(0).name is 'a'
+PASS attributes.item(0).specified is true
+PASS attributes.item(0).value is 'b'
+PASS attributes.item(0).ownerElement.tagName is 'P'
+PASS attributes.item(0).style is null
+PASS attributes.item(0).value is 'c'
+PASS attributes.length is 0
+PASS attr.name is 'a'
+PASS attr.specified is true
+PASS attr.value is 'b'
+PASS attr.ownerElement.tagName is 'P'
+PASS attr.style is null
+PASS attr.value is 'c'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Attr/access-after-element-destruction.html b/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
new file mode 100644
index 0000000..39e014d
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/access-after-element-destruction.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Attr/child-nodes-cache-expected.txt b/LayoutTests/fast/dom/Attr/child-nodes-cache-expected.txt
new file mode 100644
index 0000000..9976b12
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/child-nodes-cache-expected.txt
@@ -0,0 +1,3 @@
+PASS
+
+
diff --git a/LayoutTests/fast/dom/Attr/child-nodes-cache.html b/LayoutTests/fast/dom/Attr/child-nodes-cache.html
new file mode 100644
index 0000000..7805946
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/child-nodes-cache.html
@@ -0,0 +1,38 @@
+<body onload="test()">
+<p>Running test...</p>
+<textarea id=t rows=20>textarea</textarea>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
+ var s = new String("abc");
+ }
+}
+
+function test()
+{
+ var elem = document.getElementById("t");
+ var nodes = document.getElementById("t").getAttributeNode('rows').childNodes;
+ nodes[0]; // Prime the child node cache.
+ document.body.removeChild(document.getElementById("t"));
+ elem.getAttributeNode('rows').removeChild(nodes[0]);
+ setTimeout(function() {
+ gc();
+ gc();
+ gc();
+ try { nodes[0].textContent } catch (ex) { }
+
+ document.getElementsByTagName("p")[0].innerHTML = "PASS"
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 0);
+}
+</script>
diff --git a/LayoutTests/fast/dom/Attr/child-nodes-length-cache-expected.txt b/LayoutTests/fast/dom/Attr/child-nodes-length-cache-expected.txt
new file mode 100644
index 0000000..b253fa1
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/child-nodes-length-cache-expected.txt
@@ -0,0 +1,3 @@
+Test for bug 19759: ChildNodeList for an attribute node is not properly invalidated after appending a child.
+
+Passed!!
diff --git a/LayoutTests/fast/dom/Attr/child-nodes-length-cache.html b/LayoutTests/fast/dom/Attr/child-nodes-length-cache.html
new file mode 100644
index 0000000..5c09794
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/child-nodes-length-cache.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function onLoad()
+{
+ var theDiv = document.getElementById("theDiv");
+ var theAttrs = theDiv.attributes;
+
+ var nameAttr = theAttrs.getNamedItem("name");
+ var nameAttrChildNodes = nameAttr.childNodes;
+ var textNode = document.createTextNode("terday");
+ var unused = nameAttrChildNodes.length;
+ nameAttr.appendChild(textNode);
+
+ var name2Attr = theAttrs.getNamedItem("name2");
+ var name2AttrChildNodes = name2Attr.childNodes;
+ var textNode2 = document.createTextNode("terday");
+ name2Attr.appendChild(textNode2);
+
+ if (nameAttrChildNodes.length != name2AttrChildNodes.length)
+ document.getElementById("result").innerHTML = "Failed: nameAttrChildNodes.length=" + nameAttrChildNodes.length + ", name2AttrChildNodes.length=" + name2AttrChildNodes.length;
+ else
+ document.getElementById("result").innerHTML = "Passed!!";
+
+ document.body.removeChild(document.getElementById("theDiv"));
+}
+</script>
+</head>
+<body onload="onLoad();">
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19759">bug 19759</a>:
+ChildNodeList for an attribute node is not properly invalidated after appending a child.</p>
+<div id="theDiv" name="Yes" name2="Yes">Hello</div>
+<div id="result">Testing...</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js b/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js
new file mode 100644
index 0000000..91588a3
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js
@@ -0,0 +1,55 @@
+description("Tests that accessing Attr after its Element has been destroyed works without crashing.");
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ // Trigger garbage collection indirectly.
+ for (var i = 0; i < 100000; i++)
+ new String(i);
+}
+
+var element = document.createElement("p");
+element.setAttribute("a", "b");
+var attributes = element.attributes;
+element = null;
+
+gc();
+
+shouldBe("attributes.length", "1");
+shouldBe("attributes[0]", "attributes.item(0)");
+shouldBe("attributes.getNamedItem('a')", "attributes.item(0)");
+
+shouldBe("attributes.item(0).name", "'a'");
+shouldBe("attributes.item(0).specified", "true");
+shouldBe("attributes.item(0).value", "'b'");
+shouldBe("attributes.item(0).ownerElement.tagName", "'P'");
+shouldBe("attributes.item(0).style", "null");
+
+attributes.item(0).value = 'c';
+
+shouldBe("attributes.item(0).value", "'c'");
+
+attributes.removeNamedItem('a');
+
+shouldBe("attributes.length", "0");
+
+element = document.createElement("p");
+element.setAttribute("a", "b");
+var attr = element.attributes.item(0);
+element = null;
+
+gc();
+
+shouldBe("attr.name", "'a'");
+shouldBe("attr.specified", "true");
+shouldBe("attr.value", "'b'");
+shouldBe("attr.ownerElement.tagName", "'P'");
+shouldBe("attr.style", "null");
+
+attr.value = 'c';
+
+shouldBe("attr.value", "'c'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt
new file mode 100644
index 0000000..b425aab
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt
@@ -0,0 +1,12 @@
+This tests indexing outside the range of the computed style object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof computedStyle.length is "number"
+PASS computedStyle[computedStyle.length] is ""
+PASS computedStyle[-1] is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html
new file mode 100644
index 0000000..155c672
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/css-computed-style-item.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt
new file mode 100644
index 0000000..a56522b
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt
@@ -0,0 +1,34 @@
+This test checks that access to CSS properties via JavaScript properties on DOM elements is case sensitive.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+normal cases
+
+PASS element.style.zIndex is '1'
+PASS element.style.ZIndex is undefined.
+
+"css" prefix
+
+PASS element.style.cssZIndex is '1'
+PASS element.style.CssZIndex is '1'
+PASS element.style.CsszIndex is undefined.
+PASS element.style.csszIndex is undefined.
+
+"pixel" prefix
+
+PASS element.style.pixelZIndex is 1
+PASS element.style.PixelZIndex is 1
+PASS element.style.pixelzIndex is undefined.
+PASS element.style.PixelzIndex is undefined.
+
+"pos" prefix
+
+PASS element.style.posZIndex is 1
+PASS element.style.PosZIndex is 1
+PASS element.style.poszIndex is undefined.
+PASS element.style.PoszIndex is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html
new file mode 100644
index 0000000..9a17597
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/css-properties-case-sensitive.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt
new file mode 100644
index 0000000..5b57e49
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt
@@ -0,0 +1,13 @@
+This tests indexing outside the range of the style object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS style.length is 1
+PASS style[0] is "color"
+PASS style[1] is ""
+PASS style[-1] is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html
new file mode 100644
index 0000000..b0858cc
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/css-style-item.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt
new file mode 100644
index 0000000..f5c31f9
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt
@@ -0,0 +1,5 @@
+Regression test for http://bugs.webkit.org/show_bug.cgi?id=15169 Freeze on Google maps using the "Dig a hole" tool.
+
+This tests that the empty string property of a CSSStyleDeclaration is undefined and that retrieving it does not cause a hang.
+
+PASS
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html
new file mode 100644
index 0000000..5f28965
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html
@@ -0,0 +1,18 @@
+<body>
+ <p>
+ Regression test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=15169">http://bugs.webkit.org/show_bug.cgi?id=15169</a>
+ Freeze on Google maps using the "Dig a hole" tool</i>.
+ </p>
+ <p>
+ This tests that the empty string property of a CSSStyleDeclaration is
+ undefined and that retrieving it does not cause a hang.
+ </p>
+ <p id="result">FAIL (timed out or did not finish)</p>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var type = typeof document.body.style[''];
+ document.getElementById("result").innerText = type == "undefined" ? "PASS" : "FAIL (typeof document.body.style[''] is " + type + ")";
+ </script>
+</body>
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js
new file mode 100644
index 0000000..8522f65
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js
@@ -0,0 +1,14 @@
+description("This tests indexing outside the range of the computed style object.");
+
+var element = document.createElement('div');
+element.style.color = 'rgb(120, 120, 120)';
+document.documentElement.appendChild(element);
+var computedStyle = window.getComputedStyle(element, null);
+
+shouldBeEqualToString('typeof computedStyle.length', 'number');
+shouldBeEqualToString('computedStyle[computedStyle.length]', '');
+shouldBeUndefined('computedStyle[-1]')
+
+document.documentElement.removeChild(element);
+
+successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js
new file mode 100644
index 0000000..15949a2
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js
@@ -0,0 +1,41 @@
+description(
+'This test checks that access to CSS properties via JavaScript properties on DOM elements is case sensitive.'
+);
+
+var element = document.createElement('a');
+element.style.zIndex = 1;
+
+debug('normal cases');
+debug('');
+
+shouldBe("element.style.zIndex", "'1'");
+shouldBeUndefined("element.style.ZIndex");
+
+debug('');
+debug('"css" prefix');
+debug('');
+
+shouldBe("element.style.cssZIndex", "'1'");
+shouldBe("element.style.CssZIndex", "'1'");
+shouldBeUndefined("element.style.CsszIndex");
+shouldBeUndefined("element.style.csszIndex");
+
+debug('');
+debug('"pixel" prefix');
+debug('');
+
+shouldBe("element.style.pixelZIndex", "1");
+shouldBe("element.style.PixelZIndex", "1");
+shouldBeUndefined("element.style.pixelzIndex");
+shouldBeUndefined("element.style.PixelzIndex");
+
+debug('');
+debug('"pos" prefix');
+debug('');
+
+shouldBe("element.style.posZIndex", "1");
+shouldBe("element.style.PosZIndex", "1");
+shouldBeUndefined("element.style.poszIndex");
+shouldBeUndefined("element.style.PoszIndex");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js
new file mode 100644
index 0000000..ad85fb9
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js
@@ -0,0 +1,15 @@
+description("This tests indexing outside the range of the style object.");
+
+var element = document.createElement('div');
+element.style.color = 'red';
+document.documentElement.appendChild(element);
+var style = element.style;
+
+shouldEvaluateTo('style.length', 1);
+shouldBeEqualToString('style[0]', 'color');
+shouldBeEqualToString('style[1]', '');
+shouldBeUndefined('style[-1]')
+
+document.documentElement.removeChild(element);
+
+successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js
new file mode 100644
index 0000000..4fbfc43
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js
@@ -0,0 +1,13 @@
+description(
+'This test checks that CSS property names work round trip in the transition property.'
+);
+
+var element = document.createElement('a');
+
+element.style.webkitTransitionProperty = "height";
+shouldBe("element.style.webkitTransitionProperty", "'height'");
+
+element.style.webkitTransitionProperty = "opacity";
+shouldBe("element.style.webkitTransitionProperty", "'opacity'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt
new file mode 100644
index 0000000..fe7940f
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt
@@ -0,0 +1,11 @@
+This test checks that CSS property names work round trip in the transition property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.style.webkitTransitionProperty is 'height'
+PASS element.style.webkitTransitionProperty is 'opacity'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html
new file mode 100644
index 0000000..55f87e0
--- /dev/null
+++ b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/transition-property-names.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt b/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
new file mode 100644
index 0000000..09d4bdc
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
@@ -0,0 +1,51 @@
+createDocument tests modeled after createElementNS tests from mozilla which were attached to webkit bug 16833
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.implementation.createDocument().toString() is "[object Document]"
+PASS document.implementation.createDocument("http://www.example.com").toString() is "[object Document]"
+PASS createDocument(, , null)
+PASS createDocument(null, , null)
+FAIL createDocument(, null, null)
+FAIL createDocument(null, null, null)
+FAIL createDocument(null, "", null)
+FAIL createDocument("", null, null)
+FAIL createDocument("", "", null)
+PASS createDocument(null, "<div>", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, "0div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, "di v", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, "di<v", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, "-div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, ".div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "<div>", null); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "0div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "di<v", null); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "-div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", ".div", null); threw INVALID_CHARACTER_ERR
+PASS createDocument(null, ":div", null); threw NAMESPACE_ERR
+PASS createDocument(null, "div:", null); threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", ":div", null); threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", "div:", null); threw NAMESPACE_ERR
+PASS createDocument(null, "d:iv", null); threw NAMESPACE_ERR
+PASS createDocument(null, "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
+PASS createDocument(null, "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", "a:0", null); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "a:_", null)
+FAIL createDocument("http://example.com/", "a:ெ", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "ெ:a", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
+PASS createDocument("http://example.com/", "a:aெ", null)
+PASS createDocument("http://example.com/", "aெ:a", null)
+PASS createDocument("http://example.com/", "xml:test", null); binding xml prefix wrong; threw NAMESPACE_ERR
+PASS createDocument("http://example.com/", "xmlns:test", null); binding xmlns prefix wrong; threw NAMESPACE_ERR
+PASS createDocument("http://www.w3.org/2000/xmlns/", "x:test", null); binding namespace namespace to wrong prefix; threw NAMESPACE_ERR
+PASS createDocument("http://www.w3.org/2000/xmlns/", "xmlns:test", null)
+PASS createDocument("http://www.w3.org/XML/1998/namespace", "xml:test", null)
+PASS createDocument("http://www.w3.org/XML/1998/namespace", "x:test", null)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html b/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html
new file mode 100644
index 0000000..33954ad
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/createDocument-namespace-err.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt b/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype.html b/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype.html
new file mode 100644
index 0000000..ae4a7ae
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype.html
@@ -0,0 +1,32 @@
+<body>
+<iframe src="resources/createDocument-with-used-doctype-frame.html" onload="test()"></iframe>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++)
+ var s = new String("");
+}
+
+// Reload multiple times, to make crashing more likely.
+var iterationsLeft = 50;
+function test()
+{
+ if (--iterationsLeft) {
+ frames[0].history.go(0);
+ } else {
+ gc();
+ document.body.textContent = frames[0].document.body.textContent;
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+</script>
+</body>
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt b/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
new file mode 100644
index 0000000..a398870
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
@@ -0,0 +1,31 @@
+createDocument tests modeled after mozilla's testing
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.implementation.createDocumentType('foo').toString() is "[object DocumentType]"
+PASS document.implementation.createDocumentType('foo', null).toString() is "[object DocumentType]"
+PASS createDocumentType(, ); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(null, ); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(, , null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(null, null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType(null, ""); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("", null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("", ""); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("a:", null, null); threw NAMESPACE_ERR
+PASS createDocumentType(":foo", null, null); threw NAMESPACE_ERR
+PASS createDocumentType(":", null, null); threw NAMESPACE_ERR
+PASS createDocumentType("foo", null, null)
+PASS createDocumentType("foo:bar", null, null)
+PASS createDocumentType("foo::bar", null, null); threw NAMESPACE_ERR
+PASS createDocumentType(" :bar", null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("foo: ", null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("foo :bar", null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("foo: bar", null, null); threw INVALID_CHARACTER_ERR
+PASS createDocumentType("a:b:c", null, null); valid XML name, invalid QName; threw NAMESPACE_ERR
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html b/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html
new file mode 100644
index 0000000..516e991
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/createDocumentType-err.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title-expected.txt b/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title-expected.txt
new file mode 100644
index 0000000..712f2f1
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title-expected.txt
@@ -0,0 +1,5 @@
+Test for a bug 30982: createHTMLDocument doesn't escape ampersand and less-than in title.
+
+Should say PASS:
+
+PASS
diff --git a/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title.html b/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title.html
new file mode 100644
index 0000000..5e4a153
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-title.html
@@ -0,0 +1,9 @@
+<p>Test for a <href="https://bugs.webkit.org/show_bug.cgi?id=30982">bug 30982</a>: createHTMLDocument doesn't escape ampersand and less-than in title.</p>
+<p>Should say PASS:</p>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var result = document.implementation.createHTMLDocument('foo</title>').title;
+document.write((result == 'foo</title>') ? "PASS" : ("FAIL. Title is:<xmp>" + result + "</xmp>"));
+</script>
diff --git a/LayoutTests/fast/dom/DOMImplementation/detached-doctype-expected.txt b/LayoutTests/fast/dom/DOMImplementation/detached-doctype-expected.txt
new file mode 100644
index 0000000..38b8bbc
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/detached-doctype-expected.txt
@@ -0,0 +1,5 @@
+Test for bug 26402: Crashes when using a detached DocumentType node.
+
+PASS if no crash.
+
+DONE
diff --git a/LayoutTests/fast/dom/DOMImplementation/detached-doctype.html b/LayoutTests/fast/dom/DOMImplementation/detached-doctype.html
new file mode 100644
index 0000000..a508f82
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/detached-doctype.html
@@ -0,0 +1,29 @@
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=26402">bug 26402<a/>: Crashes when using a detached DocumentType node.</p>
+<p>PASS if no crash.</p>
+<SCRIPT>
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++)
+ var s = new String("");
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var o = document.implementation.createDocumentType('x', null, null);
+var doc = document.implementation.createDocument("doc", null, 0);
+for (i in o) {
+ try { o[i]; } catch (e) {}
+ try { o[i](); } catch (e) {}
+}
+o.addEventListener("click", function() {}, true);
+o.removeEventListener("click", function() {}, true);
+o.childNodes;
+o.childNodes.item(0);
+o.firstChild;
+gc();
+document.write("DONE");
+</SCRIPT>
diff --git a/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html b/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
new file mode 100644
index 0000000..e0e7e67
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>document.implementation.createDocument with current document's DOCTYPE</title>
+<body>
+FAIL (Script did not run);
+<script>
+document.body.textContent = "FAIL";
+try {
+ document.implementation.createDocument(null, null, document.doctype);
+ document.body.textContent = "FAIL (no exception)";
+}
+catch(e) {
+ if (e.code === DOMException.WRONG_DOCUMENT_ERR || e.code === DOMException.NOT_SUPPORTED_ERR)
+ document.body.textContent = "PASS";
+ else
+ document.body.textContent = "FAIL (wrong exception: " + e.code + ")";
+}
+</script>
diff --git a/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js b/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js
new file mode 100644
index 0000000..6683f8b
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js
@@ -0,0 +1,146 @@
+description("createDocument tests modeled after createElementNS tests from mozilla which were attached to webkit bug 16833");
+
+// document.implementation.createDocument() should throw the same set of errors
+// as document.createElementNS()
+// http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
+// Thus we copied these test cases from:
+// LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js
+
+function assert(c, m)
+{
+ if (!c)
+ testFailed(m);
+ else
+ testPassed(m);
+}
+
+function stringForExceptionCode(c)
+{
+ var exceptionName;
+ switch(c) {
+ case DOMException.INVALID_CHARACTER_ERR:
+ exceptionName = "INVALID_CHARACTER_ERR";
+ break;
+ case DOMException.NAMESPACE_ERR:
+ exceptionName = "NAMESPACE_ERR";
+ }
+ if (exceptionName)
+ return exceptionName; // + "(" + c + ")";
+ return c;
+}
+
+function assertEquals(actual, expect, m)
+{
+ if (actual !== expect) {
+ m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual);
+ testFailed(m);
+ } else {
+ m += "; threw " + stringForExceptionCode(actual);;
+ testPassed(m);
+ }
+}
+
+var allNSTests = [
+ { args: [undefined, undefined] },
+ { args: [null, undefined] },
+ { args: [undefined, null], code: 5 },
+ { args: [null, null], code: 5 },
+ { args: [null, ""], code: 5 },
+ { args: ["", null], code: 5 },
+ { args: ["", ""], code: 5 },
+ { args: [null, "<div>"], code: 5 },
+ { args: [null, "0div"], code: 5 },
+ { args: [null, "di v"], code: 5 },
+ { args: [null, "di<v"], code: 5 },
+ { args: [null, "-div"], code: 5 },
+ { args: [null, ".div"], code: 5 },
+ { args: ["http://example.com/", "<div>"], code: 5 },
+ { args: ["http://example.com/", "0div"], code: 5 },
+ { args: ["http://example.com/", "di<v"], code: 5 },
+ { args: ["http://example.com/", "-div"], code: 5 },
+ { args: ["http://example.com/", ".div"], code: 5 },
+ { args: [null, ":div"], code: 14 },
+ { args: [null, "div:"], code: 14 },
+ { args: ["http://example.com/", ":div"], code: 14 },
+ { args: ["http://example.com/", "div:"], code: 14 },
+ { args: [null, "d:iv"], code: 14 },
+ { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" },
+ { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" },
+ { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" },
+ { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" },
+ { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
+ { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
+ { args: ["http://example.com/", "a:_"] },
+ { args: ["http://example.com/", "a:\u0BC6"], code: 14,
+ message: "non-ASCII character after colon is CombiningChar, which is " +
+ "NCNameChar but not (Letter | \"_\") so invalid at start of " +
+ "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" },
+ { args: ["http://example.com/", "\u0BC6:a"], code: 5,
+ message: "non-ASCII character after colon is CombiningChar, which is " +
+ "NCNameChar but not (Letter | \"_\") so invalid at start of " +
+ "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " +
+ "as this is both an invalid XML name and an invalid QName)" },
+ { args: ["http://example.com/", "a:a\u0BC6"] },
+ { args: ["http://example.com/", "a\u0BC6:a"] },
+ { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" },
+ { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" },
+ { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" },
+ { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] },
+ { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] },
+ { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] },
+];
+
+function sourceify(v)
+{
+ switch (typeof v) {
+ case "undefined":
+ return v;
+ case "string":
+ return '"' + v.replace('"', '\\"') + '"';
+ default:
+ return String(v);
+ }
+}
+
+function sourceifyArgs(args)
+{
+ var copy = new Array(args.length);
+ for (var i = 0, sz = args.length; i < sz; i++)
+ copy[i] = sourceify(args[i]);
+
+ return copy.join(", ");
+}
+
+function runNSTests(tests, doc, createFunctionName)
+{
+ for (var i = 0, sz = tests.length; i < sz; i++) {
+ var test = tests[i];
+
+ // Gecko throws "undefined" if createDocument isn't
+ // called with 3 arguments. Instead of modifying all
+ // of the values in the arrays above (which were taken from createElementNS tests)
+ // we will instead just hack the args list here.
+ var argsWithExtraLastNull = test.args.slice(); // copy the args arary
+ argsWithExtraLastNull.push(null);
+
+ var code = -1;
+ var argStr = sourceifyArgs(argsWithExtraLastNull);
+ var msg = createFunctionName + "(" + argStr + ")";
+ if ("message" in test)
+ msg += "; " + test.message;
+ try {
+ doc[createFunctionName].apply(doc, argsWithExtraLastNull);
+ assert(!("code" in test), msg);
+ } catch (e) {
+ assertEquals(e.code, test.code || "expected no exception", msg);
+ }
+ }
+}
+
+// Moz throws a "Not enough arguments" exception in these, we don't:
+shouldBeEqualToString("document.implementation.createDocument().toString()", "[object Document]");
+shouldBeEqualToString("document.implementation.createDocument(\"http://www.example.com\").toString()", "[object Document]");
+
+runNSTests(allNSTests, document.implementation, "createDocument");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js b/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js
new file mode 100644
index 0000000..9ef7e7c
--- /dev/null
+++ b/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js
@@ -0,0 +1,100 @@
+description("createDocument tests modeled after mozilla's testing");
+
+function stringForExceptionCode(c)
+{
+ var exceptionName;
+ switch(c) {
+ case DOMException.INVALID_CHARACTER_ERR:
+ exceptionName = "INVALID_CHARACTER_ERR";
+ break;
+ case DOMException.NAMESPACE_ERR:
+ exceptionName = "NAMESPACE_ERR";
+ }
+ if (exceptionName)
+ return exceptionName; // + "(" + c + ")";
+ return c;
+}
+
+function assertEquals(actual, expect, m)
+{
+ if (actual !== expect) {
+ m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual);
+ testFailed(m);
+ } else {
+ m += "; threw " + stringForExceptionCode(actual);;
+ testPassed(m);
+ }
+}
+
+var allTests = [
+ { args: [undefined, undefined], code: 5 },
+ { args: [null, undefined], code: 5 },
+ { args: [undefined, null], code: 5 },
+ { args: [undefined, undefined, null], code: 5 },
+ { args: [null, null], code: 5 },
+ { args: [null, null, null], code: 5 },
+ { args: [null, ""], code: 5 },
+ { args: ["", null], code: 5 },
+ { args: ["", ""], code: 5 },
+ { args: ["a:", null, null], code: 14 },
+ { args: [":foo", null, null], code: 14 },
+ { args: [":", null, null], code: 14 },
+ { args: ["foo", null, null] },
+ { args: ["foo:bar", null, null] },
+ { args: ["foo::bar", null, null], code: 14 },
+ { args: ["\t:bar", null, null], code: 5 },
+ { args: ["foo:\t", null, null], code: 5 },
+ { args: ["foo :bar", null, null], code: 5 },
+ { args: ["foo: bar", null, null], code: 5 },
+ { args: ["a:b:c", null, null], code: 14, message: "valid XML name, invalid QName" },
+];
+
+function sourceify(v)
+{
+ switch (typeof v) {
+ case "undefined":
+ return v;
+ case "string":
+ return '"' + v.replace('"', '\\"') + '"';
+ default:
+ return String(v);
+ }
+}
+
+function sourceifyArgs(args)
+{
+ var copy = new Array(args.length);
+ for (var i = 0, sz = args.length; i < sz; i++)
+ copy[i] = sourceify(args[i]);
+
+ return copy.join(", ");
+}
+
+function runTests(tests, createFunctionName)
+{
+ for (var i = 0, sz = tests.length; i < sz; i++) {
+ var test = tests[i];
+
+ var code = -1;
+ var argStr = sourceifyArgs(test.args);
+ var msg = createFunctionName + "(" + argStr + ")";
+ if ("message" in test)
+ msg += "; " + test.message;
+ try {
+ document.implementation[createFunctionName].apply(document.implementation, test.args);
+ if ('code' in test)
+ testFailed(msg + " expected exception: " + test.code);
+ else
+ testPassed(msg);
+ } catch (e) {
+ assertEquals(e.code, test.code || "expected no exception", msg);
+ }
+ }
+}
+
+// Moz throws a "Not enough arguments" exception in these, we don't:
+shouldBeEqualToString("document.implementation.createDocumentType('foo').toString()", "[object DocumentType]");
+shouldBeEqualToString("document.implementation.createDocumentType('foo', null).toString()", "[object DocumentType]");
+runTests(allTests, "createDocumentType");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
new file mode 100644
index 0000000..fdc40c4
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
@@ -0,0 +1,30 @@
+Tests that document.createEvent() works with DeviceMotinEvent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof event == 'object' is true
+PASS 'type' in event is true
+PASS 'bubbles' in event is true
+PASS 'cancelable' in event is true
+PASS 'xAcceleration' in event is true
+PASS 'yAcceleration' in event is true
+PASS 'zAcceleration' in event is true
+PASS 'xRotationRate' in event is true
+PASS 'yRotationRate' in event is true
+PASS 'zRotationRate' in event is true
+PASS 'interval' in event is true
+PASS typeof event.type == 'string' is true
+PASS typeof event.bubbles == 'boolean' is true
+PASS typeof event.cancelable == 'boolean' is true
+PASS typeof event.xAcceleration == 'object' is true
+PASS typeof event.yAcceleration == 'object' is true
+PASS typeof event.zAcceleration == 'object' is true
+PASS typeof event.xRotationRate == 'object' is true
+PASS typeof event.yRotationRate == 'object' is true
+PASS typeof event.zRotationRate == 'object' is true
+PASS typeof event.interval == 'object' is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DeviceMotion/create-event.html b/LayoutTests/fast/dom/DeviceMotion/create-event.html
new file mode 100644
index 0000000..545f962
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/create-event.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/create-event.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
new file mode 100644
index 0000000..0eabe35
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
@@ -0,0 +1,65 @@
+Tests the optional properties of DeviceMotionEvent. Each property should be null if not set, or set to null or undefined.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+event = document.createEvent('DeviceMotionEvent')
+PASS event.xAcceleration == null is true
+PASS event.yAcceleration == null is true
+PASS event.zAcceleration == null is true
+PASS event.xRotationRate == null is true
+PASS event.yRotationRate == null is true
+PASS event.zRotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)
+PASS event.xAcceleration == 0 is true
+PASS event.yAcceleration == 1 is true
+PASS event.zAcceleration == 2 is true
+PASS event.xRotationRate == 3 is true
+PASS event.yRotationRate == 4 is true
+PASS event.zRotationRate == 5 is true
+PASS event.interval == 6 is true
+event.initDeviceMotionEvent()
+PASS event.xAcceleration == null is true
+PASS event.yAcceleration == null is true
+PASS event.zAcceleration == null is true
+PASS event.xRotationRate == null is true
+PASS event.yRotationRate == null is true
+PASS event.zRotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])
+PASS event.xAcceleration == 0 is true
+PASS event.yAcceleration == 0 is true
+PASS event.zAcceleration == 0 is true
+PASS event.xRotationRate == 0 is true
+PASS event.yRotationRate == 0 is true
+PASS event.zRotationRate == 0 is true
+PASS event.interval == 0 is true
+event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
+PASS event.xAcceleration == null is true
+PASS event.yAcceleration == null is true
+PASS event.zAcceleration == null is true
+PASS event.xRotationRate == null is true
+PASS event.yRotationRate == null is true
+PASS event.zRotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')
+PASS event.xAcceleration == 0 is true
+PASS event.yAcceleration == 0 is true
+PASS event.zAcceleration == 0 is true
+PASS event.xRotationRate == 0 is true
+PASS event.yRotationRate == 0 is true
+PASS event.zRotationRate == 0 is true
+PASS event.interval == 0 is true
+event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)
+PASS event.xAcceleration == null is true
+PASS event.yAcceleration == null is true
+PASS event.zAcceleration == null is true
+PASS event.xRotationRate == null is true
+PASS event.yRotationRate == null is true
+PASS event.zRotationRate == null is true
+PASS event.interval == null is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html
new file mode 100644
index 0000000..212669f
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/optional-event-properties.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..b31963d
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
new file mode 100644
index 0000000..167329d
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
@@ -0,0 +1,29 @@
+description("Tests that document.createEvent() works with DeviceMotinEvent.");
+
+var event = document.createEvent('DeviceMotionEvent');
+
+shouldBeTrue("typeof event == 'object'");
+
+shouldBeTrue("'type' in event");
+shouldBeTrue("'bubbles' in event");
+shouldBeTrue("'cancelable' in event");
+shouldBeTrue("'xAcceleration' in event");
+shouldBeTrue("'yAcceleration' in event");
+shouldBeTrue("'zAcceleration' in event");
+shouldBeTrue("'xRotationRate' in event");
+shouldBeTrue("'yRotationRate' in event");
+shouldBeTrue("'zRotationRate' in event");
+shouldBeTrue("'interval' in event");
+
+shouldBeTrue("typeof event.type == 'string'");
+shouldBeTrue("typeof event.bubbles == 'boolean'");
+shouldBeTrue("typeof event.cancelable == 'boolean'");
+shouldBeTrue("typeof event.xAcceleration == 'object'");
+shouldBeTrue("typeof event.yAcceleration == 'object'");
+shouldBeTrue("typeof event.zAcceleration == 'object'");
+shouldBeTrue("typeof event.xRotationRate == 'object'");
+shouldBeTrue("typeof event.yRotationRate == 'object'");
+shouldBeTrue("typeof event.zRotationRate == 'object'");
+shouldBeTrue("typeof event.interval == 'object'");
+
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
new file mode 100644
index 0000000..ab9b53b
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
@@ -0,0 +1,68 @@
+description("Tests the optional properties of DeviceMotionEvent. Each property should be null if not set, or set to null or undefined.");
+
+var event;
+
+evalAndLog("event = document.createEvent('DeviceMotionEvent')");
+shouldBeTrue("event.xAcceleration == null");
+shouldBeTrue("event.yAcceleration == null");
+shouldBeTrue("event.zAcceleration == null");
+shouldBeTrue("event.xRotationRate == null");
+shouldBeTrue("event.yRotationRate == null");
+shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)");
+shouldBeTrue("event.xAcceleration == 0");
+shouldBeTrue("event.yAcceleration == 1");
+shouldBeTrue("event.zAcceleration == 2");
+shouldBeTrue("event.xRotationRate == 3");
+shouldBeTrue("event.yRotationRate == 4");
+shouldBeTrue("event.zRotationRate == 5");
+shouldBeTrue("event.interval == 6");
+
+evalAndLog("event.initDeviceMotionEvent()");
+shouldBeTrue("event.xAcceleration == null");
+shouldBeTrue("event.yAcceleration == null");
+shouldBeTrue("event.zAcceleration == null");
+shouldBeTrue("event.xRotationRate == null");
+shouldBeTrue("event.yRotationRate == null");
+shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])");
+shouldBeTrue("event.xAcceleration == 0");
+shouldBeTrue("event.yAcceleration == 0");
+shouldBeTrue("event.zAcceleration == 0");
+shouldBeTrue("event.xRotationRate == 0");
+shouldBeTrue("event.yRotationRate == 0");
+shouldBeTrue("event.zRotationRate == 0");
+shouldBeTrue("event.interval == 0");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)");
+shouldBeTrue("event.xAcceleration == null");
+shouldBeTrue("event.yAcceleration == null");
+shouldBeTrue("event.zAcceleration == null");
+shouldBeTrue("event.xRotationRate == null");
+shouldBeTrue("event.yRotationRate == null");
+shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')");
+shouldBeTrue("event.xAcceleration == 0");
+shouldBeTrue("event.yAcceleration == 0");
+shouldBeTrue("event.zAcceleration == 0");
+shouldBeTrue("event.xRotationRate == 0");
+shouldBeTrue("event.yRotationRate == 0");
+shouldBeTrue("event.zRotationRate == 0");
+shouldBeTrue("event.interval == 0");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)");
+shouldBeTrue("event.xAcceleration == null");
+shouldBeTrue("event.yAcceleration == null");
+shouldBeTrue("event.zAcceleration == null");
+shouldBeTrue("event.xRotationRate == null");
+shouldBeTrue("event.yRotationRate == null");
+shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.interval == null");
+
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js
new file mode 100644
index 0000000..3d22ba8
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js
@@ -0,0 +1,32 @@
+description("Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present.");
+
+function hasDeviceMotionEventProperty()
+{
+ for (var property in window) {
+ if (property == "DeviceMotionEvent")
+ return true;
+ }
+ return false;
+}
+
+shouldBeTrue("typeof window.DeviceMotionEvent == 'object'");
+shouldBeFalse("typeof window.DeviceMotionEvent == 'function'");
+shouldBeTrue("hasDeviceMotionEventProperty()");
+shouldBeTrue("'DeviceMotionEvent' in window");
+shouldBeTrue("window.hasOwnProperty('DeviceMotionEvent')");
+
+function hasOnDeviceMotionProperty()
+{
+ for (var property in window) {
+ if (property == "ondevicemotion")
+ return true;
+ }
+ return false;
+}
+
+shouldBeTrue("typeof window.ondevicemotion == 'object'");
+shouldBeTrue("hasOnDeviceMotionProperty()");
+shouldBeTrue("'ondevicemotion' in window");
+shouldBeTrue("window.hasOwnProperty('ondevicemotion')");
+
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt b/LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt
new file mode 100644
index 0000000..391677a
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt
@@ -0,0 +1,18 @@
+Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof window.DeviceMotionEvent == 'object' is true
+PASS typeof window.DeviceMotionEvent == 'function' is false
+PASS hasDeviceMotionEventProperty() is true
+PASS 'DeviceMotionEvent' in window is true
+PASS window.hasOwnProperty('DeviceMotionEvent') is true
+PASS typeof window.ondevicemotion == 'object' is true
+PASS hasOnDeviceMotionProperty() is true
+PASS 'ondevicemotion' in window is true
+PASS window.hasOwnProperty('ondevicemotion') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DeviceMotion/window-property.html b/LayoutTests/fast/dom/DeviceMotion/window-property.html
new file mode 100644
index 0000000..e122033
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceMotion/window-property.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/window-property.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/EntityReference/readonly-exceptions-expected.txt b/LayoutTests/fast/dom/EntityReference/readonly-exceptions-expected.txt
new file mode 100644
index 0000000..41cb36d
--- /dev/null
+++ b/LayoutTests/fast/dom/EntityReference/readonly-exceptions-expected.txt
@@ -0,0 +1,23 @@
+Test to make sure EntityReference nodes are always treated readonly
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS xmlDoc2.adoptNode(entityReference) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS entityReference.ownerDocument is xmlDoc
+PASS entityReference.nodeValue = 'foo' threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS entityReference.nodeValue is null
+PASS entityReference.prefix = 'foo' threw exception Error: NAMESPACE_ERR: DOM Exception 14.
+PASS entityReference.prefix is null
+PASS entityReference.textContent = 'foo' threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+FAIL entityReference.textContent should be >. Was .
+FAIL childrenBeforeFailedAppend should be 1. Was 0.
+PASS entityReference.appendChild(text) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS entityReference.childNodes.length is childrenBeforeFailedAppend
+FAIL childrenBeforeFailedAppend should be 1. Was 0.
+PASS entityReference.insertBefore(text, entityReference.firstChild) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS entityReference.childNodes.length is childrenBeforeFailedAppend
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/EntityReference/readonly-exceptions.html b/LayoutTests/fast/dom/EntityReference/readonly-exceptions.html
new file mode 100644
index 0000000..0de1858
--- /dev/null
+++ b/LayoutTests/fast/dom/EntityReference/readonly-exceptions.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/readonly-exceptions.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/EntityReference/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/EntityReference/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/EntityReference/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/EntityReference/script-tests/readonly-exceptions.js b/LayoutTests/fast/dom/EntityReference/script-tests/readonly-exceptions.js
new file mode 100644
index 0000000..e978728
--- /dev/null
+++ b/LayoutTests/fast/dom/EntityReference/script-tests/readonly-exceptions.js
@@ -0,0 +1,33 @@
+description("Test to make sure EntityReference nodes are always treated readonly")
+
+var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
+var xmlDoc2 = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
+var entityReference = xmlDoc.createEntityReference("gt");
+
+shouldThrow("xmlDoc2.adoptNode(entityReference)");
+shouldBe("entityReference.ownerDocument", "xmlDoc")
+
+// nodeValue is defined to be null for Entity Reference nodes, and thus should silently fail to modify
+// Spec is ambigious as to if we should throw here or not. I've requested clarification:
+// http://lists.w3.org/Archives/Public/www-dom/2008JanMar/0009.html
+shouldThrow("entityReference.nodeValue = 'foo'");
+shouldBe("entityReference.nodeValue", "null");
+
+shouldThrow("entityReference.prefix = 'foo'");
+shouldBe("entityReference.prefix", "null");
+
+shouldThrow("entityReference.textContent = 'foo'");
+shouldBe("entityReference.textContent", "'>'");
+
+var childrenBeforeFailedAppend = entityReference.childNodes.length;
+shouldBe("childrenBeforeFailedAppend", "1");
+var text = document.createTextNode("FAIL");
+shouldThrow("entityReference.appendChild(text)");
+shouldBe("entityReference.childNodes.length", "childrenBeforeFailedAppend");
+
+childrenBeforeFailedAppend = entityReference.childNodes.length;
+shouldBe("childrenBeforeFailedAppend", "1");
+shouldThrow("entityReference.insertBefore(text, entityReference.firstChild)");
+shouldBe("entityReference.childNodes.length", "childrenBeforeFailedAppend");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js
new file mode 100644
index 0000000..5cce834
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js
@@ -0,0 +1,70 @@
+description('Test setting the hash attribute of the URL in HTMLAnchorElement.');
+
+var a = document.createElement('a');
+
+debug("Hash value does not start with '#'");
+a.href = "https://www.mydomain.com:8080/path/testurl.html#middle";
+a.hash = "hash-value";
+shouldBe("a.href", "'https://www.mydomain.com:8080/path/testurl.html#hash-value'");
+
+debug("Hash value starts with '#'");
+a.href = "file:///path/testurl.html#middle";
+a.hash = "#hash_value";
+shouldBe("a.href", "'file:///path/testurl.html#hash_value'");
+
+debug("'?' in hash value");
+a.href = "http://www.mydomain.com/path/testurl.html#middle";
+a.hash = "#hash?value";
+shouldBe("a.href", "'http://www.mydomain.com/path/testurl.html#hash?value'");
+
+// The expected behavior should change when character table is updated.
+// IE8 and Firefox3.5.2 don't consider these characters as illegal.
+debug("'#' in hash value, and illegal characters in hostname");
+a.href = "https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle";
+a.hash = "#hash#value";
+shouldBe("a.href", "'https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle'");
+
+// IE8 converts null to "null", which is not the right thing to do.
+// Firefox 3.5.2 removes the '#' at the end, and it should per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set hash to null");
+a.href = "https://www.mydomain.com/path/testurl.html#middle";
+a.hash = null;
+shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html#'");
+
+// Firefox 3.5.2 removes the '#' at the end, and it should per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set hash to empty string");
+a.href = "https://www.mydomain.com/path/testurl.html#middle";
+a.hash = "";
+shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html#'");
+
+// Firefox 3.5.2 does not allow setting hash to mailto: scheme, and it should.
+debug("Add hash to mailto: protocol");
+a.href = "mailto:e-mail_address@goes_here";
+a.hash = "hash-value";
+shouldBe("a.href", "'mailto:e-mail_address@goes_here#hash-value'");
+
+// IE8 does not percent-encode spaces in the hash component, but it does that
+// in the path component.
+debug("Add hash to file: protocol");
+a.href = "file:///some path";
+a.hash = "hash value";
+shouldBe("a.href", "'file:///some%20path#hash%20value'");
+
+debug("Set hash to '#'");
+a.href = "http://mydomain.com#middle";
+a.hash = "#";
+shouldBe("a.href", "'http://mydomain.com/#'");
+
+// Firefox 3.5.2 does not allow setting hash to foo: scheme, and it should.
+debug("Add hash to non-standard protocol");
+try {
+a.href = "foo:bar";
+a.hash = "#hash";
+shouldBe("a.href", "'foo:bar#hash'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
new file mode 100644
index 0000000..313cf0f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
@@ -0,0 +1,115 @@
+description('Test setting the host attribute of the URL in HTMLAnchorElement.');
+
+var a = document.createElement('a');
+
+debug("Basic test");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:0";
+shouldBe("a.href", "'https://www.otherdomain.com:0/path/'");
+
+// IE8 throws "The URL is invalid" exception.
+debug("Set host with '?' in it");
+try {
+a.href = "https://www.mydomain.com:8080/path/?key=value";
+a.host = "www.other?domain.com:8080";
+shouldBe("a.href", "'https://www.other/?domain.com:8080/path/?key=value'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+debug("Set default port for another protocol");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:80";
+shouldBe("a.href", "'https://www.otherdomain.com:80/path/'");
+
+debug("Set default port");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:443";
+shouldBe("a.href", "'https://www.otherdomain.com/path/'");
+
+// Firefox 3.5.2 rejects a port that contains non-digits.
+debug("Set host with letters in port number");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:44a5";
+shouldBe("a.href", "'https://www.otherdomain.com:44/path/'");
+
+// Firefox 3.5.2 ignores the leading space in the port, but errs on reparsing the port.
+debug("Leading space in port number");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com: 443";
+shouldBe("a.href", "'https://www.otherdomain.com:0/path/'");
+
+// Firefox 3.5.2 removed the port, clearly against the spec .
+debug("Colon without port number");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:";
+shouldBe("a.href", "'https://www.otherdomain.com:0/path/'");
+
+// IE8 converts null to "null", which is not the right thing to do.
+// Firefox 3.5.2 allows setting the host to null, which it shouldn't per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set host to null");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = null;
+shouldBe("a.href", "'https://www.mydomain.com:8080/path/'");
+
+// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, which they shouldn't, per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+// Since both do that in a buggy way, WebKit does not follow either one of them.
+debug("Set host to empty string");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "";
+shouldBe("a.href", "'https://www.mydomain.com:8080/path/'");
+
+// Firefox 3.5.2 does not `set the host for file: .
+debug("Set host to URL with file: protocol");
+a.href = "file:///path/";
+a.host = "mydomain.com";
+shouldBe("a.href", "'file://mydomain.com/path/'");
+
+// IE8 throws if the host contains '/'
+debug("Set host containing slashes in it");
+try {
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.other\dom/ain.com";
+shouldBe("a.href", "'https://www.otherdom/ain.com/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// Firefox 3.5.2 add the missing '/' thus gets a different result than IE8 and Webkit.
+debug("Set host to a malformed URL");
+a.href = "https:/\rww.my@domain.com:8080/path/";
+a.host = "www.other!domain.com:15";
+shouldBe("a.href", "'https://www.other!domain.com:15/ww.my@domain.com:8080/path/'");
+
+// IE8 throws an "Object Error" exception.
+// Firefox 3.5.2 accepts this but throws an exception later
+// WebKit should just reject
+debug("Set host that starts with ':'");
+try {
+a.href = "https://domain.com:8080/path/";
+a.host = ":www.otherdomain.com:15";
+shouldBe("a.href", "'https://domain.com:8080/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// IE8 throws a security exception if the host contains '@'
+debug("Set host to URL containing username and ..");
+try {
+a.href = "https://rwwmy@domain.com:8080/pa..th/";
+a.host = "www.other!domain.com:25";
+shouldBe("a.href", "'https://rwwmy@www.other!domain.com:25/pa..th/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// Both IE8 and Firefox append the hosts, instead of rejecting, per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set host to a URL with tel: protocol");
+a.href = "tel:+1-816-555-1212";
+a.host = "+1-800-555-1212";
+shouldBe("a.href", "'tel:+1-816-555-1212'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js
new file mode 100644
index 0000000..0f4438f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js
@@ -0,0 +1,72 @@
+description('Test setting the hostname attribute of the URL in HTMLAnchorElement.');
+
+var a = document.createElement('a');
+
+debug("Basic test");
+a.href = "https://www.mydomain.com:8080/path/";
+a.hostname = "www.otherdomain.com";
+shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'");
+
+// IE8 throws an exception "The URL is invalid".
+try {
+debug("Extra slashes before hostname");
+a.href = "https://www.mydomain.com:8080/path/";
+a.hostname = "//www.otherdomain.com";
+shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// Firefox 3.5.2 does not allow setting the host to foo: protocol
+debug("Set hostname to URL with foo: protocol");
+a.href = "foo://www.mydomain.com/path/";
+a.hostname = "www.otherdomain.com";
+shouldBe("a.href", "'foo://www.otherdomain.com/path/'");
+
+// IE8 converts null to "null", which is not the right thing to do.
+// Firefox 3.5.2 allows setting the hostname to null, which is wrong per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set hostname to null");
+a.href = "https://www.mydomain.com:8080/path/";
+a.hostname = null;
+shouldBe("a.href", "'https://www.mydomain.com:8080/path/'");
+
+// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, against the spec at
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+// Since both do that in a buggy way, WebKit should not follow either one of them.
+debug("Set hostname to empty string");
+a.href = "https://www.mydomain.com:8080/path/";
+a.hostname = "";
+shouldBe("a.href", "'https://www.mydomain.com:8080/path/'");
+
+// IE8 fails to process really: protocol.
+debug("Set hostname to URL with 2 colons");
+a.href = "really:bad:url";
+a.hostname = "mydomain.com";
+shouldBe("a.href", "'really:bad:url'");
+
+// The expected behavior should change when the character table is updated.
+// IE8 encodes the space in the hostname.
+// Firefox3.5.2 and WebKit consider space as illegal character and would not set
+// the new hostname.
+debug("Set a hostname that contains space in it");
+a.href = "http://www.my domain.com/path/";
+a.hostname = "www.other domain.com";
+shouldBe("a.href", "'http://www.my domain.com/path/'");
+
+// IE8 throws an exception "The URL is invalid".
+try {
+debug("Set hostname on a local file");
+a.href = "c:/path/testurl.html";
+a.hostname= "a";
+shouldBe("a.href", "'c:/path/testurl.html'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+debug("Set hostname to undefined");
+a.href = "https://www.mydomain.com:8080/path/";
+a.hostname = undefined;
+shouldBe("a.href", "'https://undefined:8080/path/'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js
new file mode 100644
index 0000000..cc6a8e7
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js
@@ -0,0 +1,71 @@
+description('Test setting the pathname attribute of the URL in HTMLAnchorElement.');
+
+var a = document.createElement('a');
+
+debug("Set pathname that starts with slash");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value";
+a.pathname = "/path name";
+shouldBe("a.href", "'https://www.mydomain.com/path%20name?key=value'");
+
+// IE8 throws an "Invalid URL" exception.
+try {
+debug("Set pathname that does not start with slash and contains '?'");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value";
+a.pathname = "pa?th";
+shouldBe("a.href", "'https://www.mydomain.com/pa%3Fth?key=value'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// IE8 throws an "Invalid URL" exception.
+try {
+debug("Set pathname that starts with double slash and contains '#'");
+a.href = "https://www.mydomain.com/path?key=value";
+a.pathname = "//path#name";
+shouldBe("a.href", "'https://www.mydomain.com//path%23name?key=value'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+debug("Set a pathname containing .. in it");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value";
+a.pathname = "/it/../path";
+shouldBe("a.href", "'https://www.mydomain.com/path?key=value'");
+
+// IE8 converts null to "null", which is not the right thing to do.
+debug("Set pathname to null");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value";
+a.pathname = null;
+shouldBe("a.href", "'https://www.mydomain.com/?key=value'");
+
+debug("Set pathname to empty string");
+a.href = "https://www.mydomain.com/?key=value";
+a.pathname = "";
+shouldBe("a.href", "'https://www.mydomain.com/?key=value'");
+
+// The expected behavior should change when the character table is updated.
+// IE8 considers this URL as valid.
+debug("Set pathname that includes illegal characters to URL that contains illegal characters.");
+a.href = "https://www.my|d[]()omain.com/path/testurl.html?key=value";
+a.pathname = "p$a|th";
+shouldBe("a.href", "'https://www.my|d[]()omain.com/path/testurl.html?key=value'");
+
+// IE8 throws a security exception.
+try {
+debug("Set pathname to URL that contains '@' in host");
+a.href = "http://w@#ww";
+a.pathname = "path";
+shouldBe("a.href", "'http://w@/path#ww'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// IE8 allows setting the pathname, for non-hierarchial URL.
+// It is not supposed to allow that per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set pathname to a URL with non-hierarchical protocol");
+a.href = "tel:+1800-555-1212";
+a.pathname = "the-path";
+shouldBe("a.href", "'tel:+1800-555-1212'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js
new file mode 100644
index 0000000..9bc1112
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js
@@ -0,0 +1,49 @@
+description('Test setting the port attribute of the URL in HTMLAnchorElement.');
+
+var a = document.createElement('a');
+
+debug("Default port as number");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = 443;
+shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'");
+
+debug("Default port as string");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = "443";
+shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'");
+
+debug("Set port to 0");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = "0";
+shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'");
+
+// Firefox 3.5.2 does not accept the port if any character is not a digit.
+debug("Set port to non-number");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = "4a";
+shouldBe("a.href", "'https://www.mydomain.com:4/path/testurl.html?key=value'");
+
+// Firefox 3.5.2 does not accept the port if it is null.
+debug("Set port to null");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = null;
+shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'");
+
+// Firefox 3.5.2 does not accept the port if it is null.
+debug("Set port to empty string");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = "";
+shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'");
+
+debug("Set port to undefined");
+a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value";
+a.port = undefined;
+shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'");
+
+// Firefox 3.5.2 does not allow setting the port on a URL with protocol foo: .
+debug("Set port to URL with foo: protocol");
+a.href = "foo://bar/";
+a.port = 50;
+shouldBe("a.href", "'foo://bar:50/'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js
new file mode 100644
index 0000000..b296dea
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js
@@ -0,0 +1,80 @@
+description('Test setting the protocol attribute of the URL in HTMLAnchorElement .');
+
+var a = document.createElement('a');
+
+debug("Basic test");
+a.href = "https://www.mydomain.com/path/";
+a.protocol = "http-foo";
+shouldBe("a.href", "'http-foo://www.mydomain.com/path/'");
+
+// IE8 throws "Invalid argument" exception.
+debug("Set a protocol that contains ':'");
+try {
+a.href = "https://www.mydomain.com/path/";
+a.protocol = "http:foo";
+shouldBe("a.href", "'http://www.mydomain.com/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// IE8 throws "Invalid argument" exception.
+debug("Set a protocol that contains invalid characters");
+try {
+a.href = "https://www.mydomain.com/path/";
+a.protocol = "http^foo";
+shouldBe("a.href", "'https://www.mydomain.com/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// The expected behavior should change when the character table is updated.
+// IE8 encodes '^' in the host.
+debug("Set a protocol to a URL with invalid host name");
+a.href = "h:^^";
+a.protocol = "foo";
+shouldBe("a.href", "'foo:^^'");
+
+// IE8 throws "Invalid argument" exception.
+try {
+debug("Set a protocol that starts with ':'");
+a.href = "https://www.mydomain.com/path/";
+a.protocol = ":http";
+shouldBe("a.href", "'https://www.mydomain.com/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// IE8 converts null to "null", which is not the right thing to do.
+debug("Set protocol to null");
+a.href = "https://www.mydomain.com/path/";
+a.protocol = null;
+shouldBe("a.href", "'https://www.mydomain.com/path/'");
+
+// IE8 throws "Invalid argument" exception.
+try {
+debug("Set protocol to empty string");
+a.href = "https://www.mydomain.com/path/";
+a.protocol = "";
+shouldBe("a.href", "'https://www.mydomain.com/path/'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+// Firefox 3.5.2 tries to build a hierarchical URL.
+debug("Set protocol to http on malformed URL");
+a.href = "foo:??bar";
+a.protocol = "http";
+shouldBe("a.href", "'http:??bar'");
+
+// IE8 keeps the protocol if it is 'c:'.
+debug("Set protocol to a URL which points to a local file");
+a.href = "c:\path";
+a.protocol = "f-oo";
+shouldBe("a.href", "'f-oo:path'");
+
+debug("Set protocol to undefined");
+a.href = "https://www.mydomain.com/path/";
+a.protocol = undefined;
+shouldBe("a.href", "'undefined://www.mydomain.com/path/'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js
new file mode 100644
index 0000000..5b90a04
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js
@@ -0,0 +1,49 @@
+description('Test setting the search attribute of the URL in HTMLAnchorElement .');
+
+var a = document.createElement('a');
+
+debug("Set search without '?'");
+a.href = "https://www.mydomain.com/path/?key=value";
+a.search = "value=key";
+shouldBe("a.href", "'https://www.mydomain.com/path/?value=key'");
+
+// IE8 does not encode spaces in search string
+debug("Set search that starts with '?' and contains spaces");
+a.href = "https://www.mydomain.com/path/?key=value";
+a.search = "?val ue= key?";
+shouldBe("a.href", "'https://www.mydomain.com/path/?val%20ue=%20key?'");
+
+debug("Set search to a malformed URL");
+a.href = "s:www.mydomain.com/path/";
+a.search = "%";
+shouldBe("a.href", "'s:www.mydomain.com/path/?%'");
+
+// IE8 throws "The URL is invalid" exception.
+debug("Set search containing '#'");
+try {
+a.href = "https://www.mydomain.com/path/?key=value#hash";
+a.search = "?value#key";
+shouldBe("a.href", "'https://www.mydomain.com/path/?value%23key#hash'");
+} catch(e) {
+debug("Exception: " + e.description);
+}
+
+debug("Set search to a malformed URL");
+a.href = "bad:/|/url";
+a.search = "?value=key";
+shouldBe("a.href", "'bad:/|/url?value=key'");
+
+// IE8 converts null to "null", which is not the right thing to do.
+debug("Set search to null");
+a.href = "https://www.mydomain.com/path/?key=value";
+a.search = null;
+shouldBe("a.href", "'https://www.mydomain.com/path/'");
+
+// Firefox 3.5.2 Removes the '?', and it shouldn't, per
+// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
+debug("Set search to empty string");
+a.href = "https://www.mydomain.com/path/?key=value";
+a.search = "";
+shouldBe("a.href", "'https://www.mydomain.com/path/?'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js
new file mode 100644
index 0000000..8be6232
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js
@@ -0,0 +1,49 @@
+description('Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.');
+
+var a = document.createElement('a');
+
+debug("Set href that starts with a space");
+a.href = " https://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a newline");
+a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a tab");
+a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a carriage return");
+a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a space");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value ";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a newline");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a tab");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\t";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a carriage return");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\r";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a combination of newlines, spaces and tabs");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts and ends with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
new file mode 100644
index 0000000..6515820
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
@@ -0,0 +1,29 @@
+Test setting the hash attribute of the URL in HTMLAnchorElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Hash value does not start with '#'
+PASS a.href is 'https://www.mydomain.com:8080/path/testurl.html#hash-value'
+Hash value starts with '#'
+PASS a.href is 'file:///path/testurl.html#hash_value'
+'?' in hash value
+PASS a.href is 'http://www.mydomain.com/path/testurl.html#hash?value'
+'#' in hash value, and illegal characters in hostname
+PASS a.href is 'https://www.my"d(){}|~om?ain#com/path/testurl.html#middle'
+Set hash to null
+PASS a.href is 'https://www.mydomain.com/path/testurl.html#'
+Set hash to empty string
+PASS a.href is 'https://www.mydomain.com/path/testurl.html#'
+Add hash to mailto: protocol
+PASS a.href is 'mailto:e-mail_address@goes_here#hash-value'
+Add hash to file: protocol
+PASS a.href is 'file:///some%20path#hash%20value'
+Set hash to '#'
+PASS a.href is 'http://mydomain.com/#'
+Add hash to non-standard protocol
+PASS a.href is 'foo:bar#hash'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html
new file mode 100644
index 0000000..44ed1fc
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-hash.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
new file mode 100644
index 0000000..6c457a4
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
@@ -0,0 +1,39 @@
+Test setting the host attribute of the URL in HTMLAnchorElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Basic test
+PASS a.href is 'https://www.otherdomain.com:0/path/'
+Set host with '?' in it
+PASS a.href is 'https://www.other/?domain.com:8080/path/?key=value'
+Set default port for another protocol
+PASS a.href is 'https://www.otherdomain.com:80/path/'
+Set default port
+PASS a.href is 'https://www.otherdomain.com/path/'
+Set host with letters in port number
+PASS a.href is 'https://www.otherdomain.com:44/path/'
+Leading space in port number
+PASS a.href is 'https://www.otherdomain.com:0/path/'
+Colon without port number
+PASS a.href is 'https://www.otherdomain.com:0/path/'
+Set host to null
+PASS a.href is 'https://www.mydomain.com:8080/path/'
+Set host to empty string
+PASS a.href is 'https://www.mydomain.com:8080/path/'
+Set host to URL with file: protocol
+PASS a.href is 'file://mydomain.com/path/'
+Set host containing slashes in it
+PASS a.href is 'https://www.otherdom/ain.com/path/'
+Set host to a malformed URL
+PASS a.href is 'https://www.other!domain.com:15/ww.my@domain.com:8080/path/'
+Set host that starts with ':'
+PASS a.href is 'https://domain.com:8080/path/'
+Set host to URL containing username and ..
+PASS a.href is 'https://rwwmy@www.other!domain.com:25/pa..th/'
+Set host to a URL with tel: protocol
+PASS a.href is 'tel:+1-816-555-1212'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
new file mode 100644
index 0000000..602f3d2
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-host.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
new file mode 100644
index 0000000..d0b284d
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
@@ -0,0 +1,27 @@
+Test setting the hostname attribute of the URL in HTMLAnchorElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Basic test
+PASS a.href is 'https://www.otherdomain.com:8080/path/'
+Extra slashes before hostname
+PASS a.href is 'https://www.otherdomain.com:8080/path/'
+Set hostname to URL with foo: protocol
+PASS a.href is 'foo://www.otherdomain.com/path/'
+Set hostname to null
+PASS a.href is 'https://www.mydomain.com:8080/path/'
+Set hostname to empty string
+PASS a.href is 'https://www.mydomain.com:8080/path/'
+Set hostname to URL with 2 colons
+PASS a.href is 'really:bad:url'
+Set a hostname that contains space in it
+PASS a.href is 'http://www.my domain.com/path/'
+Set hostname on a local file
+FAIL a.href should be c:/path/testurl.html. Was c://a/path/testurl.html.
+Set hostname to undefined
+PASS a.href is 'https://undefined:8080/path/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html
new file mode 100644
index 0000000..f08b433
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-hostname.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt
new file mode 100644
index 0000000..5b2d8ae
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt
@@ -0,0 +1,27 @@
+Test setting the pathname attribute of the URL in HTMLAnchorElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Set pathname that starts with slash
+PASS a.href is 'https://www.mydomain.com/path%20name?key=value'
+Set pathname that does not start with slash and contains '?'
+PASS a.href is 'https://www.mydomain.com/pa%3Fth?key=value'
+Set pathname that starts with double slash and contains '#'
+PASS a.href is 'https://www.mydomain.com//path%23name?key=value'
+Set a pathname containing .. in it
+PASS a.href is 'https://www.mydomain.com/path?key=value'
+Set pathname to null
+PASS a.href is 'https://www.mydomain.com/?key=value'
+Set pathname to empty string
+PASS a.href is 'https://www.mydomain.com/?key=value'
+Set pathname that includes illegal characters to URL that contains illegal characters.
+PASS a.href is 'https://www.my|d[]()omain.com/path/testurl.html?key=value'
+Set pathname to URL that contains '@' in host
+PASS a.href is 'http://w@/path#ww'
+Set pathname to a URL with non-hierarchical protocol
+PASS a.href is 'tel:+1800-555-1212'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html
new file mode 100644
index 0000000..93d70b0
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-pathname.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
new file mode 100644
index 0000000..93678c4
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
@@ -0,0 +1,25 @@
+Test setting the port attribute of the URL in HTMLAnchorElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Default port as number
+PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value'
+Default port as string
+PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value'
+Set port to 0
+PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
+Set port to non-number
+PASS a.href is 'https://www.mydomain.com:4/path/testurl.html?key=value'
+Set port to null
+PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
+Set port to empty string
+PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
+Set port to undefined
+PASS a.href is 'https://www.mydomain.com:0/path/testurl.html?key=value'
+Set port to URL with foo: protocol
+PASS a.href is 'foo://bar:50/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html
new file mode 100644
index 0000000..f5cc94e
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-port.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
new file mode 100644
index 0000000..bd801ab
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
@@ -0,0 +1,29 @@
+Test setting the protocol attribute of the URL in HTMLAnchorElement .
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Basic test
+PASS a.href is 'http-foo://www.mydomain.com/path/'
+Set a protocol that contains ':'
+PASS a.href is 'http://www.mydomain.com/path/'
+Set a protocol that contains invalid characters
+PASS a.href is 'https://www.mydomain.com/path/'
+Set a protocol to a URL with invalid host name
+PASS a.href is 'foo:^^'
+Set a protocol that starts with ':'
+PASS a.href is 'https://www.mydomain.com/path/'
+Set protocol to null
+PASS a.href is 'https://www.mydomain.com/path/'
+Set protocol to empty string
+PASS a.href is 'https://www.mydomain.com/path/'
+Set protocol to http on malformed URL
+PASS a.href is 'http:??bar'
+Set protocol to a URL which points to a local file
+PASS a.href is 'f-oo:path'
+Set protocol to undefined
+PASS a.href is 'undefined://www.mydomain.com/path/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html
new file mode 100644
index 0000000..8f6ec8f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-protocol.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
new file mode 100644
index 0000000..d034e2b
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
@@ -0,0 +1,23 @@
+Test setting the search attribute of the URL in HTMLAnchorElement .
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Set search without '?'
+PASS a.href is 'https://www.mydomain.com/path/?value=key'
+Set search that starts with '?' and contains spaces
+PASS a.href is 'https://www.mydomain.com/path/?val%20ue=%20key?'
+Set search to a malformed URL
+PASS a.href is 's:www.mydomain.com/path/?%'
+Set search containing '#'
+PASS a.href is 'https://www.mydomain.com/path/?value%23key#hash'
+Set search to a malformed URL
+PASS a.href is 'bad:/|/url?value=key'
+Set search to null
+PASS a.href is 'https://www.mydomain.com/path/'
+Set search to empty string
+PASS a.href is 'https://www.mydomain.com/path/?'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html
new file mode 100644
index 0000000..58695cb
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-search.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
new file mode 100644
index 0000000..f7dfc61
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
@@ -0,0 +1,31 @@
+Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Set href that starts with a space
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a newline
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a tab
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a carriage return
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a space
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a newline
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a tab
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a carriage return
+PASS a.hostname is 'www.mydomain.com'
+Set href that ends with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+Set href that starts and ends with a combination of newlines, spaces and tabs
+PASS a.hostname is 'www.mydomain.com'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
new file mode 100644
index 0000000..7f86293
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/set-href-attribute-whitespace.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLButtonElement/value/getset-expected.txt b/LayoutTests/fast/dom/HTMLButtonElement/value/getset-expected.txt
new file mode 100644
index 0000000..1c5d6a3
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLButtonElement/value/getset-expected.txt
@@ -0,0 +1,5 @@
+Tests: HTMLButtonElement::value
+
+This test changes the value of the button. The original value is "Fail"; the new value should be "Success"
+
+ Button value is: Success
diff --git a/LayoutTests/fast/dom/HTMLButtonElement/value/getset.html b/LayoutTests/fast/dom/HTMLButtonElement/value/getset.html
new file mode 100644
index 0000000..cb0f4d4
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLButtonElement/value/getset.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<script>
+function test() {
+ if (window.layoutTestController) {
+ window.layoutTestController.dumpAsText();
+ }
+ var but = document.getElementById('button');
+ but.value = 'Success';
+ document.writeln("Button value is: " + but.value);
+}
+</script>
+</head>
+<body>
+<p>Tests: HTMLButtonElement::value</p>
+
+<p>
+This test changes the value of the button. The original value is "Fail"; the new value should be "Success"
+</p>
+
+<hr>
+
+<input type=button id='button' value='Fail'></input>
+
+</body>
+<script>test()</script>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js b/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js
new file mode 100644
index 0000000..3e090b1
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js
@@ -0,0 +1,58 @@
+description("HTMLFontElement size attribute test");
+
+function fontSizeAttributeEffect(value)
+{
+ var element = document.createElement("font");
+ element.setAttribute("size", value);
+ var outerElement = document.createElement("p");
+ outerElement.setAttribute("style", "font-size: 100px");
+ document.body.appendChild(outerElement);
+ outerElement.appendChild(element);
+ var computedStyle = getComputedStyle(element, "");
+ var result = computedStyle.fontSize;
+ document.body.removeChild(outerElement);
+ return result === "100px" ? null : result;
+}
+
+shouldBe('fontSizeAttributeEffect("")', 'null');
+
+shouldBe('fontSizeAttributeEffect("1")', '"10px"');
+shouldBe('fontSizeAttributeEffect("2")', '"13px"');
+shouldBe('fontSizeAttributeEffect("3")', '"16px"');
+shouldBe('fontSizeAttributeEffect("4")', '"18px"');
+shouldBe('fontSizeAttributeEffect("5")', '"24px"');
+shouldBe('fontSizeAttributeEffect("6")', '"32px"');
+shouldBe('fontSizeAttributeEffect("7")', '"48px"');
+
+shouldBe('fontSizeAttributeEffect("0")', '"16px"'); // Gecko and WebKit do not agree on this result. Which matches IE?
+
+shouldBe('fontSizeAttributeEffect("-1")', '"13px"');
+shouldBe('fontSizeAttributeEffect("-2")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-3")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-4")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-5")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-6")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-7")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-8")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-9")', '"10px"');
+shouldBe('fontSizeAttributeEffect("-10")', '"10px"');
+
+shouldBe('fontSizeAttributeEffect("8")', '"48px"');
+shouldBe('fontSizeAttributeEffect("9")', '"48px"');
+shouldBe('fontSizeAttributeEffect("10")', '"48px"');
+shouldBe('fontSizeAttributeEffect("100")', '"48px"');
+shouldBe('fontSizeAttributeEffect("1000")', '"48px"');
+
+shouldBe('fontSizeAttributeEffect("1x")', '"10px"');
+shouldBe('fontSizeAttributeEffect("1.")', '"10px"');
+shouldBe('fontSizeAttributeEffect("1.9")', '"10px"');
+shouldBe('fontSizeAttributeEffect("2x")', '"13px"');
+shouldBe('fontSizeAttributeEffect("2.")', '"13px"');
+shouldBe('fontSizeAttributeEffect("2.9")', '"13px"');
+
+shouldBe('fontSizeAttributeEffect("a")', 'null');
+
+var arabicIndicDigitOne = String.fromCharCode(0x661);
+shouldBe('fontSizeAttributeEffect(arabicIndicDigitOne)', 'null');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt b/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
new file mode 100644
index 0000000..28d44af
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
@@ -0,0 +1,41 @@
+HTMLFontElement size attribute test
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS fontSizeAttributeEffect("") is null
+PASS fontSizeAttributeEffect("1") is "10px"
+PASS fontSizeAttributeEffect("2") is "13px"
+PASS fontSizeAttributeEffect("3") is "16px"
+PASS fontSizeAttributeEffect("4") is "18px"
+PASS fontSizeAttributeEffect("5") is "24px"
+PASS fontSizeAttributeEffect("6") is "32px"
+PASS fontSizeAttributeEffect("7") is "48px"
+PASS fontSizeAttributeEffect("0") is "16px"
+PASS fontSizeAttributeEffect("-1") is "13px"
+PASS fontSizeAttributeEffect("-2") is "10px"
+PASS fontSizeAttributeEffect("-3") is "10px"
+PASS fontSizeAttributeEffect("-4") is "10px"
+PASS fontSizeAttributeEffect("-5") is "10px"
+PASS fontSizeAttributeEffect("-6") is "10px"
+PASS fontSizeAttributeEffect("-7") is "10px"
+PASS fontSizeAttributeEffect("-8") is "10px"
+PASS fontSizeAttributeEffect("-9") is "10px"
+PASS fontSizeAttributeEffect("-10") is "10px"
+PASS fontSizeAttributeEffect("8") is "48px"
+PASS fontSizeAttributeEffect("9") is "48px"
+PASS fontSizeAttributeEffect("10") is "48px"
+PASS fontSizeAttributeEffect("100") is "48px"
+PASS fontSizeAttributeEffect("1000") is "48px"
+PASS fontSizeAttributeEffect("1x") is "10px"
+PASS fontSizeAttributeEffect("1.") is "10px"
+PASS fontSizeAttributeEffect("1.9") is "10px"
+PASS fontSizeAttributeEffect("2x") is "13px"
+PASS fontSizeAttributeEffect("2.") is "13px"
+PASS fontSizeAttributeEffect("2.9") is "13px"
+PASS fontSizeAttributeEffect("a") is null
+PASS fontSizeAttributeEffect(arabicIndicDigitOne) is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html b/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html
new file mode 100644
index 0000000..4361dba
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/size-attribute.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion-expected.txt
new file mode 100644
index 0000000..e602f6f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion-expected.txt
@@ -0,0 +1,3 @@
+Test for https://bugs.webkit.org/attachment.cgi?id=30159 Assertion failure in Node::setDocument() (willMoveToNewOwnerDocumentWasCalled) when adopting a <form> element.
+
+The test passed if the assertion did not fail.
diff --git a/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion.html b/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion.html
new file mode 100644
index 0000000..80a99d5
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/adopt-assertion.html
@@ -0,0 +1,16 @@
+<p>
+ Test for <i><a href="https://bugs.webkit.org/attachment.cgi?id=30159">https://bugs.webkit.org/attachment.cgi?id=30159</a>
+ Assertion failure in Node::setDocument()
+ (willMoveToNewOwnerDocumentWasCalled) when adopting a &lt;form> element</i>.
+</p>
+<p>
+ The test passed if the assertion did not fail.
+</p>
+<form id="target"></form>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var otherDocument = document.implementation.createHTMLDocument();
+ otherDocument.adoptNode(document.getElementById("target"));
+</script>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash-expected.txt
new file mode 100644
index 0000000..637c653
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash-expected.txt
@@ -0,0 +1,5 @@
+Test for a crash when deactivating a document that had adopted a <form> element.
+
+The test passed if it did not crash.
+
+
diff --git a/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash.html b/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash.html
new file mode 100644
index 0000000..d8b535e
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/document-deactivation-callback-crash.html
@@ -0,0 +1,41 @@
+<p>
+ Test for a crash when deactivating a document that had adopted a &lt;form>
+ element.
+</p>
+<p>
+ The test passed if it did not crash.
+</p>
+<iframe id="iframe"></iframe>
+<script>
+ var iframe = document.getElementById("iframe");
+
+ onload = function()
+ {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ document.body.offsetTop;
+ var otherDocument = iframe.contentDocument;
+ var form = document.createElement("form");
+ otherDocument.adoptNode(form);
+ form = null;
+ setTimeout(finish, 0);
+ }
+
+ function finish()
+ {
+ if (window.GCController)
+ GCController.collect()
+ else {
+ for (var i = 0; i < 10000; i++)
+ var foo = { };
+ }
+
+ iframe.parentNode.removeChild(iframe);
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+</script>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document-expected.txt
new file mode 100644
index 0000000..54dbd7d
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document-expected.txt
@@ -0,0 +1,27 @@
+Test the elements collection when the form is not a descendant of the document. This test case failed in an early version of Acid3.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS i.getAttribute('name') is 'first'
+PASS i.name is 'first'
+PASS i.getAttribute('type') is 'text'
+PASS i.type is 'text'
+PASS i.value is 'test'
+PASS f.elements.length is 1
+PASS f.elements[0] is i
+PASS f.elements.first is i
+PASS f.elements.second is i
+PASS i.getAttribute('name') is 'second'
+PASS i.name is 'second'
+PASS i.getAttribute('type') is 'password'
+PASS i.type is 'password'
+PASS i.value is 'TEST'
+PASS f.elements.length is 1
+PASS f.elements[0] is i
+PASS f.elements.first is undefined
+PASS f.elements.second is i
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html b/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html
new file mode 100644
index 0000000..09b6f36
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/elements-not-in-document.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter-expected.txt
new file mode 100644
index 0000000..db8ff58
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter-expected.txt
@@ -0,0 +1,10 @@
+This test verifies that elements can be fetched by index from HTMLFormElements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS form[0] is my_input
+PASS successfullyParsed is true
+
+TEST COMPLETE
+HTMLInputElement
diff --git a/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter.html b/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter.html
new file mode 100644
index 0000000..b45c35f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/htmlformelement-indexed-getter.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<form id='f'>
+ <input type="radio" name="a" value="a" id="i">HTMLInputElement</input>
+</form>
+
+<script>
+description('This test verifies that elements can be fetched by index from HTMLFormElements.');
+
+var form = document.getElementById('f');
+var my_input = document.getElementById('i');
+shouldBe("form[0]", "my_input");
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js b/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js
new file mode 100644
index 0000000..da1ea80
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js
@@ -0,0 +1,37 @@
+description('Test the elements collection when the form is not a descendant of the document. This test case failed in an early version of Acid3.');
+
+var f = document.createElement('form');
+var i = document.createElement('input');
+i.name = 'first';
+i.type = 'text';
+i.value = 'test';
+f.appendChild(i);
+
+shouldBe("i.getAttribute('name')", "'first'");
+shouldBe("i.name", "'first'");
+shouldBe("i.getAttribute('type')", "'text'");
+shouldBe("i.type", "'text'");
+shouldBe("i.value", "'test'");
+shouldBe("f.elements.length", "1");
+shouldBe("f.elements[0]", "i");
+shouldBe("f.elements.first", "i");
+
+f.elements.second;
+i.name = 'second';
+i.type = 'password';
+i.value = 'TEST';
+
+// This has to be the first expression tested, because reporting the result will fix the bug.
+shouldBe("f.elements.second", "i");
+
+shouldBe("i.getAttribute('name')", "'second'");
+shouldBe("i.name", "'second'");
+shouldBe("i.getAttribute('type')", "'password'");
+shouldBe("i.type", "'password'");
+shouldBe("i.value", "'TEST'");
+shouldBe("f.elements.length", "1");
+shouldBe("f.elements[0]", "i");
+shouldBe("f.elements.first", "undefined");
+shouldBe("f.elements.second", "i");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt b/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt
new file mode 100644
index 0000000..335df63
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt
@@ -0,0 +1,2 @@
+This tests that we won't crash when creating a new html element when the document does not have a document element.
+SUCCESS - Did not crash!
diff --git a/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html b/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html
new file mode 100644
index 0000000..216f1a9
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html
@@ -0,0 +1,17 @@
+<body onload="runTest()">
+<script>
+function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var div = document.createElement('div');
+ div.appendChild(document.body.parentElement);
+ var a = document.createElement('a');
+ a.innerHTML = '<x><html></html>';
+
+ document.appendChild(document.createElement('html'))
+ document.documentElement.innerHTML='<div>This tests that we won\'t crash when creating a new html element when the document does not ' +
+ 'have a document element.</div><div>SUCCESS - Did not crash!</div>'
+}
+</script>
+</body>
diff --git a/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt b/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt
new file mode 100644
index 0000000..782fe8f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt
@@ -0,0 +1,6 @@
+This tests to make sure that HTMLHtmlElement::version settable.
+
+You should see 2 lines with "SUCCESS" below:
+SUCCESS (value: "1")
+
+SUCCESS (value: "2")
diff --git a/LayoutTests/fast/dom/HTMLHtmlElement/set-version.html b/LayoutTests/fast/dom/HTMLHtmlElement/set-version.html
new file mode 100644
index 0000000..2e45aad
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLHtmlElement/set-version.html
@@ -0,0 +1,24 @@
+<html version="1">
+<body>
+<p>
+This tests to make sure that HTMLHtmlElement::version settable.</p>
+You should see 2 lines with "SUCCESS" below:
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function checkExpected(actual, expected)
+{
+ if (actual != expected)
+ document.writeln("<p>FAILURE: expected \"" + expected + "\", actual \"" + actual + "\"</p>");
+ else
+ document.writeln("<p>SUCCESS (value: \"" + actual + "\")</p>");
+}
+
+var htmlElement = document.getElementsByTagName("html")[0];
+checkExpected(htmlElement.version, 1);
+htmlElement.version = 2;
+checkExpected(htmlElement.version, 2);
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt
new file mode 100644
index 0000000..a6f14fb
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select-expected.txt
@@ -0,0 +1,6 @@
+
+This test verifies that list-box-style select form control for keygen works properly when selecting from option element.
+
+You should see the word "SUCCESS" below
+
+SUCCESS
diff --git a/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html
new file mode 100644
index 0000000..2667715
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLKeygenElement/keygen-option-select.html
@@ -0,0 +1,40 @@
+<html><head>
+</head><body>
+<keygen id="keys" />
+
+<p>This test verifies that list-box-style select form control for keygen works properly when selecting from option element.
+</p><p>You should see the word "SUCCESS" below</p>
+
+<div id="result">FAILED</div>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function test(elementId)
+{
+ var testKeygenElement = document.getElementById(elementId);
+
+ // Add two option elements here in case the webkit port used doesn't implement the WebCore::getSupportedKeySizes() function
+
+ var testOption1 = document.createElement("option");
+ var testOption1Text = document.createTextNode("foo1");
+ testOption1.appendChild(testOption1Text);
+ testKeygenElement.appendChild(testOption1);
+
+ var testOption2 = document.createElement("option");
+ var testOption2Text = document.createTextNode("foo2");
+ testOption2.appendChild(testOption2Text);
+ testKeygenElement.appendChild(testOption2);
+
+ if (testKeygenElement.options[1].index == 1)
+ {
+ var result = document.getElementById("result");
+ result.innerHTML = "SUCCESS";
+ }
+}
+test("keys");
+</script>
+
+
+</body></html>
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/click-label-expected.txt b/LayoutTests/fast/dom/HTMLLabelElement/click-label-expected.txt
new file mode 100644
index 0000000..442e91c
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/click-label-expected.txt
@@ -0,0 +1,5 @@
+This tests that the correct form control element is clicked when clicking on a label. If the test is successful, the text "SUCCESS" should show below.
+label1inc
+label2inc
+
+SUCCESS
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/click-label.html b/LayoutTests/fast/dom/HTMLLabelElement/click-label.html
new file mode 100644
index 0000000..b8dbfbd
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/click-label.html
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script>
+var clickcount = 0;
+function dispatchClickEvent(target) {
+ // Create a click event and dispatch it
+ var event = document.createEvent('UIEvents');
+ event.initUIEvent('click', true, true, window, 1)
+ target.dispatchEvent(event);
+}
+
+function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var label1 = document.getElementById('label1');
+ dispatchClickEvent(label1);
+ if (clickcount < 1)
+ return;
+
+ var label2 = document.getElementById('label2');
+ dispatchClickEvent(label2);
+ if (clickcount < 2)
+ return;
+ document.getElementById('result').innerHTML = 'SUCCESS'
+}
+
+function inc()
+{
+ clickcount++;
+}
+</script>
+</head>
+<body onload="runTest()">
+This tests that the correct form control element is clicked when clicking on a label.
+If the test is successful, the text "SUCCESS" should show below.<br>
+<Label id="label1">label1<button onclick="inc();">inc</button></label><br>
+<Label id="label2">label2<fieldset><legend><button onclick="inc();">inc</button></legend></fieldset></label><br>
+<div id="result">FAILURE</div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/focus-label-expected.txt b/LayoutTests/fast/dom/HTMLLabelElement/focus-label-expected.txt
new file mode 100644
index 0000000..ff90b5d
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/focus-label-expected.txt
@@ -0,0 +1,5 @@
+This tests that the correct form control element is activated when clicking on a label. If the test is successful, the text "SUCCESS" should show below.
+label1
+label2
+
+SUCCESS
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/focus-label.html b/LayoutTests/fast/dom/HTMLLabelElement/focus-label.html
new file mode 100644
index 0000000..b1f697d
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/focus-label.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script>
+
+function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var label1 = document.getElementById('label1');
+ label1.focus();
+ if (document.getElementById('cb1') != document.activeElement)
+ return;
+
+ var label2 = document.getElementById('label2');
+ label2.focus();
+ if (document.getElementById('cb2') != document.activeElement)
+ return;
+ document.getElementById('result').innerHTML = 'SUCCESS'
+}
+
+</script>
+</head>
+<body onload="runTest()">
+This tests that the correct form control element is activated when clicking on a label.
+If the test is successful, the text "SUCCESS" should show below.<br>
+<Label id="label1">label1<input id="cb1" type="checkbox"></label><br>
+<Label id="label2">label2<fieldset><legend><input id="cb2" type="checkbox"></legend></fieldset></label><br>
+<div id="result">FAILURE</div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/form/test1-expected.txt b/LayoutTests/fast/dom/HTMLLabelElement/form/test1-expected.txt
new file mode 100644
index 0000000..e374b37
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/form/test1-expected.txt
@@ -0,0 +1,7 @@
+This test attempts to access an HTMLLabelElement's form property. The first test accesses the form property of an label which is inside of a form. The second test accesses the form property of an label which is not inside of a form
+
+Passed
+
+Passed
+
+
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/form/test1.html b/LayoutTests/fast/dom/HTMLLabelElement/form/test1.html
new file mode 100644
index 0000000..6a30bd0
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/form/test1.html
@@ -0,0 +1,46 @@
+<html>
+ <head>
+ <script language="javascript">
+ function print(message)
+ {
+ var paragraph = document.createElement("p");
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(paragraph);
+ }
+ function test()
+ {
+ if(window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ labelInsideForm = document.getElementById("labelInsideForm");
+ labelNotInsideForm = document.getElementById("labelNotInsideForm");
+
+ form = document.getElementById("form");
+
+ if(labelInsideForm.form == form)
+ print("Passed");
+ else
+ print("Failed");
+
+ if(labelNotInsideForm.form == null)
+ print("Passed");
+ else
+ print("Failed");
+ }
+ </script>
+ </head>
+
+ <body onload="test();">
+ <p>This test attempts to access an HTMLLabelElement's form property. The first test accesses the form property of an label which is inside of a form. The second test accesses the form property of an label which is not inside of a form</p>
+
+ <div id="console"></div>
+
+ <form id="form">
+ <label id="labelInsideForm">
+ </label>
+ </form>
+
+ <label id="labelNotInsideForm">
+ </label>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/label-control-expected.txt b/LayoutTests/fast/dom/HTMLLabelElement/label-control-expected.txt
new file mode 100644
index 0000000..bb127c6
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/label-control-expected.txt
@@ -0,0 +1,51 @@
+Test that label.control references the correct form control, or null if there is no associated control.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Find a control that is the first descendent in a label
+PASS document.getElementById('test1').control.id is 'inputId1'
+Find a control based on a label with valid 'for' attribute
+PASS document.getElementById('test2').htmlFor is 'inputId2'
+PASS document.getElementById('test2').control.type is 'number'
+Find a control in p element in label
+PASS document.getElementById('test3').control.id is 'inputId3'
+Find a control in fieldset in label.
+Note that filedset is a form control that is not labelable.
+PASS document.getElementById('test4').control.id is 'inputId4'
+Find a control in legend in label.
+Note that legend is a form control that is not labelable.
+PASS document.getElementById('test5').control.id is 'inputId5'
+Find a control in optgroup in label.
+Note that optgroup is a form control that is not labelable.
+PASS document.getElementById('test6').control.id is 'inputId6'
+Find a control in option in label.
+Note that option is a form control that is not labelable.
+PASS document.getElementById('test7').control.id is 'inputId7'
+Test label with 'for' attribute which is not a valid element id
+PASS document.getElementById('test8').control is null
+Test label with 'for' attribute which is not a form control
+PASS document.getElementById('test9').htmlFor is 'divId'
+PASS document.getElementById('test9').control is null
+Test label with 'for' attribute which is not a labelable form control - fieldset
+PASS document.getElementById('test10').htmlFor is 'fsId'
+PASS document.getElementById('test10').control is null
+Test label with 'for' attribute which is not a labelable form control - legend
+PASS document.getElementById('test11').htmlFor is 'legendId'
+PASS document.getElementById('test11').control is null
+Test label with 'for' attribute which is not a labelable form control - optgroup
+PASS document.getElementById('test12').htmlFor is 'optgroupId'
+PASS document.getElementById('test12').control is null
+Test label with 'for' attribute which is not a labelable form control - option
+PASS document.getElementById('test13').htmlFor is 'optionId'
+PASS document.getElementById('test13').control is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+
+
+
+
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/label-control.html b/LayoutTests/fast/dom/HTMLLabelElement/label-control.html
new file mode 100644
index 0000000..cd0691f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/label-control.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/label-control.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js b/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js
new file mode 100644
index 0000000..7a93c12
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js
@@ -0,0 +1,65 @@
+description('Test that label.control references the correct form control, or null if there is no associated control.');
+
+debug("Find a control that is the first descendent in a label");
+document.write("<label id='test1'><input id='inputId1'></label>");
+shouldBe("document.getElementById('test1').control.id", "'inputId1'");
+
+debug("Find a control based on a label with valid 'for' attribute");
+document.write("<label id='test2' for='inputId2'></label><input id='inputId2' type='number'>");
+shouldBe("document.getElementById('test2').htmlFor", "'inputId2'");
+shouldBe("document.getElementById('test2').control.type", "'number'");
+
+debug("Find a control in p element in label");
+document.write("<label id='test3'><p><input id='inputId3' type='date'></p></label>");
+shouldBe("document.getElementById('test3').control.id", "'inputId3'");
+
+debug("Find a control in fieldset in label.");
+debug("Note that filedset is a form control that is not labelable.");
+document.write("<label id='test4'><fieldset><input id='inputId4'></fieldset></label>");
+shouldBe("document.getElementById('test4').control.id", "'inputId4'");
+
+debug("Find a control in legend in label.");
+debug("Note that legend is a form control that is not labelable.");
+document.write("<label id='test5'><legend><input id='inputId5'></legend></label>");
+shouldBe("document.getElementById('test5').control.id", "'inputId5'");
+
+debug("Find a control in optgroup in label.");
+debug("Note that optgroup is a form control that is not labelable.");
+document.write("<label id='test6'><optgroup><input id='inputId6'></optgroup></label>");
+shouldBe("document.getElementById('test6').control.id", "'inputId6'");
+
+debug("Find a control in option in label.");
+debug("Note that option is a form control that is not labelable.");
+document.write("<label id='test7'><option><input id='inputId7'></option></label>");
+shouldBe("document.getElementById('test7').control.id", "'inputId7'");
+
+debug("Test label with 'for' attribute which is not a valid element id");
+document.write("<label for='foo' id='test8'><input id='inputId8'></label>");
+shouldBe("document.getElementById('test8').control", "null");
+
+debug("Test label with 'for' attribute which is not a form control");
+document.write("<label for='divId' id='test9'><input id='inputId9'></label><div id='divId'></div>");
+shouldBe("document.getElementById('test9').htmlFor", "'divId'");
+shouldBe("document.getElementById('test9').control", "null");
+
+debug("Test label with 'for' attribute which is not a labelable form control - fieldset");
+document.write("<label for='fsId' id='test10'><input id='inputId10'></label><fieldset id='fsId'></fieldset>");
+shouldBe("document.getElementById('test10').htmlFor", "'fsId'");
+shouldBe("document.getElementById('test10').control", "null");
+
+debug("Test label with 'for' attribute which is not a labelable form control - legend");
+document.write("<label for='legendId' id='test11'><input id='inputId11'></label><legend id='legendId'></legend>");
+shouldBe("document.getElementById('test11').htmlFor", "'legendId'");
+shouldBe("document.getElementById('test11').control", "null");
+
+debug("Test label with 'for' attribute which is not a labelable form control - optgroup");
+document.write("<label for='optgroupId' id='test12'><input id='inputId12'></label><optgroup id='optgroupId'></optgroup>");
+shouldBe("document.getElementById('test12').htmlFor", "'optgroupId'");
+shouldBe("document.getElementById('test12').control", "null");
+
+debug("Test label with 'for' attribute which is not a labelable form control - option");
+document.write("<label for='optionId' id='test13'><input id='inputId13'></label><option id='optionId'></option>");
+shouldBe("document.getElementById('test13').htmlFor", "'optionId'");
+shouldBe("document.getElementById('test13').control", "null");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes-expected.txt b/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes-expected.txt
new file mode 100644
index 0000000..77e76d1
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes-expected.txt
@@ -0,0 +1,10 @@
+You should see 5 lines with "SUCCESS" below:
+SUCCESS (value: "[object HTMLMetaElement]")
+
+SUCCESS (value: "foo")
+
+SUCCESS (value: "bar")
+
+SUCCESS (value: "content-type")
+
+SUCCESS (value: "text/html; charset=UTF-8")
diff --git a/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes.html b/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes.html
new file mode 100644
index 0000000..181565c
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLMetaElement/meta-attributes.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+<meta id="test" name="foo" scheme="bar" http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+You should see 5 lines with "SUCCESS" below:
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function checkExpected(actual, expected)
+{
+ if (actual != expected)
+ document.writeln("<p>FAILURE: expected \"" + expected + "\", actual \"" + actual + "\"</p>");
+ else
+ document.writeln("<p>SUCCESS (value: \"" + actual + "\")</p>");
+}
+
+var metaTag = document.getElementById("test");
+checkExpected(metaTag, "[object HTMLMetaElement]");
+checkExpected(metaTag.name, "foo");
+checkExpected(metaTag.scheme, "bar");
+checkExpected(metaTag.httpEquiv, "content-type");
+checkExpected(metaTag.content, "text/html; charset=UTF-8");
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt b/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt
new file mode 100644
index 0000000..162ed69
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt
@@ -0,0 +1,37 @@
+Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS checkCellNesting("col") is 0
+PASS checkCellNesting("colgroup") is 0
+PASS checkCellNesting("div") is 0
+PASS checkCellNesting("form") is 0
+PASS checkCellNesting("script") is 0
+PASS checkCellNesting("table") is 0
+PASS checkCellNesting("tbody") is 0
+PASS checkCellNesting("tfoot") is 0
+PASS checkCellNesting("thead") is 0
+PASS checkCellNesting("tr") is 0
+
+PASS checkCellNesting("td") is 1
+PASS checkCellNesting("th") is 1
+
+PASS checkHeaderCellNesting("col") is 0
+PASS checkHeaderCellNesting("colgroup") is 0
+PASS checkHeaderCellNesting("div") is 0
+PASS checkHeaderCellNesting("form") is 0
+PASS checkHeaderCellNesting("script") is 0
+PASS checkHeaderCellNesting("table") is 0
+PASS checkHeaderCellNesting("tbody") is 0
+PASS checkHeaderCellNesting("tfoot") is 0
+PASS checkHeaderCellNesting("thead") is 0
+PASS checkHeaderCellNesting("tr") is 0
+
+PASS checkHeaderCellNesting("td") is 1
+PASS checkHeaderCellNesting("th") is 1
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/cells.html b/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
new file mode 100644
index 0000000..9a6a573
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/cells.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt
new file mode 100644
index 0000000..114f982
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt
@@ -0,0 +1,5 @@
+This tests a particular case of insertCell that was crashing on ebay at the time the test was written.
+
+cell inside table inside cell 0 cell inside table inside cell 1
+
+If there was no crash, and you can see text above mentioning cell 1 as well as cell 0, the test passed.
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html
new file mode 100644
index 0000000..04b79a5
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html
@@ -0,0 +1,28 @@
+<html>
+
+<head>
+<script type="text/javascript">
+
+function test()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ var tr = document.getElementById('row');
+ tr.insertCell(0).innerHTML = "<td>cell inside table inside cell 0</td>";
+ tr.insertCell(1).innerHTML = "<td>cell inside table inside cell 1</td>";
+}
+
+</script>
+</head>
+
+<body onload="test()">
+
+<p>This tests a particular case of insertCell that was crashing on ebay at the time the test was written.</p>
+
+<p><table><tr id="row"></tr></table></p>
+
+<p>If there was no crash, and you can see text above mentioning cell 1 as well as cell 0, the test passed.</p>
+
+</body>
+
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js
new file mode 100644
index 0000000..eb8f7c8
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js
@@ -0,0 +1,56 @@
+description('Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting.');
+
+function checkCellNesting(tag)
+{
+ var row = document.createElement("tr");
+ var container = document.createElement(tag);
+ var cell = document.createElement("td");
+ row.appendChild(container);
+ container.appendChild(cell);
+ return row.cells.length;
+}
+
+function checkHeaderCellNesting(tag)
+{
+ var row = document.createElement("tr");
+ var container = document.createElement(tag);
+ var cell = document.createElement("th");
+ row.appendChild(container);
+ container.appendChild(cell);
+ return row.cells.length;
+}
+
+var tags = [
+ "col",
+ "colgroup",
+ "div",
+ "form",
+ "script",
+ "table",
+ "tbody",
+ "tfoot",
+ "thead",
+ "tr",
+];
+
+for (i = 0; i < tags.length; ++i)
+ shouldBe('checkCellNesting("' + tags[i] + '")', '0');
+
+debug('');
+
+shouldBe('checkCellNesting("td")', '1');
+shouldBe('checkCellNesting("th")', '1');
+
+debug('');
+
+for (i = 0; i < tags.length; ++i)
+ shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0');
+
+debug('');
+
+shouldBe('checkHeaderCellNesting("td")', '1');
+shouldBe('checkHeaderCellNesting("th")', '1');
+
+debug('');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLTableSectionElement/rows-expected.txt b/LayoutTests/fast/dom/HTMLTableSectionElement/rows-expected.txt
new file mode 100644
index 0000000..41ce7ab
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableSectionElement/rows-expected.txt
@@ -0,0 +1,24 @@
+Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS checkRowNesting("col") is 0
+PASS checkRowNesting("colgroup") is 0
+PASS checkRowNesting("div") is 0
+PASS checkRowNesting("form") is 0
+PASS checkRowNesting("script") is 0
+PASS checkRowNesting("table") is 0
+PASS checkRowNesting("td") is 0
+PASS checkRowNesting("th") is 0
+
+PASS checkRowNesting("tbody") is 0
+PASS checkRowNesting("tfoot") is 0
+PASS checkRowNesting("thead") is 0
+
+PASS checkRowNesting("tr") is 1
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html b/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html
new file mode 100644
index 0000000..163e235
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/rows.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js b/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js
new file mode 100644
index 0000000..80ac6a3
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js
@@ -0,0 +1,44 @@
+description('Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.');
+
+function checkRowNesting(tag)
+{
+ var body = document.createElement("tbody");
+ var container = document.createElement(tag);
+ var row = document.createElement("tr");
+ body.appendChild(container);
+ container.appendChild(row);
+ return body.rows.length;
+}
+
+var sectionTags = [
+ "tbody",
+ "tfoot",
+ "thead",
+];
+
+var otherTags = [
+ "col",
+ "colgroup",
+ "div",
+ "form",
+ "script",
+ "table",
+ "td",
+ "th",
+];
+
+for (i = 0; i < otherTags.length; ++i)
+ shouldBe('checkRowNesting("' + otherTags[i] + '")', '0');
+
+debug('');
+
+for (i = 0; i < sectionTags.length; ++i)
+ shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0');
+
+debug('');
+
+shouldBe('checkRowNesting("tr")', '1');
+
+debug('');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent-expected.txt b/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent-expected.txt
new file mode 100644
index 0000000..1ccc099
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent-expected.txt
@@ -0,0 +1,10 @@
+This test checks that DOMNodeRemovedEvent is emitted once (and only once).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS count is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html b/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html
new file mode 100644
index 0000000..4b1cd04
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/DOMNodeRemovedEvent.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt b/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt
new file mode 100644
index 0000000..ef7b411
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt
@@ -0,0 +1,5 @@
+Test for a bug 30992: Node.isDefaultNamespace doesn't convert empty strings to null.
+
+Should say PASS:
+
+PASS
diff --git a/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html b/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html
new file mode 100644
index 0000000..da915c1
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html
@@ -0,0 +1,8 @@
+<p>Test for a <href="https://bugs.webkit.org/show_bug.cgi?id=30992">bug 30992</a>: Node.isDefaultNamespace doesn't convert empty strings to null.</p>
+<p>Should say PASS:</p>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+document.write((document.implementation.createDocument(null, 'root', null).isDefaultNamespace('')) ? "PASS" : "FAIL");
+</script>
diff --git a/LayoutTests/fast/dom/Node/fragment-mutation-expected.txt b/LayoutTests/fast/dom/Node/fragment-mutation-expected.txt
new file mode 100644
index 0000000..41e8fa4
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/fragment-mutation-expected.txt
@@ -0,0 +1,17 @@
+This test creates a fragment containing three elements: "B", "U", and "P", attempts to appendChild this fragment and studies effects of mutation events on the fragment.
+
+Inserting an element in front of the next item in fragment should not affect the result: PASS
+Removing next item should not abort iteration: PASS
+Appending an element at the end of the fragment should not affect the result: PASS
+Continually re-appending removed element to the fragment should eventually throw NOT_FOUND_ERR: PASS
+Moving next item to become previous sibling of the re-parentee should not result in stack exhaustion: PASS
+
+This test creates a fragment containing three elements: "B", "U", and "P", attempts to insertBefore this fragment and studies effects of mutation events on the fragment.
+
+Inserting an element in front of the next item in fragment should not affect the result: PASS
+Removing next item should not abort iteration: PASS
+Appending an element at the end of the fragment should not affect the result: PASS
+Continually re-appending removed element to the fragment should eventually throw NOT_FOUND_ERR: PASS
+Moving next item to become previous sibling of the re-parentee should not result in stack exhaustion: PASS
+
+
diff --git a/LayoutTests/fast/dom/Node/fragment-mutation.html b/LayoutTests/fast/dom/Node/fragment-mutation.html
new file mode 100644
index 0000000..037e17b
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/fragment-mutation.html
@@ -0,0 +1,148 @@
+<html>
+<head>
+<title>Fragment Mutation Tests</title>
+<script>
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var log = [];
+
+function logResult(description, outcome)
+{
+ log.push({ description: description, outcome: outcome});
+}
+
+function printLog(methodName)
+{
+ var entries = log.map(function(entry) {
+ return "<li>" + entry.description + ": " + entry.outcome;
+ });
+ document.body.appendChild(document.createElement("p")).innerHTML = "This test creates a fragment containing three elements: \"B\", \"U\", and \"P\", " +
+ " attempts to " + methodName + " this fragment and studies effects of mutation events on the fragment.";
+ document.body.appendChild(document.createElement("ul")).innerHTML = entries.join("\n");
+ document.body.appendChild(document.createElement("br"));
+ log = [];
+}
+
+function produceNodeNameString(nodes)
+{
+ var node = nodes.firstChild;
+ var result = "";
+ while(node) {
+ result += node.nodeName;
+ node = node.nextSibling;
+ }
+ return result;
+}
+
+function expectException(code)
+{
+ return function(stash, exception) {
+ if (!exception)
+ return "FAIL, expected exception with code " + code + ". The resulting fragment was: \"" + produceNodeNameString(stash) + "\".";
+
+ if (code == exception.code)
+ return "PASS";
+ return "FAIL, expected exception code: " + code + ", was: " + exception + ".";
+ }
+}
+
+function expectNodes(nodes)
+{
+ return function(stash, exception) {
+ if (exception)
+ return "FAIL, unexpected exception thrown: " + exception;
+ var result = produceNodeNameString(stash);
+ if (nodes == result)
+ return "PASS";
+ return "FAIL, expected \"" + nodes + "\", was \"" + result + "\".";
+ };
+}
+
+function testFragment(method, description, mutationHandler, expectation, nonStop)
+{
+ var once = 0;
+ var logged = 0;
+ var frag = document.createDocumentFragment();
+ var stash = document.body.appendChild(document.createElement("div"));
+ frag.appendChild(document.createElement("b"));
+ frag.appendChild(document.createElement("u"));
+ frag.appendChild(document.createElement("p"));
+ frag.addEventListener("DOMSubtreeModified", function(evt)
+ {
+ if (!nonStop && once++)
+ return;
+
+ try {
+ mutationHandler(evt, frag, stash);
+ }
+ catch(e) {
+ logResult(description, expectation(stash, e));
+ logged++;
+ }
+ }, false);
+
+ try {
+ method(stash, frag);
+ }
+ catch(e) {
+ logResult(description, expectation(stash, e));
+ logged++;
+ }
+ if (!logged)
+ logResult(description, expectation(stash));
+ document.body.removeChild(stash);
+}
+
+function appendChildMethod(object, subject)
+{
+ object.appendChild(subject);
+}
+
+function insertBeforeMethod(object, subject)
+{
+ object.insertBefore(subject, object.firstChild);
+}
+
+function runTest(methodName, method)
+{
+ var missing = document.body.appendChild(document.createElement("em"));
+ testFragment(method, "Inserting an element in front of the next item in fragment should not affect the result", function(evt, frag)
+ {
+ frag.insertBefore(missing, frag.firstChild);
+ }, expectNodes("BUP"));
+
+ testFragment(method, "Removing next item should not abort iteration", function(evt, frag)
+ {
+ frag.removeChild(frag.firstChild);
+ }, expectNodes("BUP"));
+
+ var extra = document.body.appendChild(document.createElement("em"));
+ testFragment(method, "Appending an element at the end of the fragment should not affect the result", function(evt, frag)
+ {
+ frag.appendChild(extra);
+ }, expectNodes("BUP"));
+
+ testFragment(method, "Continually re-appending removed element to the fragment should eventually throw NOT_FOUND_ERR", function(evt, frag, stash)
+ {
+ stash.insertBefore(frag.lastChild, stash.firstChild);
+ }, expectException(8), true);
+
+ testFragment(method, "Moving next item to become previous sibling of the re-parentee should not result in stack exhaustion", function(evt, frag, stash)
+ {
+ document.body.insertBefore(frag.firstChild, stash);
+ }, expectNodes("BUP"));
+ printLog(methodName);
+}
+function runTests()
+{
+ runTest("appendChild", appendChildMethod);
+ runTest("insertBefore", insertBeforeMethod);
+}
+
+</script>
+</head>
+<body onload="runTests()">
+</body>
+</html> \ No newline at end of file
diff --git a/LayoutTests/fast/dom/Node/initial-values-expected.txt b/LayoutTests/fast/dom/Node/initial-values-expected.txt
new file mode 100644
index 0000000..48d2895
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/initial-values-expected.txt
@@ -0,0 +1,151 @@
+Test creation of each type of Node and check intial values
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Attribute creation using createElement on an HTML doc:
+PASS attr.nodeName is 'foo'
+PASS attr.name is 'foo'
+FAIL attr.localName should be null (of type object). Was foo (of type string).
+PASS attr.namespaceURI is null
+PASS attr.prefix is null
+PASS attr.nodeValue is ''
+PASS attr.value is ''
+PASS attr.attributes is null
+Attribute creation using createElementNS on an HTML doc:
+PASS attr.nodeName is 'example:foo'
+PASS attr.name is 'example:foo'
+PASS attr.localName is 'foo'
+PASS attr.namespaceURI is 'http://www.example.com'
+PASS attr.prefix is 'example'
+PASS attr.nodeValue is ''
+PASS attr.value is ''
+PASS attr.attributes is null
+Attribute creation using createElement on an XHTML doc:
+PASS attr.nodeName is 'foo'
+PASS attr.name is 'foo'
+FAIL attr.localName should be null (of type object). Was foo (of type string).
+PASS attr.namespaceURI is null
+PASS attr.prefix is null
+PASS attr.nodeValue is ''
+PASS attr.value is ''
+PASS attr.attributes is null
+Attribute creation using createElementNS on an XHTML doc:
+PASS attr.nodeName is 'example:foo'
+PASS attr.name is 'example:foo'
+PASS attr.localName is 'foo'
+PASS attr.namespaceURI is 'http://www.example.com'
+PASS attr.prefix is 'example'
+PASS attr.nodeValue is ''
+PASS attr.value is ''
+PASS attr.attributes is null
+PASS comment.nodeName is '#comment'
+PASS comment.localName is null
+PASS comment.namespaceURI is null
+PASS comment.prefix is null
+PASS comment.nodeValue is 'foo'
+PASS comment.data is 'foo'
+PASS comment.attributes is null
+PASS document.createCDATASection('foo') threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS cdata.nodeName is '#cdata-section'
+PASS cdata.localName is null
+PASS cdata.namespaceURI is null
+PASS cdata.prefix is null
+PASS cdata.nodeValue is 'foo'
+PASS cdata.data is 'foo'
+PASS cdata.attributes is null
+PASS fragment.nodeName is '#document-fragment'
+PASS fragment.localName is null
+PASS fragment.namespaceURI is null
+PASS fragment.prefix is null
+PASS fragment.nodeValue is null
+PASS fragment.attributes is null
+PASS doc.nodeName is '#document'
+PASS doc.localName is null
+FAIL doc.namespaceURI should be http://www.w3.org/1999/xhtml (of type string). Was null (of type object).
+PASS doc.prefix is null
+PASS doc.nodeValue is null
+PASS doc.attributes is null
+PASS doctype.nodeName is 'svg'
+PASS doctype.name is 'svg'
+PASS doctype.localName is null
+PASS doctype.namespaceURI is null
+PASS doctype.prefix is null
+PASS doctype.nodeValue is null
+PASS doctype.attributes is null
+Element creation using createElement on an HTML doc:
+PASS element.nodeName is 'PRE'
+FAIL element.localName should be null (of type object). Was pre (of type string).
+FAIL element.namespaceURI should be null (of type object). Was http://www.w3.org/1999/xhtml (of type string).
+PASS element.prefix is null
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+Prefixed element creation using createElementNS on an HTML doc:
+PASS element.nodeName is 'html:pre'
+PASS element.localName is 'pre'
+PASS element.namespaceURI is 'http://www.w3.org/1999/xhtml'
+PASS element.prefix is 'html'
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+SVG Element creation using createElementNS on an HTML doc:
+PASS element.nodeName is 'svg'
+PASS element.localName is 'svg'
+PASS element.namespaceURI is 'http://www.w3.org/2000/svg'
+PASS element.prefix is null
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+Unknown Element creation using createElementNS on an HTML doc:
+PASS element.nodeName is 'foo:svg'
+PASS element.localName is 'svg'
+PASS element.namespaceURI is 'http://www.webkit.org'
+PASS element.prefix is 'foo'
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+Element creation using createElementNS on an HTML doc:
+FAIL element.nodeName should be pre. Was PRE.
+PASS element.localName is 'pre'
+PASS element.namespaceURI is 'http://www.w3.org/1999/xhtml'
+PASS element.prefix is null
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+Element creation using createElement on an XHTML doc:
+PASS element.nodeName is 'pre'
+FAIL element.localName should be null (of type object). Was pre (of type string).
+FAIL element.namespaceURI should be null (of type object). Was http://www.w3.org/1999/xhtml (of type string).
+PASS element.prefix is null
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+Element creation using createElementNS on an XHTML doc:
+PASS element.nodeName is 'html:pre'
+PASS element.localName is 'pre'
+PASS element.namespaceURI is 'http://www.w3.org/1999/xhtml'
+PASS element.prefix is 'html'
+PASS element.nodeValue is null
+PASS element.attributes.toString() is '[object NamedNodeMap]'
+PASS document.createEntityReference('gt') threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS entityReference.nodeName is 'gt'
+PASS entityReference.localName is null
+PASS entityReference.namespaceURI is null
+PASS entityReference.prefix is null
+PASS entityReference.nodeValue is null
+PASS entityReference.attributes is null
+PASS document.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"') threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS processingInstruction.nodeName is 'xml-stylesheet'
+PASS processingInstruction.localName is null
+PASS processingInstruction.namespaceURI is null
+PASS processingInstruction.prefix is null
+PASS processingInstruction.nodeValue is 'type="text/xsl" href="missing.xsl"'
+PASS processingInstruction.attributes is null
+PASS processingInstruction.target is 'xml-stylesheet'
+PASS processingInstruction.data is 'type="text/xsl" href="missing.xsl"'
+PASS text.nodeName is '#text'
+PASS text.localName is null
+PASS text.namespaceURI is null
+PASS text.prefix is null
+PASS text.nodeValue is 'foo'
+PASS text.data is 'foo'
+PASS text.attributes is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/initial-values.html b/LayoutTests/fast/dom/Node/initial-values.html
new file mode 100644
index 0000000..19b634b
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/initial-values.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/initial-values.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/isEqualNode-expected.txt b/LayoutTests/fast/dom/Node/isEqualNode-expected.txt
new file mode 100644
index 0000000..1877d20
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/isEqualNode-expected.txt
@@ -0,0 +1,13 @@
+Test the isEqualNode API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test isEqualNode for DocumentType nodes.
+PASS docTypeAllSet.isEqualNode(docTypeAllSet2) is true
+PASS docTypeAllSet.isEqualNode(docTypeDifferentPublicID) is false
+PASS docTypeAllSet.isEqualNode(docTypeDifferentSystemID) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/isEqualNode.html b/LayoutTests/fast/dom/Node/isEqualNode.html
new file mode 100644
index 0000000..0222e70
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/isEqualNode.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/isEqualNode.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/mutation-blur-expected.txt b/LayoutTests/fast/dom/Node/mutation-blur-expected.txt
new file mode 100644
index 0000000..d33e8bf
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/mutation-blur-expected.txt
@@ -0,0 +1,4 @@
+Tests for proper handling of DOM changes during a blur event. If the test doesn't crash, it passed.
+
+
+
diff --git a/LayoutTests/fast/dom/Node/mutation-blur.html b/LayoutTests/fast/dom/Node/mutation-blur.html
new file mode 100644
index 0000000..173409e
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/mutation-blur.html
@@ -0,0 +1,73 @@
+<html>
+<head>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var container1;
+ var container2;
+ var elem;
+
+ function handler2()
+ {
+ container2.appendChild(elem);
+ }
+
+ function onload()
+ {
+ container1 = document.getElementById("newcontainer1");
+ container2 = document.getElementById("newcontainer2");
+
+ if (!window.eventSender)
+ return;
+
+ var rect = document.getElementById("trigger").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+
+ function onpress()
+ {
+ elem = document.getElementById("subcontainer1");
+ document.getElementById("sub1").focus();
+
+ try {
+ container1.appendChild(elem);
+ container1.removeChild(elem);
+ elem = null;
+ }
+ catch (e) { }
+
+ // Force GC.
+ if (this.GCController)
+ GCController.collect();
+ else {
+ for (var i = 0; i < 10000; ++i) {
+ ({ });
+ }
+ }
+
+ document.body.removeChild(container2);
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+
+ }
+
+</script>
+</head>
+<body onload="onload()">
+<p>Tests for proper handling of DOM changes during a blur event. If the test doesn't crash, it passed.
+<div id="subcontainer1">
+ <textarea id="sub1" onblur="handler2()"></textarea>
+</div>
+
+<input id="trigger" type="button" name="Press" value="press" onclick="onpress()">
+<div id="newcontainer1"></div>
+<div id="newcontainer2"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/normalize-expected.txt b/LayoutTests/fast/dom/Node/normalize-expected.txt
new file mode 100644
index 0000000..31f1ff9
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize-expected.txt
@@ -0,0 +1,12 @@
+Several tests of the DOM normalize() function.
+test1 (two non-empty text nodes): PASSED
+test2 (three non-empty text nodes): PASSED
+test3 (non-empty text nodes mixed with elements): PASSED
+test4 (single empty text node): PASSED
+test5 (empty text node between elements): PASSED
+test6 (empty text nodes before non-empty node): PASSED
+test7 (empty text nodes after non-empty node): PASSED
+test8 (empty text nodes between non-empty nodes): PASSED
+test9 (empty and non-empty text nodes mixed with elements): PASSED
+test10 (mixed cases including deeper nested text nodes): PASSED
+
diff --git a/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt b/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt
new file mode 100644
index 0000000..f8291ef
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt
@@ -0,0 +1,15 @@
+Test of normalize on an XML document with CDATA.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Before normalize
+PASS serializer.serializeToString(xmlChunk) is "<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"
+PASS xmlChunk.documentElement.childNodes.length is 3
+After normalize
+PASS serializer.serializeToString(xmlChunk) is "<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"
+PASS xmlChunk.documentElement.childNodes.length is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/normalize-with-cdata.html b/LayoutTests/fast/dom/Node/normalize-with-cdata.html
new file mode 100644
index 0000000..a74ec70
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize-with-cdata.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/normalize-with-cdata.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/normalize.html b/LayoutTests/fast/dom/Node/normalize.html
new file mode 100644
index 0000000..a8b61cb
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize.html
@@ -0,0 +1,213 @@
+<html>
+
+<head>
+
+<title>Test of DOM Node.normalize()</title>
+
+<script>
+
+function logLine(message)
+{
+ var console = document.getElementById("console");
+ console.appendChild(document.createTextNode(message));
+ console.appendChild(document.createElement('br'));
+}
+
+function log(message)
+{
+ var console = document.getElementById("console");
+ console.appendChild(document.createTextNode(message));
+}
+
+
+function prepare_test1(testDiv)
+{
+ testDiv.firstChild.splitText(4);
+ return testDiv.childNodes.length == 2;
+}
+function check_test1(testDiv)
+{
+ return testDiv.childNodes.length == 1;
+}
+
+function prepare_test2(testDiv)
+{
+ testDiv.firstChild.splitText(9);
+ testDiv.firstChild.splitText(4);
+ return testDiv.childNodes.length == 3;
+}
+function check_test2(testDiv)
+{
+ return testDiv.childNodes.length == 1;
+}
+
+function prepare_test3(testDiv)
+{
+ testDiv.childNodes[1].splitText(4);
+ testDiv.childNodes[4].splitText(3);
+ return testDiv.childNodes.length == 6;
+}
+function check_test3(testDiv)
+{
+ return testDiv.childNodes.length == 4;
+}
+
+function prepare_test4(testDiv)
+{
+ testDiv.childNodes[0].data = "";
+ return testDiv.childNodes.length == 1;
+}
+function check_test4(testDiv)
+{
+ return testDiv.childNodes.length == 0;
+}
+
+function prepare_test5(testDiv)
+{
+ testDiv.childNodes[1].data = "";
+ return testDiv.childNodes.length == 3;
+}
+function check_test5(testDiv)
+{
+ return testDiv.childNodes.length == 2;
+}
+
+function prepare_test6(testDiv)
+{
+ testDiv.childNodes[0].splitText(0);
+ testDiv.childNodes[0].splitText(0);
+ return testDiv.childNodes.length == 3;
+}
+function check_test6(testDiv)
+{
+ return testDiv.childNodes.length == 1;
+}
+
+function prepare_test7(testDiv)
+{
+ testDiv.childNodes[0].splitText(4);
+ testDiv.childNodes[0].splitText(4);
+ testDiv.childNodes[0].splitText(4);
+ return testDiv.childNodes.length == 4;
+}
+function check_test7(testDiv)
+{
+ return testDiv.childNodes.length == 1;
+}
+
+function prepare_test8(testDiv)
+{
+ testDiv.childNodes[0].splitText(4);
+ testDiv.childNodes[0].splitText(4);
+ return testDiv.childNodes.length == 3;
+}
+function check_test8(testDiv)
+{
+ return testDiv.childNodes.length == 1;
+}
+
+function prepare_test9(testDiv)
+{
+ testDiv.childNodes[1].splitText(4);
+ testDiv.childNodes[1].splitText(0); // empty text node before other text nodes
+ testDiv.childNodes[5].splitText(3);
+ testDiv.childNodes[5].splitText(3); // empty text node between other text nodes
+ testDiv.childNodes[7].splitText(2); // empty text node after other text nodes
+ return testDiv.childNodes.length == 9;
+}
+function check_test9(testDiv)
+{
+ return testDiv.childNodes.length == 4;
+}
+
+function prepare_test10(testDiv)
+{
+ testDiv.childNodes[0].childNodes[0].splitText(2);
+ testDiv.childNodes[1].splitText(4);
+ testDiv.childNodes[3].childNodes[0].data = ""; // empty first text node of the second bold node
+ testDiv.childNodes[3].childNodes[1].childNodes[0].data = ""; // empty text node of the italic node
+ testDiv.childNodes[4].splitText(1);
+ return testDiv.childNodes.length == 6;
+}
+function check_test10(testDiv)
+{
+ return testDiv.childNodes.length == 4
+ && testDiv.childNodes[0].childNodes.length == 1 // first bold node must have single text node child
+ && testDiv.childNodes[2].childNodes.length == 1 // first bold node must have single italic node child
+ && testDiv.childNodes[2].childNodes[0].childNodes.length == 0; // italic node must be empty
+}
+
+function runTest(testDiv, testName)
+{
+ if (self["prepare_"+testName](testDiv)) {
+ var oldHTML = testDiv.innerHTML;
+ testDiv.normalize();
+ if (testDiv.innerHTML != oldHTML) {
+ log("FAILED: innerHTML changed from \"" + oldHTML + "\" to \"" + testDiv.innerHTML + "\"");
+ } else {
+ if (self["check_"+testName](testDiv))
+ log("PASSED");
+ else
+ log("FAILED");
+ }
+ } else {
+ log("FAILED in test preparation");
+ }
+}
+
+function runTests()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ try {
+ var tests = document.getElementById("tests").childNodes;
+ for (i = 0; i < tests.length; i++) {
+ var testDiv = tests[i];
+ // Skip formatting text nodes
+ if (testDiv.nodeType == Node.ELEMENT_NODE) {
+ var testName = testDiv.getAttribute("name");
+
+ log(testName + " (" + testDiv.getAttribute("description") + "): ");
+
+ try {
+ runTest(testDiv, testName);
+ } catch(e) {
+ log("FAILED with exception: " + e);
+ }
+
+ logLine("")
+ }
+ }
+
+ } catch(e) {
+ logLine("FAILED, exception thrown during tests: " + e);
+ }
+}
+
+</script>
+
+</head>
+
+<body onload="runTests()">
+
+<div id="description">Several tests of the DOM normalize() function.</div>
+
+<div id="tests" style="display:none">
+ <div name="test1" description="two non-empty text nodes">some text</div>
+ <div name="test2" description="three non-empty text nodes">some more text</div>
+ <div name="test3" description="non-empty text nodes mixed with elements"><b></b>some more<b></b> text</div>
+ <div name="test4" description="single empty text node">text</div>
+ <div name="test5" description="empty text node between elements"><b></b>text<i></i></div>
+ <div name="test6" description="empty text nodes before non-empty node">text</div>
+ <div name="test7" description="empty text nodes after non-empty node">text</div>
+ <div name="test8" description="empty text nodes between non-empty nodes">some text</div>
+ <div name="test9" description="empty and non-empty text nodes mixed with elements"><b></b>some more<b></b> text</div>
+ <div name="test10" description="mixed cases including deeper nested text nodes"><b>text</b>text <b>text<i>text</i></b> text</div>
+</div>
+
+<div id="console"></div>
+
+</body>
+
+</html>
diff --git a/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js b/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js
new file mode 100644
index 0000000..a149c1d
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js
@@ -0,0 +1,12 @@
+description("This test checks that DOMNodeRemovedEvent is emitted once (and only once).");
+
+var div = document.createElement("div");
+document.body.appendChild(div);
+
+var count = 0;
+document.body.addEventListener("DOMNodeRemoved", function () { count++; }, false);
+document.body.removeChild(div);
+
+shouldBe("count", "1");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/script-tests/initial-values.js b/LayoutTests/fast/dom/Node/script-tests/initial-values.js
new file mode 100644
index 0000000..4dfc376
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/initial-values.js
@@ -0,0 +1,205 @@
+description("Test creation of each type of Node and check intial values")
+
+var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
+
+debug("Attribute creation using createElement on an HTML doc:")
+var attr = document.createAttribute("foo");
+shouldBe("attr.nodeName", "'foo'");
+shouldBe("attr.name", "'foo'");
+// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute
+// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null
+shouldBe("attr.localName", "null");
+shouldBe("attr.namespaceURI", "null");
+shouldBe("attr.prefix", "null");
+shouldBe("attr.nodeValue", "''");
+shouldBe("attr.value", "''");
+shouldBe("attr.attributes", "null");
+
+debug("Attribute creation using createElementNS on an HTML doc:")
+attr = document.createAttributeNS("http://www.example.com", "example:foo");
+shouldBe("attr.nodeName", "'example:foo'");
+shouldBe("attr.name", "'example:foo'");
+shouldBe("attr.localName", "'foo'");
+shouldBe("attr.namespaceURI", "'http://www.example.com'");
+shouldBe("attr.prefix", "'example'");
+shouldBe("attr.nodeValue", "''");
+shouldBe("attr.value", "''");
+shouldBe("attr.attributes", "null");
+
+debug("Attribute creation using createElement on an XHTML doc:")
+attr = xmlDoc.createAttribute("foo");
+shouldBe("attr.nodeName", "'foo'");
+shouldBe("attr.name", "'foo'");
+// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute
+// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null
+shouldBe("attr.localName", "null");
+shouldBe("attr.namespaceURI", "null");
+shouldBe("attr.prefix", "null");
+shouldBe("attr.nodeValue", "''");
+shouldBe("attr.value", "''");
+shouldBe("attr.attributes", "null");
+
+debug("Attribute creation using createElementNS on an XHTML doc:")
+attr = xmlDoc.createAttributeNS("http://www.example.com", "example:foo");
+shouldBe("attr.nodeName", "'example:foo'");
+shouldBe("attr.name", "'example:foo'");
+shouldBe("attr.localName", "'foo'");
+shouldBe("attr.namespaceURI", "'http://www.example.com'");
+shouldBe("attr.prefix", "'example'");
+shouldBe("attr.nodeValue", "''");
+shouldBe("attr.value", "''");
+shouldBe("attr.attributes", "null");
+
+var comment = document.createComment("foo");
+shouldBe("comment.nodeName", "'#comment'");
+shouldBe("comment.localName", "null");
+shouldBe("comment.namespaceURI", "null");
+shouldBe("comment.prefix", "null");
+shouldBe("comment.nodeValue", "'foo'");
+shouldBe("comment.data", "'foo'");
+shouldBe("comment.attributes", "null");
+
+shouldThrow("document.createCDATASection('foo')");
+var cdata = xmlDoc.createCDATASection("foo");
+shouldBe("cdata.nodeName", "'#cdata-section'");
+shouldBe("cdata.localName", "null");
+shouldBe("cdata.namespaceURI", "null");
+shouldBe("cdata.prefix", "null");
+shouldBe("cdata.nodeValue", "'foo'");
+shouldBe("cdata.data", "'foo'");
+shouldBe("cdata.attributes", "null");
+
+var fragment = document.createDocumentFragment();
+shouldBe("fragment.nodeName", "'#document-fragment'");
+shouldBe("fragment.localName", "null");
+shouldBe("fragment.namespaceURI", "null");
+shouldBe("fragment.prefix", "null");
+shouldBe("fragment.nodeValue", "null");
+shouldBe("fragment.attributes", "null");
+
+var doc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
+shouldBe("doc.nodeName", "'#document'");
+shouldBe("doc.localName", "null");
+// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument
+// Currently both FF and WebKit return null here, disagreeing with the spec
+shouldBe("doc.namespaceURI", "'http://www.w3.org/1999/xhtml'");
+shouldBe("doc.prefix", "null");
+shouldBe("doc.nodeValue", "null");
+shouldBe("doc.attributes", "null");
+
+var doctype = document.implementation.createDocumentType("svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd");
+shouldBe("doctype.nodeName", "'svg'");
+shouldBe("doctype.name", "'svg'");
+shouldBe("doctype.localName", "null");
+shouldBe("doctype.namespaceURI", "null");
+shouldBe("doctype.prefix", "null");
+shouldBe("doctype.nodeValue", "null");
+shouldBe("doctype.attributes", "null");
+
+debug("Element creation using createElement on an HTML doc:")
+var element = document.createElement("pre");
+shouldBe("element.nodeName", "'PRE'");
+// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createElement
+// FF returns "PRE" for localName, WebKit returns "pre", the spec says we should return null
+shouldBe("element.localName", "null");
+// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null
+shouldBe("element.namespaceURI", "null");
+shouldBe("element.prefix", "null");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("Prefixed element creation using createElementNS on an HTML doc:")
+element = document.createElementNS("http://www.w3.org/1999/xhtml", "html:pre");
+shouldBe("element.nodeName", "'html:pre'");
+shouldBe("element.localName", "'pre'");
+shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'");
+shouldBe("element.prefix", "'html'");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("SVG Element creation using createElementNS on an HTML doc:")
+element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+shouldBe("element.nodeName", "'svg'");
+shouldBe("element.localName", "'svg'");
+shouldBe("element.namespaceURI", "'http://www.w3.org/2000/svg'");
+shouldBe("element.prefix", "null");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("Unknown Element creation using createElementNS on an HTML doc:")
+element = document.createElementNS("http://www.webkit.org", "foo:svg");
+shouldBe("element.nodeName", "'foo:svg'");
+shouldBe("element.localName", "'svg'");
+shouldBe("element.namespaceURI", "'http://www.webkit.org'");
+shouldBe("element.prefix", "'foo'");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("Element creation using createElementNS on an HTML doc:")
+element = document.createElementNS("http://www.w3.org/1999/xhtml", "pre");
+// Spec: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-104682815 (element.tagName)
+// FF and Opera returns "pre" for nodeName as it is an XHTML element, WebKit returns "PRE".
+shouldBe("element.nodeName", "'pre'");
+shouldBe("element.localName", "'pre'");
+shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'");
+shouldBe("element.prefix", "null");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("Element creation using createElement on an XHTML doc:")
+element = xmlDoc.createElement("pre");
+shouldBe("element.nodeName", "'pre'");
+shouldBe("element.localName", "null");
+// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null
+shouldBe("element.namespaceURI", "null");
+shouldBe("element.prefix", "null");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+debug("Element creation using createElementNS on an XHTML doc:")
+element = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "html:pre");
+shouldBe("element.nodeName", "'html:pre'");
+shouldBe("element.localName", "'pre'");
+shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'");
+shouldBe("element.prefix", "'html'");
+shouldBe("element.nodeValue", "null");
+shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'");
+
+// Not possible to create Entity nodes via the DOM, WebKit doesn't create them from parsing
+
+shouldThrow("document.createEntityReference('gt')");
+var entityReference = xmlDoc.createEntityReference("gt");
+shouldBe("entityReference.nodeName", "'gt'");
+shouldBe("entityReference.localName", "null");
+shouldBe("entityReference.namespaceURI", "null");
+shouldBe("entityReference.prefix", "null");
+shouldBe("entityReference.nodeValue", "null");
+shouldBe("entityReference.attributes", "null");
+
+// Not possible to create Notation nodes via the DOM, WebKit doesn't create them from parsing
+
+shouldThrow("document.createProcessingInstruction('xml-stylesheet', 'type=\"text/xsl\" href=\"missing.xsl\"')");
+var processingInstruction = xmlDoc.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"');
+shouldBe("processingInstruction.nodeName", "'xml-stylesheet'");
+shouldBe("processingInstruction.localName", "null");
+shouldBe("processingInstruction.namespaceURI", "null");
+shouldBe("processingInstruction.prefix", "null");
+// DOM Core Level 2 and DOM Core Level 3 disagree on ProcessingInstruction.nodeValue
+// L2: entire content excluding the target
+// L3: same as ProcessingInstruction.data
+// We're following Level 3
+shouldBe("processingInstruction.nodeValue", "'type=\"text/xsl\" href=\"missing.xsl\"'");
+shouldBe("processingInstruction.attributes", "null");
+shouldBe("processingInstruction.target", "'xml-stylesheet'");
+shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'");
+
+var text = document.createTextNode("foo");
+shouldBe("text.nodeName", "'#text'");
+shouldBe("text.localName", "null");
+shouldBe("text.namespaceURI", "null");
+shouldBe("text.prefix", "null");
+shouldBe("text.nodeValue", "'foo'");
+shouldBe("text.data", "'foo'");
+shouldBe("text.attributes", "null");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js b/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js
new file mode 100644
index 0000000..c56199b
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js
@@ -0,0 +1,13 @@
+description("Test the isEqualNode API.");
+
+debug("Test isEqualNode for DocumentType nodes.");
+var docTypeAllSet = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
+var docTypeAllSet2 = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
+var docTypeDifferentPublicID = document.implementation.createDocumentType('html', 'foo', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
+var docTypeDifferentSystemID = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'bar');
+
+shouldBeTrue("docTypeAllSet.isEqualNode(docTypeAllSet2)");
+shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentPublicID)");
+shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentSystemID)");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
new file mode 100644
index 0000000..d1e3efe
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
@@ -0,0 +1,22 @@
+description('Test of normalize on an XML document with CDATA.');
+
+var parser = new DOMParser();
+var serializer = new XMLSerializer();
+
+var xmlChunk = parser.parseFromString(
+ '<foo>' +
+ 'This is some text before the CDATA' +
+ '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' +
+ 'This is some text after the CDATA' +
+ '</foo>',
+ 'application/xml');
+
+debug('Before normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+xmlChunk.documentElement.normalize();
+debug('After normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt
new file mode 100644
index 0000000..c5b8ca4
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt
@@ -0,0 +1,3 @@
+Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.
+
+
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1.html b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1.html
new file mode 100644
index 0000000..19d08d7
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1.html
@@ -0,0 +1,25 @@
+<p>Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.</p>
+
+<span>
+ <div name='test'></div>
+</span>
+<script type='text/javascript'>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function triggerGarbageCollection()
+ {
+ if (window.GCController) {
+ GCController.collect();
+ return;
+ }
+ for (var i = 0; i < 10000; ++i)
+ ({})
+ }
+
+ document.getElementsByName('test')[0];
+ triggerGarbageCollection();
+ document.getElementsByTagName('span')[0].innerHTML = '';
+ triggerGarbageCollection();
+ document.getElementsByName('test')[0];
+</script>
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2-expected.txt b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2-expected.txt
new file mode 100644
index 0000000..38de29a
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2-expected.txt
@@ -0,0 +1,3 @@
+Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.
+
+paragraph b
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2.html b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2.html
new file mode 100644
index 0000000..147b2df
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-2.html
@@ -0,0 +1,42 @@
+<p>Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.</p>
+
+<p id="a">paragraph a</p>
+<p id="b">paragraph b</p>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function triggerGarbageCollection()
+{
+ if (window.GCController) {
+ GCController.collect();
+ return;
+ }
+ for (var i = 0; i < 10000; ++i)
+ ({})
+}
+
+function setUp()
+{
+ // This only works if in a function. I'm not sure why.
+
+ // Get node and length from paragraph A into the cache.
+ document.getElementById("a").childNodes[0];
+ document.getElementById("a").childNodes.length;
+}
+
+setUp();
+
+// Get back to "zero node lists".
+triggerGarbageCollection();
+
+// Remove the child node of paragraph A. Use innerHTML to avoid getting a reference to the node being removed.
+document.getElementById("a").innerHTML = "";
+
+// Get back to "one node list".
+var childNodesB = document.getElementById("b").childNodes;
+
+// Now try the original list.
+var x = document.getElementById("a").childNodes[0];
+x = document.getElementById("a").childNodes.length;
+</script>
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt
new file mode 100644
index 0000000..c5b8ca4
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt
@@ -0,0 +1,3 @@
+Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.
+
+
diff --git a/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3.html b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3.html
new file mode 100644
index 0000000..e3b8d61
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3.html
@@ -0,0 +1,18 @@
+<p>Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.</p>
+
+<p id="a"><a name="anchor">paragraph a</a></p>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var list = document.getElementsByName("anchor");
+var x = list.length
+x = list[0];
+
+// Remove the child node of paragraph A. Use innerHTML to avoid getting a reference to the node being removed.
+document.getElementById("a").innerHTML = "";
+
+// Now try the original list.
+x = list.length;
+x = list[0];
+</script>
diff --git a/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
new file mode 100644
index 0000000..5818178
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
@@ -0,0 +1,2 @@
+
+TEST PASSED - Unless an assertion or crash happens soon.
diff --git a/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html
new file mode 100644
index 0000000..376adb4
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html
@@ -0,0 +1,56 @@
+<head>
+<script>
+
+var pageHasLoaded = false;
+var frameHasLoaded = false;
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++)
+ var s = new String("");
+}
+
+function pageLoaded()
+{
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+ pageHasLoaded = true;
+ if (pageHasLoaded && frameHasLoaded)
+ runTest();
+}
+
+function frameLoaded()
+{
+ frameHasLoaded = true;
+ if (pageHasLoaded && frameHasLoaded)
+ runTest();
+}
+
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var frame = document.getElementById("frame");
+ frame.setAttribute("onload", "frameLoadedAgain()");
+ frame.setAttribute("src", "about:blank");
+}
+
+function frameLoadedAgain()
+{
+ gc();
+ document.getElementById("result").firstChild.data = "TEST PASSED - Unless an assertion or crash happens soon.";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+</script>
+</head>
+<body onload="pageLoaded()">
+<iframe id="frame" src="resources/adoptNode-node-list-cache-subframe.html" onload="frameLoaded()"></iframe>
+<div id="result">TEST DID NOT RUN YET</div>
+</body>
diff --git a/LayoutTests/fast/dom/NodeList/childNodes-reset-cache-expected.txt b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache-expected.txt
new file mode 100644
index 0000000..df04fba
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache-expected.txt
@@ -0,0 +1,3 @@
+Test for bug 13514: REGRESSION (r20997-21003): Crash in WebCore::Node::Document.
+
+SUCCESS
diff --git a/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html
new file mode 100644
index 0000000..de47e39
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/childNodes-reset-cache.html
@@ -0,0 +1,36 @@
+<html>
+<body>
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=13514">bug 13514</a>:
+REGRESSION (r20997-21003): Crash in WebCore::Node::Document.</p>
+<div id="elem"><p></p></div>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
+ var s = new String("");
+ }
+}
+
+elem = document.getElementById('elem');
+
+elem.childNodes.length;
+elem.childNodes[0].length;
+gc();
+elem.innerHTML = "";
+gc();
+elem.childNodes[0];
+if (elem.childNodes.length == 0)
+ document.write("SUCCESS");
+else
+ document.write("FAILURE: childNodes.length was cached inappropriately");
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt b/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt
new file mode 100644
index 0000000..f1c8c04
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt
@@ -0,0 +1,10 @@
+This test checks to see if the DOM ContainerNode's NodeList cache is correctly invalidated when new content is parsed.
+
+If the test passes, you should see "before: not found", "after: found" and "onload: found".
+
+If the cache is not invalidated when the testElement is parsed, both before and after will be "not found", which is a failure.
+
+before: not found
+after: found
+onload: found
+
diff --git a/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing.html b/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing.html
new file mode 100644
index 0000000..c4397dd
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>5360748</title>
+
+ <script type="text/javascript">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function print(message)
+ {
+ var paragraph = document.createElement("li");
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(paragraph);
+ }
+
+ function runTest() {
+ result3 = testForElement("onload", "testElement2"); // expect to see "testElement2"
+
+ // don't show the results until the tests are finished -- it changes the DOM and could affect the tests
+ print(result1);
+ print(result2);
+ print(result3);
+ }
+ function testForElement(testName, elementId) {
+ var found = containsElementWithId(document.body, elementId);
+ if (window.GCController)
+ GCController.collect();
+ else {
+ // create lots of objects to force a garbage collection
+ var i = 0;
+ var s;
+ while (i < 5000) {
+ i = i+1.11;
+ s = s + " ";
+ }
+ }
+
+ return testName + ": " + (found ? "found" : "not found");
+ }
+ function containsElementWithId(el, id) {
+ var found = false;
+
+ if (el.id == id) {
+ found = true;
+ } else {
+ var children = el.childNodes;
+ for (var i=0; !found && i < children.length; i++)
+ found = containsElementWithId(children[i], id);
+ }
+
+ return found;
+ }
+ </script>
+ </head>
+ <body onload="runTest()">
+
+ <p>This test checks to see if the DOM ContainerNode's NodeList cache is correctly invalidated when new content is parsed.</p>
+ <p>If the test passes, you should see &quot;before: not found&quot;, &quot;after: found&quot; and &quot;onload: found&quot;.</p>
+ <p>If the cache is not invalidated when the testElement is parsed, both before and after will be &quot;not found&quot;, which is a failure.</p>
+ <hr>
+ <p><ol id=console></ol></p>
+
+ <script type="text/javascript">
+ result1 = testForElement("before", "testElement"); // expect not to see "testElement"
+ </script>
+
+ <p id="testElement"></p>
+
+ <script type="text/javascript">
+ result2 = testForElement("after", "testElement"); // expect to see "testElement"
+ </script>
+
+ <p id="testElement2"></p>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document-expected.txt b/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document-expected.txt
new file mode 100644
index 0000000..195a88f
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document-expected.txt
@@ -0,0 +1 @@
+SUCCESS (you didn't crash)
diff --git a/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document.html b/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document.html
new file mode 100644
index 0000000..3b272af
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/item-by-id-with-no-document.html
@@ -0,0 +1,13 @@
+<title>Test case for Radar 4411663</title>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+var para = document.createElement("p");
+for (var x = 0; x < 1000; x++) {
+ var newNode = document.createTextNode("asdf " + x);
+ para.appendChild(newNode);
+}
+var list = para.childNodes;
+var bar = list["bar"];
+</script>
+<p>SUCCESS (you didn't crash)</p> \ No newline at end of file
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt b/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt
new file mode 100644
index 0000000..814b456
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt
@@ -0,0 +1,23 @@
+This tests that indexed assignments to items of a NodeList do not override original values. See http://code.google.com/p/chromium/issues/detail?id=27967
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS first == null is false
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS nodeList[0] is first
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-assignment.html b/LayoutTests/fast/dom/NodeList/nodelist-item-assignment.html
new file mode 100644
index 0000000..5a5b971
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-assignment.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<ol></ol>
+
+<div id="console"></div>
+
+<script>
+description(
+ 'This tests that indexed assignments to items of a NodeList do not override original values. ' +
+ 'See http://code.google.com/p/chromium/issues/detail?id=27967');
+
+var nodeList = document.getElementsByTagName('ol');
+var first = nodeList[0];
+shouldBeFalse("first == null");
+
+nodeList[0] = null;
+for (var i = 0; i < 13; i++) {
+ shouldBe("nodeList[0]", "first");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt b/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt
new file mode 100644
index 0000000..96549e8
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt
@@ -0,0 +1,12 @@
+This tests that items in a NodeList can be retrieved directly by calling as a function with an integral index parameter, starting from 0.
+It means NodeList[0] and NodeList(0) both work.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS nodeList[0] is nodeList(0)
+PASS !nodeList[nodeList.length] is !nodeList(nodeList.length)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html b/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html
new file mode 100644
index 0000000..ae1cf36
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/nodelist-item-call-as-function.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt b/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt
new file mode 100644
index 0000000..1c4040d
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt
@@ -0,0 +1,18 @@
+This tests that items in a NodeList can be retrieved by index.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+text1
+text2
+
+PASS div0 == div0s is true
+PASS div0 == div0s_ is false
+PASS div0 == div1 is false
+PASS div0s == div0s_ is false
+PASS div0s == div1 is false
+PASS div0s_ == div1 is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-with-index.html b/LayoutTests/fast/dom/NodeList/nodelist-item-with-index.html
new file mode 100644
index 0000000..369e021
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-with-index.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id='div1'>text1</div>
+<div id='div2'>text2</div><br>
+
+<div id="console"></div>
+
+<script>
+description('This tests that items in a NodeList can be retrieved by index.');
+
+var nodeList = document.getElementsByTagName('div');
+var div0 = nodeList[0];
+var div0s = nodeList["0"];
+var div0s_ = nodeList["0 "];
+var div1 = nodeList["1"];
+
+// Getting properties 0 and "0" should get the same thing, but getting
+// properties "0 " and 1 should get different items. "0 " should not
+// be converted to 0, so should be undefined, and the item at index
+// 1 should be defined (since there are at least two divs on the page),
+// but should be a different div to the one at index 0.
+shouldBeTrue("div0 == div0s");
+shouldBeFalse("div0 == div0s_");
+shouldBeFalse("div0 == div1");
+shouldBeFalse("div0s == div0s_");
+shouldBeFalse("div0s == div1");
+shouldBeFalse("div0s_ == div1");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt b/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt
new file mode 100644
index 0000000..32ff0a7
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt
@@ -0,0 +1,16 @@
+This tests that items in a NodeList can be retrieved directly by name.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+text1
+text2
+
+PASS div1 instanceof HTMLDivElement is true
+PASS div2 instanceof HTMLDivElement is true
+PASS div1.innerHTML is 'text1'
+PASS div2.innerHTML is 'text2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/NodeList/nodelist-item-with-name.html b/LayoutTests/fast/dom/NodeList/nodelist-item-with-name.html
new file mode 100644
index 0000000..a96b51c
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/nodelist-item-with-name.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id='div1'>text1</div>
+<div id='div2'>text2</div><br>
+
+<div id="console"></div>
+
+<script>
+description('This tests that items in a NodeList can be retrieved directly by name.');
+
+var NodeList = document.getElementsByTagName('div');
+var div1 = NodeList.div1;
+var div2 = NodeList.div2;
+
+shouldBeTrue("div1 instanceof HTMLDivElement");
+shouldBeTrue("div2 instanceof HTMLDivElement");
+// Also check that the correct divs were retrieved.
+shouldBe("div1.innerHTML", "'text1'");
+shouldBe("div2.innerHTML", "'text2'");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html b/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html
new file mode 100644
index 0000000..46d3447
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html
@@ -0,0 +1,12 @@
+<script>
+var doc = document.implementation.createHTMLDocument('a');
+var b = document.createElement('b');
+// Give it a node list cache on document
+b.childNodes;
+
+// Attach it to doc to update m_document
+doc.adoptNode(b);
+doc.body.appendChild(b);
+doc.body.removeChild(b);
+</script>
+<p>Close the document to see if there's an assertion failure.</p> \ No newline at end of file
diff --git a/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js b/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js
new file mode 100644
index 0000000..a12a2c9
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js
@@ -0,0 +1,8 @@
+description('This tests that items in a NodeList can be retrieved directly by calling as a function with an integral index parameter, starting from 0.<br>It means NodeList[0] and NodeList(0) both work.');
+
+var nodeList = document.getElementsByTagName('div');
+shouldBe("nodeList[0]", "nodeList(0)");
+shouldBe("!nodeList[nodeList.length]", "!nodeList(nodeList.length)");
+
+var successfullyParsed = true;
+
diff --git a/LayoutTests/fast/dom/Selection/getRangeAt-expected.txt b/LayoutTests/fast/dom/Selection/getRangeAt-expected.txt
new file mode 100644
index 0000000..909034f
--- /dev/null
+++ b/LayoutTests/fast/dom/Selection/getRangeAt-expected.txt
@@ -0,0 +1,10 @@
+Test to make sure that getRangeAt does not modify the range when returning it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS range is correctly (text, 0)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Selection/getRangeAt.html b/LayoutTests/fast/dom/Selection/getRangeAt.html
new file mode 100644
index 0000000..a4037a9
--- /dev/null
+++ b/LayoutTests/fast/dom/Selection/getRangeAt.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/getRangeAt.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js b/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js
new file mode 100644
index 0000000..e024a03
--- /dev/null
+++ b/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js
@@ -0,0 +1,33 @@
+description("Test to make sure that getRangeAt does not modify the range when returning it.")
+
+var div = document.createElement('div');
+document.body.appendChild(div);
+var textNode = document.createTextNode("asd");
+div.appendChild(textNode);
+
+var sel = window.getSelection();
+sel.collapse(textNode, 0);
+var range = sel.getRangeAt(0);
+
+var result = range.comparePoint(textNode, 0);
+if (result == 0) {
+ testPassed("range is correctly (text, 0)");
+} else {
+ testFailed("range did not match (text, 0)");
+ debug("window.getSelection():");
+ debug("anchorNode: " + sel.anchorNode);
+ debug("anchorOffset: " + sel.anchorOffset);
+ debug("focusNode: " + sel.focusNode);
+ debug("focusOffset: " + sel.focusOffset);
+
+ debug("window.getSelection().getRangeAt(0):");
+ debug("startContainer: " + range.startContainer);
+ debug("startOffset: " + range.startOffset);
+ debug("endContainer: " + range.endContainer);
+ debug("endOffset: " + range.endOffset);
+}
+
+// Clean up after ourselves
+document.body.removeChild(div);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt b/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
new file mode 100644
index 0000000..1468f1b
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
@@ -0,0 +1,14 @@
+This tests indexing outside the range of the media list object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaList.length is 2
+PASS mediaList[0] is "screen"
+PASS mediaList[1] is "print"
+PASS mediaList[2] is null
+PASS mediaList[-1] is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html b/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html
new file mode 100644
index 0000000..4d0c598
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/css-medialist-item.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt b/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt
new file mode 100644
index 0000000..31fb4c8
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt
@@ -0,0 +1,10 @@
+This test verifies that a StyleSheet object will be returned instead of a HTMLStyleElement when calling document.styleSheets named property getter.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.styleSheets["test"] is styleElement.sheet
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html b/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html
new file mode 100644
index 0000000..ed23080
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/get-stylesheet-byname.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2-expected.txt b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2-expected.txt
new file mode 100644
index 0000000..5e51726
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2-expected.txt
@@ -0,0 +1,3 @@
+This test verifies that style sheet do not outlive their elements. Since you can get back to the element with the ownerNode attribute, it's important to keep the element alive.
+
+Test passed.
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html
new file mode 100644
index 0000000..ca6fa16
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html
@@ -0,0 +1,37 @@
+<html>
+<link rel="stylesheet" type="text/css" href="theme.css"/>
+
+<script>
+function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var linkElement = document.getElementsByTagName('link')[0];
+ var styleSheet = linkElement.sheet;
+
+ // delete link element
+ linkElement.parentNode.removeChild(linkElement);
+ linkElement = null;
+
+ if (window.gc) {
+ window.gc();
+ } else if (GCController) {
+ GCController.collect();
+ } else {
+ for (var i = 0; i < 10000; i++)
+ new Object();
+ }
+ styleSheet.ownerNode.cloneNode();
+
+ document.getElementById("result").innerHTML = "Test passed.";
+}
+</script>
+<body onload="runTest()">
+<p>
+This test verifies that style sheet do not outlive their elements.
+Since you can get back to the element with the ownerNode attribute,
+it's important to keep the element alive.
+</p>
+<p id="result">TEST HAS NOT RUN YET.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-expected.txt b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-expected.txt
new file mode 100644
index 0000000..d92e2d7
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-expected.txt
@@ -0,0 +1,3 @@
+This test verifies that style sheets do not outlive their elements. Since you can get back to the element with the ownerNode attribute, it's important to keep the element alive.
+
+Test passed.
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html
new file mode 100644
index 0000000..54b1ac4
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html
@@ -0,0 +1,33 @@
+<head>
+<script>
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var styleElement = document.createElement('style');
+ var styleSheet = styleElement.sheet;
+ styleElement = null;
+
+ // create lots of objects to force a garbage collection
+ var i = 0;
+ var s;
+ while (i < 5000) {
+ i = i+1.11;
+ s = s + " ";
+ }
+
+ styleSheet.ownerNode.cloneNode();
+
+ document.getElementById("result").innerHTML = "Test passed.";
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+This test verifies that style sheets do not outlive their elements.
+Since you can get back to the element with the ownerNode attribute,
+it's important to keep the element alive.
+</p>
+<p id="result">TEST HAS NOT RUN YET.</p>
+</body>
diff --git a/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js b/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js
new file mode 100644
index 0000000..22974e7
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js
@@ -0,0 +1,16 @@
+description("This tests indexing outside the range of the media list object.");
+
+var styleElement = document.createElement('style');
+styleElement.setAttribute('media', 'screen, print');
+document.documentElement.appendChild(styleElement)
+var mediaList = document.styleSheets[document.styleSheets.length - 1].media;
+
+shouldEvaluateTo('mediaList.length', 2);
+shouldBeEqualToString('mediaList[0]', 'screen');
+shouldBeEqualToString('mediaList[1]', 'print');
+shouldBeNull('mediaList[2]');
+shouldBeUndefined('mediaList[-1]')
+
+document.documentElement.removeChild(styleElement);
+
+successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js b/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js
new file mode 100644
index 0000000..793ed65
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js
@@ -0,0 +1,8 @@
+description("This test verifies that a StyleSheet object will be returned instead of a HTMLStyleElement when calling document.styleSheets named property getter.");
+
+var styleElement = document.createElement("style");
+styleElement.setAttribute("id", "test");
+document.head.appendChild(styleElement);
+shouldBe('document.styleSheets["test"]', 'styleElement.sheet');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt b/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt
new file mode 100644
index 0000000..8301ec6
--- /dev/null
+++ b/LayoutTests/fast/dom/Text/replaceWholeText-expected.txt
@@ -0,0 +1,13 @@
+Test wholeText and replaceWholeText
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS textB.wholeText is 'AB'
+PASS para.textContent is 'ABC'
+PASS textB.wholeText is 'XYZ'
+PASS para.textContent is 'XYZC'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Text/replaceWholeText.html b/LayoutTests/fast/dom/Text/replaceWholeText.html
new file mode 100644
index 0000000..7ac41cf
--- /dev/null
+++ b/LayoutTests/fast/dom/Text/replaceWholeText.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/replaceWholeText.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js
new file mode 100644
index 0000000..33b6dc8
--- /dev/null
+++ b/LayoutTests/fast/dom/Text/script-tests/replaceWholeText.js
@@ -0,0 +1,16 @@
+description("Test wholeText and replaceWholeText")
+
+var para = document.createElement('p');
+para.appendChild(document.createTextNode('A'));
+var textB = document.createTextNode('B');
+para.appendChild(textB);
+para.appendChild(document.createElement('p'));
+para.appendChild(document.createTextNode('C'));
+
+shouldBe("textB.wholeText", "'AB'");
+shouldBe("para.textContent", "'ABC'");
+textB.replaceWholeText("XYZ");
+shouldBe("textB.wholeText", "'XYZ'");
+shouldBe("para.textContent", "'XYZC'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt b/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
new file mode 100644
index 0000000..d9ea239
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
@@ -0,0 +1,36 @@
+Tests the TreeWalker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test that TreeWalker.parent() doesn't set the currentNode to a node not under the root.
+
+PASS w.currentNode is subTree
+PASS w.parentNode() is null
+PASS w.currentNode is subTree
+
+Test that we handle setting the currentNode to arbitrary nodes not under the root element.
+
+PASS w.parentNode() is null
+PASS w.currentNode is document.documentElement
+PASS w.nextNode() is document.documentElement.firstChild
+PASS w.currentNode is document.documentElement.firstChild
+PASS w.previousNode() is null
+PASS w.currentNode is document.documentElement
+PASS w.firstChild() is document.documentElement.firstChild
+PASS w.currentNode is document.documentElement.firstChild
+PASS w.lastChild() is document.documentElement.lastChild
+PASS w.currentNode is document.documentElement.lastChild
+PASS w.nextSibling() is null
+PASS w.currentNode is document.documentElement
+PASS w.previousSibling() is null
+PASS w.currentNode is document.documentElement
+
+Test how we handle the case when the traversed to node within the root, but the currentElement is not.
+
+PASS w.nextNode() is subTree
+PASS w.lastChild() is subTree
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode.html b/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode.html
new file mode 100644
index 0000000..fa8cad3
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/TreeWalker-currentNode.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt b/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt
new file mode 100644
index 0000000..ca5da84
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt
@@ -0,0 +1,53 @@
+Test JS objects as NodeFilters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing with raw function filter
+ filtering node A1
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+ filtering node B1
+ filtering node B2
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+
+Testing with object filter
+ filtering node A1
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+ filtering node B1
+ filtering node B2
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+
+Testing with null filter
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'B1'
+
+Testing with undefined filter
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'B1'
+
+Testing with object lacking acceptNode property
+PASS walker.firstChild(); threw exception TypeError: NodeFilter object does not have an acceptNode function.
+PASS walker.currentNode.id; is 'root'
+PASS walker.nextNode(); threw exception TypeError: NodeFilter object does not have an acceptNode function.
+PASS walker.currentNode.id; is 'root'
+
+Testing with object with non-function acceptNode property
+PASS walker.firstChild(); threw exception TypeError: NodeFilter object does not have an acceptNode function.
+PASS walker.currentNode.id; is 'root'
+PASS walker.nextNode(); threw exception TypeError: NodeFilter object does not have an acceptNode function.
+PASS walker.currentNode.id; is 'root'
+
+Testing with function having acceptNode function
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'B1'
+
+Testing acceptNode callee
+Callee: function (node) {
+ debug('Callee: ' + arguments.callee);
+ return NodeFilter.FILTER_ACCEPT;
+ }
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html b/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html
new file mode 100644
index 0000000..a6398f9
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/acceptNode-filter.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt b/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
new file mode 100644
index 0000000..c7213aa
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
@@ -0,0 +1,21 @@
+Test JS objects as NodeFilters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing with object filter
+Test with filter function
+PASS walker.firstChild(); threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS walker.nextNode();walker.currentNode.id threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+
+Test with filter object
+PASS walker.firstChild(); threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS walker.nextNode();walker.currentNode.id threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/filter-throw.html b/LayoutTests/fast/dom/TreeWalker/filter-throw.html
new file mode 100644
index 0000000..e1ad777
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/filter-throw.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/filter-throw.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt b/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt
new file mode 100644
index 0000000..0ba7bb4
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt
@@ -0,0 +1,14 @@
+Test for a specific problem with previousNode that failed in older versions of WebKit.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'B1'
+PASS walker.nextNode(); walker.currentNode.id is 'C1'
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+PASS walker.previousNode(); walker.currentNode.id is 'C1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html b/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html
new file mode 100644
index 0000000..9445675
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/previousNodeLastChildReject.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt b/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt
new file mode 100644
index 0000000..4cc3b5e
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt
@@ -0,0 +1,16 @@
+Test for a specific problem with previousSibling that failed in older versions of WebKit.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'C1'
+PASS walker.nextNode(); walker.currentNode.id is 'C2'
+PASS walker.nextNode(); walker.currentNode.id is 'D1'
+PASS walker.nextNode(); walker.currentNode.id is 'D2'
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+PASS walker.previousSibling(); walker.currentNode.id is 'C2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html b/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html
new file mode 100644
index 0000000..5f44a37
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/previousSiblingLastChildSkip.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js b/LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js
new file mode 100644
index 0000000..4a6768b
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js
@@ -0,0 +1,55 @@
+description("Tests the TreeWalker.")
+
+var subTree = document.createElement('div');
+subTree.innerHTML = "<p>Lorem ipsum <span>dolor <b>sit</b> amet</span>, consectetur <i>adipisicing</i> elit, sed do eiusmod <tt>tempor <b><i>incididunt ut</i> labore</b> et dolore magna</tt> aliqua.</p>"
+document.body.appendChild(subTree);
+
+var all = function(node) { return true; }
+var w = document.createTreeWalker(subTree, 0x01 | 0x08 | 0x10 | 0x20, all, true);
+
+debug("Test that TreeWalker.parent() doesn't set the currentNode to a node not under the root.");
+debug("");
+
+shouldBe("w.currentNode", "subTree");
+shouldBeNull("w.parentNode()");
+shouldBe("w.currentNode", "subTree");
+
+debug("");
+debug("Test that we handle setting the currentNode to arbitrary nodes not under the root element.");
+debug("");
+
+w.currentNode = document.documentElement;
+shouldBeNull("w.parentNode()");
+shouldBe("w.currentNode", "document.documentElement");
+w.currentNode = document.documentElement;
+shouldBe("w.nextNode()", "document.documentElement.firstChild");
+shouldBe("w.currentNode", "document.documentElement.firstChild");
+w.currentNode = document.documentElement;
+shouldBeNull("w.previousNode()");
+shouldBe("w.currentNode", "document.documentElement");
+w.currentNode = document.documentElement;
+shouldBe("w.firstChild()", "document.documentElement.firstChild");
+shouldBe("w.currentNode", "document.documentElement.firstChild");
+w.currentNode = document.documentElement;
+shouldBe("w.lastChild()", "document.documentElement.lastChild");
+shouldBe("w.currentNode", "document.documentElement.lastChild");
+w.currentNode = document.documentElement;
+shouldBeNull("w.nextSibling()");
+shouldBe("w.currentNode", "document.documentElement");
+w.currentNode = document.documentElement;
+shouldBeNull("w.previousSibling()");
+shouldBe("w.currentNode", "document.documentElement");
+
+debug("");
+debug("Test how we handle the case when the traversed to node within the root, but the currentElement is not.");
+debug("");
+
+w.currentNode = subTree.previousSibling;
+shouldBe("w.nextNode()", "subTree");
+w.currentNode = document.body;
+shouldBe("w.lastChild()", "subTree");
+
+// Cleanup
+document.body.removeChild(subTree);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js b/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js
new file mode 100644
index 0000000..79c26cc
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js
@@ -0,0 +1,81 @@
+description('Test JS objects as NodeFilters.');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.id = 'root';
+testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>';
+
+function filter(node)
+{
+ debug(" filtering node " + node.id);
+ if (node.id == "B1")
+ return NodeFilter.FILTER_SKIP;
+ return NodeFilter.FILTER_ACCEPT;
+}
+
+debug("Testing with raw function filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+
+debug("<br>Testing with object filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {
+ acceptNode : function(node) {
+ debug(" filtering node " + node.id);
+ if (node.id == "B1")
+ return NodeFilter.FILTER_SKIP;
+ return NodeFilter.FILTER_ACCEPT;
+ }
+ }, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+
+debug("<br>Testing with null filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, null, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'");
+
+debug("<br>Testing with undefined filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, undefined, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'");
+
+debug("<br>Testing with object lacking acceptNode property");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {}, false);
+
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id;", "'root'");
+shouldThrow("walker.nextNode();");
+shouldBe("walker.currentNode.id;", "'root'");
+
+debug("<br>Testing with object with non-function acceptNode property");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { acceptNode: "foo" }, false);
+
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id;", "'root'");
+shouldThrow("walker.nextNode();");
+shouldBe("walker.currentNode.id;", "'root'");
+
+debug("<br>Testing with function having acceptNode function");
+var filter = function() { return NodeFilter.FILTER_ACCEPT; };
+filter.acceptNode = function(node) { return NodeFilter.FILTER_SKIP; };
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'");
+
+debug("<br>Testing acceptNode callee");
+var filter = {
+ acceptNode: function(node) {
+ debug('Callee: ' + arguments.callee);
+ return NodeFilter.FILTER_ACCEPT;
+ }
+};
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js b/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js
new file mode 100644
index 0000000..1127f77
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js
@@ -0,0 +1,32 @@
+description('Test JS objects as NodeFilters.');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.id = 'root';
+testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>';
+debug("Testing with object filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, function(node) {
+ throw('filter exception');
+ return NodeFilter.FILTER_ACCEPT;
+}, false);
+
+debug("Test with filter function");
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id", "'root'")
+shouldThrow("walker.nextNode();walker.currentNode.id");
+shouldBe("walker.currentNode.id", "'root'")
+
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {
+ acceptNode : function(node) {
+ throw('filter exception');
+ return NodeFilter.FILTER_ACCEPT;
+ }
+ }, false);
+
+debug("<br>Test with filter object");
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id", "'root'")
+shouldThrow("walker.nextNode();walker.currentNode.id");
+shouldBe("walker.currentNode.id", "'root'")
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js b/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js
new file mode 100644
index 0000000..dcc7e58
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js
@@ -0,0 +1,21 @@
+description('Test for a specific problem with previousNode that failed in older versions of WebKit.');
+
+var testElement = document.createElement("div");
+testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>';
+
+function filter(node)
+{
+ if (node.id == "C2")
+ return NodeFilter.FILTER_REJECT;
+ return NodeFilter.FILTER_ACCEPT;
+}
+
+var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js b/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js
new file mode 100644
index 0000000..ed7c577
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js
@@ -0,0 +1,23 @@
+description('Test for a specific problem with previousSibling that failed in older versions of WebKit.');
+
+var testElement = document.createElement("div");
+testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>';
+
+function filter(node)
+{
+ if (node.id == "B1")
+ return NodeFilter.FILTER_SKIP;
+ return NodeFilter.FILTER_ACCEPT;
+}
+
+var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'C2'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'D1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'D2'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.previousSibling(); walker.currentNode.id", "'C2'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js
new file mode 100644
index 0000000..33fdbef
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js
@@ -0,0 +1,58 @@
+description('Test TreeWalker with rejection');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>';
+
+var rejectB1Filter = {
+ acceptNode: function(node) {
+ if (node.id == 'B1')
+ return NodeFilter.FILTER_REJECT;
+
+ return NodeFilter.FILTER_ACCEPT;
+ }
+}
+
+var rejectB2Filter = {
+ acceptNode: function(node) {
+ if (node.id == 'B2')
+ return NodeFilter.FILTER_SKIP;
+
+ return NodeFilter.FILTER_ACCEPT;
+ }
+}
+
+debug("<br>Testing nextNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false);
+shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'");
+
+debug("<br>Testing firstChild")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.firstChild(); walker.currentNode.id", "'B2'");
+
+debug("<br>Testing nextSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'");
+shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'");
+
+debug("<br>Testing parentNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false);
+walker.currentNode = testElement.querySelectorAll('#C1')[0];
+shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'");
+
+debug("<br>Testing previousSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false);
+walker.currentNode = testElement.querySelectorAll('#B3')[0];
+shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'");
+
+debug("<br>Testing previousNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false);
+walker.currentNode = testElement.querySelectorAll('#B3')[0];
+shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js
new file mode 100644
index 0000000..b3d21ab
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js
@@ -0,0 +1,27 @@
+description('Test TreeWalker with skipping');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.innerHTML='<div id="A1"><div id="B1" class="keep"></div><div id="B2">this text matters</div><div id="B3" class="keep"></div></div>';
+
+var filter = {
+ acceptNode: function(node) {
+ if (node.className == 'keep')
+ return NodeFilter.FILTER_ACCEPT;
+
+ return NodeFilter.FILTER_SKIP;
+ }
+}
+
+debug("<br>Testing nextSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'");
+shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'");
+
+debug("<br>Testing previousSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false);
+walker.currentNode = testElement.querySelectorAll('#B3')[0];
+shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'");
+
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js
new file mode 100644
index 0000000..d328f53
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js
@@ -0,0 +1,60 @@
+description('Test TreeWalker with skipping');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>';
+
+var skipB1Filter = {
+ acceptNode: function(node) {
+ if (node.id == 'B1')
+ return NodeFilter.FILTER_SKIP;
+
+ return NodeFilter.FILTER_ACCEPT;
+ }
+}
+
+var skipB2Filter = {
+ acceptNode: function(node) {
+ if (node.id == 'B2')
+ return NodeFilter.FILTER_SKIP;
+
+ return NodeFilter.FILTER_ACCEPT;
+ }
+}
+
+debug("<br>Testing nextNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false);
+shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'");
+
+debug("<br>Testing firstChild")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.firstChild(); walker.currentNode.id", "'C1'");
+
+debug("<br>Testing nextSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false);
+shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
+shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'");
+shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'");
+
+debug("<br>Testing parentNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false);
+walker.currentNode = testElement.querySelectorAll('#C1')[0];
+shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'");
+
+debug("<br>Testing previousSibling")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false);
+walker.currentNode = testElement.querySelectorAll('#B3')[0];
+shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'");
+
+debug("<br>Testing previousNode")
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false);
+walker.currentNode = testElement.querySelectorAll('#B3')[0];
+shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'");
+shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'");
+shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt b/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt
new file mode 100644
index 0000000..89a3127
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt
@@ -0,0 +1,33 @@
+Test TreeWalker with rejection
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Testing nextNode
+PASS walker.nextNode(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+PASS walker.nextNode(); walker.currentNode.id is 'B3'
+
+Testing firstChild
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.firstChild(); walker.currentNode.id is 'B2'
+
+Testing nextSibling
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.firstChild(); walker.currentNode.id is 'B1'
+PASS walker.nextSibling(); walker.currentNode.id is 'B3'
+
+Testing parentNode
+PASS walker.parentNode(); walker.currentNode.id is 'A1'
+
+Testing previousSibling
+PASS walker.previousSibling(); walker.currentNode.id is 'B1'
+
+Testing previousNode
+PASS walker.previousNode(); walker.currentNode.id is 'B2'
+PASS walker.previousNode(); walker.currentNode.id is 'A1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-reject.html b/LayoutTests/fast/dom/TreeWalker/traversal-reject.html
new file mode 100644
index 0000000..ca34d86
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-reject.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/traversal-reject.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt b/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt
new file mode 100644
index 0000000..65bf98f
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt
@@ -0,0 +1,35 @@
+Test TreeWalker with skipping
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Testing nextNode
+PASS walker.nextNode(); walker.currentNode.id is 'A1'
+PASS walker.nextNode(); walker.currentNode.id is 'C1'
+PASS walker.nextNode(); walker.currentNode.id is 'B2'
+PASS walker.nextNode(); walker.currentNode.id is 'B3'
+
+Testing firstChild
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.firstChild(); walker.currentNode.id is 'C1'
+
+Testing nextSibling
+PASS walker.firstChild(); walker.currentNode.id is 'A1'
+PASS walker.firstChild(); walker.currentNode.id is 'B1'
+PASS walker.nextSibling(); walker.currentNode.id is 'B3'
+
+Testing parentNode
+PASS walker.parentNode(); walker.currentNode.id is 'A1'
+
+Testing previousSibling
+PASS walker.previousSibling(); walker.currentNode.id is 'B1'
+
+Testing previousNode
+PASS walker.previousNode(); walker.currentNode.id is 'B2'
+PASS walker.previousNode(); walker.currentNode.id is 'C1'
+PASS walker.previousNode(); walker.currentNode.id is 'A1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt b/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt
new file mode 100644
index 0000000..2be59a2
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt
@@ -0,0 +1,16 @@
+Test TreeWalker with skipping
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Testing nextSibling
+PASS walker.firstChild(); walker.currentNode.id is 'B1'
+PASS walker.nextSibling(); walker.currentNode.id is 'B3'
+
+Testing previousSibling
+PASS walker.previousSibling(); walker.currentNode.id is 'B1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html b/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html
new file mode 100644
index 0000000..141f979
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/traversal-skip-most.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/traversal-skip.html b/LayoutTests/fast/dom/TreeWalker/traversal-skip.html
new file mode 100644
index 0000000..d788624
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/traversal-skip.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/traversal-skip.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/flash-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/flash-before-load-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/flash-before-load-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/flash-before-load.html b/LayoutTests/fast/dom/beforeload/flash-before-load.html
new file mode 100644
index 0000000..5d3ea88
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/flash-before-load.html
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script src="resources/print.js"></script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+
+<object id="plugin" onbeforeload="return false" type="application/x-shockwave-flash" data="../../../plugins/resources/simple_blank.swf"
+width="300" height="150">
+<span style="font-family:monospace; color:green">PASS</span>
+</object>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/frame-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/frame-before-load-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/frame-before-load-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/frame-before-load.html b/LayoutTests/fast/dom/beforeload/frame-before-load.html
new file mode 100644
index 0000000..6fd8c92
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/frame-before-load.html
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script src="resources/print.js"></script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+}
+</script>
+
+<iframe style="display:none" onbeforeload="print('PASS', 'green'); return event.url != 'http://www.daringfireball.net/';" onload="print('FAIL', 'red');" src="http://www.daringfireball.net/">
+</iframe>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/image-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/image-before-load-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-before-load-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt b/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt
new file mode 100644
index 0000000..aa44e7c
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt
@@ -0,0 +1,2 @@
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML.html b/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML.html
new file mode 100644
index 0000000..2351569
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.addEventListener("beforeload", function(event) {
+ print("PASS", "green");
+ event.preventDefault();
+ }, true);
+
+ document.addEventListener("load", function(event) {
+ print("FAIL", "red");
+ }, true);
+ </script>
+</head>
+<body>
+ <div id="target"></div>
+ <div id="console"></div>
+ <script>
+ document.getElementById("target").innerHTML = "<img src='../../images/resources/test-load.jpg'>";
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/image-before-load.html b/LayoutTests/fast/dom/beforeload/image-before-load.html
new file mode 100644
index 0000000..4467018
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-before-load.html
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script src="resources/print.js"></script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+}
+</script>
+
+<img style="display:none" onbeforeload="print('PASS', 'green'); return false;" onload="print('FAIL', 'red');" src="../../images/resources/test-load.jpg">
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/image-object-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/image-object-before-load-expected.txt
new file mode 100644
index 0000000..69cfc5a
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-object-before-load-expected.txt
@@ -0,0 +1,2 @@
+PASS
+
diff --git a/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt b/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt
new file mode 100644
index 0000000..69cfc5a
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt
@@ -0,0 +1,2 @@
+PASS
+
diff --git a/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML.html b/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML.html
new file mode 100644
index 0000000..6befc57
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-object-before-load-innerHTML.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ document.addEventListener("beforeload", function(event) {
+ event.preventDefault();
+ }, true);
+
+ function checkObject()
+ {
+ var style = getComputedStyle(document.getElementsByTagName("object")[0], null);
+ if (style.width != "0px" || style.height != "0px")
+ print("FAIL", "red");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ </script>
+</head>
+<body onload="checkObject();">
+ <div id="target"></div>
+ <div id="console"></div>
+ <script>
+ document.getElementById("target").innerHTML = "<object data='../../images/resources/test-load.jpg'><span style='font-family:monospace; color:green'>PASS</span></object>";
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/image-object-before-load.html b/LayoutTests/fast/dom/beforeload/image-object-before-load.html
new file mode 100644
index 0000000..46fae33
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/image-object-before-load.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ document.addEventListener("beforeload", function(event) {
+ event.preventDefault();
+ }, true);
+
+ function checkObject()
+ {
+ var style = getComputedStyle(document.getElementsByTagName("object")[0], null);
+ if (style.width != "0px" || style.height != "0px")
+ print("FAIL", "red");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ </script>
+</head>
+<body onload="checkObject();">
+ <object data="../../images/resources/test-load.jpg">
+ <span style="font-family:monospace; color:green">PASS</span>
+ </object>
+ <div id="console"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/link-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/link-before-load-expected.txt
new file mode 100644
index 0000000..d9bd273
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/link-before-load-expected.txt
@@ -0,0 +1,3 @@
+This page tests the beforeload event on link elements. You should see the word PASS below underneath a green square.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/link-before-load.html b/LayoutTests/fast/dom/beforeload/link-before-load.html
new file mode 100644
index 0000000..ae3c71c
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/link-before-load.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<style>
+.block {
+ width: 100px;
+ height: 100px;
+ background-color: green;
+}
+</style>
+<link onbeforeload="return false" rel="stylesheet" href="resources/fail.css">
+<script src="resources/print.js"></script>
+<script>
+function test()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ if (document.getElementById('block').offsetWidth == 100)
+ print("PASS", "green");
+ else
+ print("FAIL", "red");
+}
+</script>
+</head>
+<body onload="test()">
+<p>This page tests the beforeload event on link elements. You should see the word PASS below underneath a green square.</p>
+<hr>
+<div id="block" class="block"></div>
+<hr>
+<div id="console"></div>
diff --git a/LayoutTests/fast/dom/beforeload/pi-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/pi-before-load-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/pi-before-load-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml b/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml
new file mode 100644
index 0000000..58c19e1
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style>
+.block {
+ width: 100px;
+ height: 100px;
+ background-color: green;
+}
+</style>
+<script src="resources/print.js"></script>
+<script>
+function test()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ if (document.getElementById('block').offsetWidth == 100)
+ print("PASS", "green");
+ else
+ print("FAIL", "red");
+}
+</script>
+</head>
+<body onload="test()">
+<div id="block" class="block"></div>
+<script>
+function beforeLoadFunc()
+{
+ event.preventDefault();
+}
+
+document.addEventListener("beforeload", beforeLoadFunc, true);
+
+var pi = document.createProcessingInstruction("xml-stylesheet", "type=\"text/css\" href=\"resources/fail.css\"");
+document.insertBefore(pi, document.documentElement);
+</script>
+<hr/>
+<div id="console"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..9a44ddc
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove an object element with an invalid data URL in its beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html
new file mode 100644
index 0000000..2bdedae
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html
@@ -0,0 +1,49 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var count = 0;
+ var maxCount = 10;
+ var timeout = 100;
+
+ document.addEventListener("beforeload", function(event) {
+ if (event.target && event.target.parentElement)
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove an object element with an invalid data URL in its beforeload listener without causing a crash.</p>
+ <object data="does-not-exist.png">FAIL</object>
+ <object data="does-not-exist">FAIL</object>
+ <div id="console"></div>
+ <script>
+ function checkObjectRemoval()
+ {
+ if (!document.getElementsByTagName("object").length) {
+ print("PASS", "green");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ if (++count > maxCount) {
+ print("FAIL", "red");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ </script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..dc83c9c
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove a flash object in a beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener.html
new file mode 100644
index 0000000..1c8c021
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var count = 0;
+ var maxCount = 10;
+ var timeout = 100;
+
+ document.addEventListener("beforeload", function(event) {
+ if (event.target && event.target.parentElement)
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove a flash object in a beforeload listener without causing a crash.</p>
+ <object type="application/x-shockwave-flash" data="../../../plugins/resources/simple_blank.swf"></object>
+ <div id="console"></div>
+ <script>
+ function checkObjectRemoval()
+ {
+ if (!document.getElementsByTagName("object").length) {
+ print("PASS", "green");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ if (++count > maxCount) {
+ print("FAIL", "red");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ </script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..aebdcc4
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove an iframe element in its beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html
new file mode 100644
index 0000000..fe45195
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.addEventListener("beforeload", function(event) {
+ if (event.target && event.target.parentElement)
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove an iframe element in its beforeload listener without causing a crash.</p>
+ <iframe src="http://webkit.org"></iframe>
+ <div id="console"></div>
+ <script>
+ if (document.getElementsByTagName("iframe").length)
+ print("FAIL", "red");
+ else
+ print("PASS", "green");
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..abc0aa7
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove an img object in a beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener.html
new file mode 100644
index 0000000..2ffda88
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-image-in-beforeload-listener.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var count = 0;
+ var maxCount = 10;
+ var timeout = 100;
+
+ document.addEventListener("beforeload", function(event) {
+ if (event.target && event.target.parentElement)
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove an img object in a beforeload listener without causing a crash.</p>
+ <img src="../../images/resources/test-load.jpg">
+ <div id="console"></div>
+ <script>
+ function checkObjectRemoval()
+ {
+ if (!document.getElementsByTagName("img").length) {
+ print("PASS", "green");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ if (++count > maxCount) {
+ print("FAIL", "red");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..9a70826
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove a stylesheet link element in its beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener.html
new file mode 100644
index 0000000..abbe9af
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-link-in-beforeload-listener.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.addEventListener("beforeload", function(event) {
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+ <link rel="stylesheet" href="data:text/css">
+</head>
+<body>
+ <p>This page tests that you can correctly remove a stylesheet link element in its beforeload listener without causing a crash.</p>
+ <div id="console"></div>
+ <script>
+ if (document.getElementsByTagName("link").length)
+ print("FAIL", "red");
+ else
+ print("PASS", "green");
+ </script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..51192bc
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove a script element in its beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener.html
new file mode 100644
index 0000000..874c600
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-script-in-beforeload-listener.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.addEventListener("beforeload", function(event) {
+ var scriptElement = document.getElementById("toremove");
+ if (scriptElement) {
+ scriptElement.parentElement.removeChild(scriptElement);
+ event.preventDefault();
+ }
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove a script element in its beforeload listener without causing a crash.</p>
+ <script id="toremove" src="resources/fail.js"></script>
+ <div id="console"></div>
+ <script>
+ if (document.getElementById("toremove"))
+ print("FAIL", "red");
+ else
+ print("PASS", "green");
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt b/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt
new file mode 100644
index 0000000..48316fa
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove a video object in a beforeload listener without causing a crash.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener.html
new file mode 100644
index 0000000..add0e13
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/remove-video-in-beforeload-listener.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+ <script src="resources/print.js"></script>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var count = 0;
+ var maxCount = 10;
+ var timeout = 100;
+
+ document.addEventListener("beforeload", function(event) {
+ if (event.target && event.target.parentElement)
+ event.target.parentElement.removeChild(event.target);
+ }, true);
+ </script>
+</head>
+<body>
+ <p>This page tests that you can correctly remove a video object in a beforeload listener without causing a crash.</p>
+ <video src="../../../media/content/test.mp4"></video>
+ <div id="console"></div>
+ <script>
+ function checkObjectRemoval()
+ {
+ if (!document.getElementsByTagName("video").length) {
+ print("PASS", "green");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ if (++count > maxCount) {
+ print("FAIL", "red");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ return;
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ }
+
+ setTimeout("checkObjectRemoval()", timeout);
+ </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/resources/fail.css b/LayoutTests/fast/dom/beforeload/resources/fail.css
new file mode 100644
index 0000000..1a5960a
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/resources/fail.css
@@ -0,0 +1,5 @@
+.block {
+ background-color:red !important;
+ width: 200px !important;
+ height:200px !important;
+}
diff --git a/LayoutTests/fast/dom/beforeload/resources/fail.js b/LayoutTests/fast/dom/beforeload/resources/fail.js
new file mode 100644
index 0000000..6ba1fba
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/resources/fail.js
@@ -0,0 +1 @@
+print('FAIL', 'red');
diff --git a/LayoutTests/fast/dom/beforeload/resources/print.js b/LayoutTests/fast/dom/beforeload/resources/print.js
new file mode 100644
index 0000000..8b5dfe2
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/resources/print.js
@@ -0,0 +1,9 @@
+function print(message, color)
+{
+ var paragraph = document.createElement("div");
+ paragraph.appendChild(document.createTextNode(message));
+ paragraph.style.fontFamily = "monospace";
+ if (color)
+ paragraph.style.color = color;
+ document.getElementById("console").appendChild(paragraph);
+}
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load-dynamic-expected.txt b/LayoutTests/fast/dom/beforeload/script-before-load-dynamic-expected.txt
new file mode 100644
index 0000000..9a796b1
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load-dynamic-expected.txt
@@ -0,0 +1,3 @@
+This page tests the beforeload event on script elements. You should see a PASS message below if everything works.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load-dynamic.html b/LayoutTests/fast/dom/beforeload/script-before-load-dynamic.html
new file mode 100644
index 0000000..21559bd
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load-dynamic.html
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script src="resources/print.js"></script>
+</head>
+
+<body>
+<p>This page tests the beforeload event on script elements. You should see a PASS message below if everything
+works.</p>
+<hr>
+<div id='console'></div>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function beforeLoadFunc()
+{
+ print("PASS", "green");
+ event.preventDefault();
+}
+
+document.body.addEventListener("beforeload", beforeLoadFunc, true);
+var elt = document.createElement("script");
+elt.setAttribute("src", "resources/fail.js");
+document.body.appendChild(elt);
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/script-before-load-expected.txt
new file mode 100644
index 0000000..9a796b1
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load-expected.txt
@@ -0,0 +1,3 @@
+This page tests the beforeload event on script elements. You should see a PASS message below if everything works.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load-xhtml-expected.txt b/LayoutTests/fast/dom/beforeload/script-before-load-xhtml-expected.txt
new file mode 100644
index 0000000..9a796b1
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load-xhtml-expected.txt
@@ -0,0 +1,3 @@
+This page tests the beforeload event on script elements. You should see a PASS message below if everything works.
+
+PASS
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load-xhtml.xhtml b/LayoutTests/fast/dom/beforeload/script-before-load-xhtml.xhtml
new file mode 100644
index 0000000..247c743
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load-xhtml.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script src="resources/print.js"></script>
+</head>
+
+<body>
+<p>This page tests the beforeload event on script elements. You should see a PASS message below if everything
+works.</p>
+<hr/>
+<div id="console"></div>
+
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function beforeLoadFunc()
+{
+ print("PASS", "green");
+ event.preventDefault();
+}
+
+document.body.addEventListener("beforeload", beforeLoadFunc, true);
+</script>
+<script src="resources/fail.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/script-before-load.html b/LayoutTests/fast/dom/beforeload/script-before-load.html
new file mode 100644
index 0000000..e71200c
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/script-before-load.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<script src="resources/print.js"></script>
+</head>
+
+<body>
+<p>This page tests the beforeload event on script elements. You should see a PASS message below if everything
+works.</p>
+<hr>
+<div id='console'></div>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<script onbeforeload="print('PASS', 'green'); return false" src="resources/fail.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/beforeload/video-before-load-expected.txt b/LayoutTests/fast/dom/beforeload/video-before-load-expected.txt
new file mode 100644
index 0000000..69cfc5a
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/video-before-load-expected.txt
@@ -0,0 +1,2 @@
+PASS
+
diff --git a/LayoutTests/fast/dom/beforeload/video-before-load.html b/LayoutTests/fast/dom/beforeload/video-before-load.html
new file mode 100644
index 0000000..7876761
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/video-before-load.html
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script src="resources/print.js"></script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+</script>
+
+<video src="../../../media/content/test.mp4" onbeforeload="print('PASS', 'green'); if (window.layoutTestController) window.layoutTestController.notifyDone(); return false;" onload="print('FAIL', 'red'); if (window.layoutTestController) window.layoutTestController.notifyDone();"></video>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/001.html b/LayoutTests/fast/dom/getElementsByClassName/001.html
new file mode 100644
index 0000000..930aae5
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/001.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>document.getElementsByClassName(): simple</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName("\ta\n"), [document.documentElement, document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/002.html b/LayoutTests/fast/dom/getElementsByClassName/002.html
new file mode 100644
index 0000000..d91b0ac
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/002.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html class="a
+b">
+ <head>
+ <title>document.getElementsByClassName(): also simple</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a
+">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName("a\n"), [document.documentElement, document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/003.html b/LayoutTests/fast/dom/getElementsByClassName/003.html
new file mode 100644
index 0000000..661dbba
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/003.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>document.getElementsByClassName(): changing classes</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var collection = document.getElementsByClassName("a")
+ document.body.className = "b"
+ t(collection, [document.documentElement])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/004.html b/LayoutTests/fast/dom/getElementsByClassName/004.html
new file mode 100644
index 0000000..a932dd1
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/004.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>document.getElementsByClassName(): changing classes</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var collection = document.getElementsByClassName("a")
+ document.body.className += "\tb"
+ t(collection, [document.documentElement, document.body])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/005.html b/LayoutTests/fast/dom/getElementsByClassName/005.html
new file mode 100644
index 0000000..5a609db
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/005.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>document.getElementsByClassName(): changing classes</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var collection = document.getElementsByClassName("a")
+ document.body.removeAttribute("class")
+ t(collection, [document.documentElement])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt
new file mode 100644
index 0000000..9976b12
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt
@@ -0,0 +1,3 @@
+PASS
+
+
diff --git a/LayoutTests/fast/dom/getElementsByClassName/006.html b/LayoutTests/fast/dom/getElementsByClassName/006.html
new file mode 100644
index 0000000..89be60b
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/006.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+ <head>
+ <title>document.getElementsByClassName(): adding element with class</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var collection = document.getElementsByClassName("a"),
+ ele = document.createElement("foo");
+ ele.setAttribute("class", "a");
+ document.body.appendChild(ele)
+ t(collection, [document.body, ele])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/007.html b/LayoutTests/fast/dom/getElementsByClassName/007.html
new file mode 100644
index 0000000..bb013df
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/007.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+ <head>
+ <title>document.getElementsByClassName(): multiple classes</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a b">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName("b\t\f\n\na\rb"), [document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/008.html b/LayoutTests/fast/dom/getElementsByClassName/008.html
new file mode 100644
index 0000000..b60129d
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/008.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+ <head>
+ <title>document.getElementsByClassName(): multiple classes</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName("a\fa"), [document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/009.html b/LayoutTests/fast/dom/getElementsByClassName/009.html
new file mode 100644
index 0000000..ce52987
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/009.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html class="a A">
+ <head>
+ <title>document.getElementsByClassName(): case sensitive</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a a">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName("A a"), [document.documentElement]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt
new file mode 100644
index 0000000..9976b12
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt
@@ -0,0 +1,3 @@
+PASS
+
+
diff --git a/LayoutTests/fast/dom/getElementsByClassName/010.xml b/LayoutTests/fast/dom/getElementsByClassName/010.xml
new file mode 100644
index 0000000..44f8474
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/010.xml
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:g="http://www.w3.org/2000/svg">
+ <head>
+ <title>document.getElementsByClassName(): compound</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body>
+ <p id="r">FAIL (script did not run)</p>
+ <x class="a"/>
+ <g:x class="a"/>
+ <script> t(document.getElementsByClassName("a"), document.getElementsByTagName("x")) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt
new file mode 100644
index 0000000..9976b12
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt
@@ -0,0 +1,3 @@
+PASS
+
+
diff --git a/LayoutTests/fast/dom/getElementsByClassName/011.xml b/LayoutTests/fast/dom/getElementsByClassName/011.xml
new file mode 100644
index 0000000..6790b5a
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/011.xml
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:g="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:t="http://tc.labs.opera.com/#test">
+ <head>
+ <title>document.getElementsByClassName(): "tricky" compound</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body>
+ <p id="r">FAIL (script did not run)</p>
+ <x class="a"/>
+ <g:x class="a"/>
+ <x t:class="a" h:class="a" g:class="a"/>
+ <g:x t:class="a" h:class="a" g:class="a"/>
+ <t:x class="a" t:class="a" h:class="a" g:class="a"/>
+ <script>
+ var collection = document.getElementsByClassName("a"),
+ test = document.getElementsByTagName("x")
+ t(collection, [test[0], test[1]])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/012.html b/LayoutTests/fast/dom/getElementsByClassName/012.html
new file mode 100644
index 0000000..ed93344
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/012.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>element.getElementsByClassName(): simple</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.body.getElementsByClassName("a"), []) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt
new file mode 100644
index 0000000..9976b12
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt
@@ -0,0 +1,3 @@
+PASS
+
+
diff --git a/LayoutTests/fast/dom/getElementsByClassName/013.html b/LayoutTests/fast/dom/getElementsByClassName/013.html
new file mode 100644
index 0000000..7c8c232
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/013.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html class="a">
+ <head>
+ <title>element.getElementsByClassName(): adding an element</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var collection = document.body.getElementsByClassName("a"),
+ ele = document.createElement("x-y-z")
+ ele.className = "a"
+ document.body.appendChild(ele)
+ t(collection, [ele])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/014.html b/LayoutTests/fast/dom/getElementsByClassName/014.html
new file mode 100644
index 0000000..29dff66
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/014.html
@@ -0,0 +1,14 @@
+<html class="a A">
+ <head>
+ <title>document.getElementsByClassName(): case sensitive (quirks mode)</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ // We differ from Opera's implementation here. We are case-insensitive in quirks mode.
+ // t(document.getElementsByClassName("A a"), [document.documentElement])
+ t(document.getElementsByClassName("A a"), [document.documentElement, document.body])
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/015-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/015-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/015-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/015.html b/LayoutTests/fast/dom/getElementsByClassName/015.html
new file mode 100644
index 0000000..567b990
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/015.html
@@ -0,0 +1,14 @@
+<html class="a">
+ <head>
+ <title>document.getElementsByClassName(): live updating</title>
+ <script src="resources/common.js"></script>
+ </head>
+ <body class="a">
+ <p id="r">FAIL (script did not run)</p>
+ <script>
+ var elms = document.getElementsByClassName("a");
+ elms[1].className = "";
+ t(elms, [document.documentElement]);
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/001.html b/LayoutTests/fast/dom/getElementsByClassName/array/001.html
new file mode 100644
index 0000000..d002002
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/001.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html class="a
+b">
+ <head>
+ <title>document.getElementsByClassName(array): "a\n"</title>
+ <script src="../resources/common.js"></script>
+ </head>
+ <body class="a
+">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName(["a\n"]), [document.documentElement, document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/002.html b/LayoutTests/fast/dom/getElementsByClassName/array/002.html
new file mode 100644
index 0000000..2148e5e
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/002.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html class="a
+b">
+ <head>
+ <title>document.getElementsByClassName(array): "b","a"</title>
+ <script src="../resources/common.js"></script>
+ </head>
+ <body class="b,a">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName(["b", "a"]), [document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/003.html b/LayoutTests/fast/dom/getElementsByClassName/array/003.html
new file mode 100644
index 0000000..e110dc9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/003.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+ <head>
+ <title>document.getElementsByClassName(array): "b a"</title>
+ <script src="../resources/common.js"></script>
+ </head>
+ <body class="a b">
+ <p id="r">FAIL (script did not run)</p>
+ <script> t(document.getElementsByClassName(["b a"]), [document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt
new file mode 100644
index 0000000..7ef22e9
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/dom/getElementsByClassName/array/004.html b/LayoutTests/fast/dom/getElementsByClassName/array/004.html
new file mode 100644
index 0000000..3740509
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/array/004.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html class="a,b">
+ <head>
+ <title>element.getElementsByClassName(array): "a", "b"</title>
+ <script src="../resources/common.js"></script>
+ </head>
+ <body class="a,b x">
+ <p id="r" class="a,bx">FAIL (script did not run)</p>
+ <script class="xa,b"> t(document.documentElement.getElementsByClassName(["\fa","b\n"]), [document.body]) </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt b/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt
new file mode 100644
index 0000000..373ffbc
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt
@@ -0,0 +1,26 @@
+Line 1
+Line 2
+Line 3
+
+line 4
+line 5
+
+[object HTMLDivElement], [object HTMLDivElement], [object HTMLDivElement], length: 3
+[object HTMLDivElement], [object HTMLDivElement], [object HTMLDivElement], [object HTMLParagraphElement], length: 4
+[object HTMLDivElement], [object HTMLDivElement], length: 2
+[object HTMLDivElement], [object HTMLDivElement], length: 2
+length: 0
+length: 0
+length: 0
+length: 0
+length: 0
+[object HTMLDivElement], length: 1
+[object HTMLDivElement], [object HTMLParagraphElement], length: 2
+[object HTMLDivElement], length: 1
+[object HTMLDivElement], length: 1
+length: 0
+length: 0
+length: 0
+length: 0
+length: 0
+
diff --git a/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html b/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html
new file mode 100644
index 0000000..86bd42e
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html
@@ -0,0 +1,54 @@
+<html>
+<body>
+<div class="one">Line 1<div class="two">Line 2</div><p>Line <i>3</i></p></div>
+<div id="test" class="one two"><div class="one two">line 4</div><p class="two">line 5</p></div>
+<p><ol id="console"></ol></p>
+<script type="text/javascript">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function log(message)
+ {
+ var item = document.createElement("li");
+ item.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(item);
+ }
+
+ NodeList.prototype.dump = function()
+ {
+ var result = "";
+ var i = 0;
+ for (; i < this.length; i++)
+ result += this[i] + ", ";
+ result += "length: " + i;
+ return result;
+ }
+
+ try {
+ var elm = document.getElementById("test");
+
+ log(document.getElementsByClassName("one").dump());
+ log(document.getElementsByClassName("two").dump());
+ log(document.getElementsByClassName("one two").dump());
+ log(document.getElementsByClassName("one\t\t\n \ftwo").dump());
+ log(document.getElementsByClassName("").dump());
+ log(document.getElementsByClassName("onetwo").dump());
+ log(document.getElementsByClassName().dump());
+ log(document.getElementsByClassName(null).dump());
+ log(document.getElementsByClassName(undefined).dump());
+
+ log(elm.getElementsByClassName("one").dump());
+ log(elm.getElementsByClassName("two").dump());
+ log(elm.getElementsByClassName("one two").dump());
+ log(elm.getElementsByClassName("one\t\t\n \ftwo").dump());
+ log(elm.getElementsByClassName("").dump());
+ log(elm.getElementsByClassName("onetwo").dump());
+ log(elm.getElementsByClassName().dump());
+ log(elm.getElementsByClassName(null).dump());
+ log(elm.getElementsByClassName(undefined).dump());
+ } catch (ex) {
+ log("Exception: " + ex.description);
+ }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/getElementsByClassName/resources/common.js b/LayoutTests/fast/dom/getElementsByClassName/resources/common.js
new file mode 100644
index 0000000..0ea011d
--- /dev/null
+++ b/LayoutTests/fast/dom/getElementsByClassName/resources/common.js
@@ -0,0 +1,21 @@
+// runs a test and writes a log
+function t(collection, elements) {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var log = "",
+ r = document.getElementById("r"),
+ pass = true
+ if(collection.length != elements.length) {
+ pass = false
+ log += "Got " + collection.length + " elements, expected " + elements.length + ". "
+ }
+ for(var i = 0, max = collection.length > elements.length ? elements.length : collection.length; i < max; i++) {
+ if(collection[i] != elements[i]) {
+ pass = false
+ log += "Got element `" + collection[i].tagName + "` (" + collection[i].namespaceURI + ")"
+ log += ", expected element `" + elements[i].tagName + "` (" + elements[i].namespaceURI + "). "
+ }
+ }
+ r.textContent = pass ? "PASS" : "FAIL (" + log + ")"
+}
diff --git a/LayoutTests/fast/leaks/001-expected.txt b/LayoutTests/fast/leaks/001-expected.txt
new file mode 100644
index 0000000..4659dec
--- /dev/null
+++ b/LayoutTests/fast/leaks/001-expected.txt
@@ -0,0 +1,4 @@
+This test exercises RenderBlock::bidiReorderCharacters in a specific way to test for BidiRun leaks as reported in rdar://problem/4987649. Its layout has no particular meaning.
+
+Test:
+
diff --git a/LayoutTests/fast/leaks/001.html b/LayoutTests/fast/leaks/001.html
new file mode 100644
index 0000000..d3c728a
--- /dev/null
+++ b/LayoutTests/fast/leaks/001.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+ <head>
+ <title>BidiRun leak test</title>
+ <style type="text/css">
+ .compact { display: compact; }
+ .block { display: block; color: red; background: lime; line-height: 0; margin-left: 10em; }
+ span { color: black; }
+ </style>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ </script>
+ </head>
+ <body>
+ <p>This test exercises RenderBlock::bidiReorderCharacters in a specific way to
+ test for BidiRun leaks as reported in rdar://problem/4987649. Its layout has no
+ particular meaning.</p>
+ <div class="compact"> Test: </div>
+ <div class="block"></div>
+ </body>
+</html>
diff --git a/LayoutTests/fast/leaks/002-expected.txt b/LayoutTests/fast/leaks/002-expected.txt
new file mode 100644
index 0000000..586c81e
--- /dev/null
+++ b/LayoutTests/fast/leaks/002-expected.txt
@@ -0,0 +1,4 @@
+This test exercises RenderBlock::bidiReorderCharacters in a specific way to test for BidiRun leaks as reported in rdar://problem/4987649. Its layout has no particular meaning.
+
+
+
diff --git a/LayoutTests/fast/leaks/002.html b/LayoutTests/fast/leaks/002.html
new file mode 100644
index 0000000..0b0ecd2
--- /dev/null
+++ b/LayoutTests/fast/leaks/002.html
@@ -0,0 +1,20 @@
+<p>This test exercises RenderBlock::bidiReorderCharacters in a specific way to
+test for BidiRun leaks as reported in rdar://problem/4987649. Its layout has no
+particular meaning.
+</p>
+<div><input type='file' id='input'></input></div>
+<iframe id='iframe' src="data:text/html,<input type='file' id='input'></input>"></iframe>
+
+<script>
+window.onload = function main()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ // Repeat, to generate lots of leaks.
+ for (var i = 0; i < 20; i++) { //>
+ document.getElementById('input').focus();
+ document.getElementById('iframe').contentDocument.getElementById('input').focus();
+ }
+}
+</script>
diff --git a/LayoutTests/fast/leaks/003-expected.txt b/LayoutTests/fast/leaks/003-expected.txt
new file mode 100644
index 0000000..98a622b
--- /dev/null
+++ b/LayoutTests/fast/leaks/003-expected.txt
@@ -0,0 +1,4 @@
+This test verifies that garbage collection successfully cleans up after the destruction of a frame containing a JavaScript interpreter. If the test passes, you'll see a PASS message below.
+
+PASS: 20 garbage JS objects or fewer left uncollected after destroying a frame.
+
diff --git a/LayoutTests/fast/leaks/003.html-disabled b/LayoutTests/fast/leaks/003.html-disabled
new file mode 100644
index 0000000..dc7b0ba
--- /dev/null
+++ b/LayoutTests/fast/leaks/003.html-disabled
@@ -0,0 +1,61 @@
+<p>This test verifies that garbage collection successfully cleans up after the destruction
+of a frame containing a JavaScript interpreter. If the test passes, you'll see a PASS message below.</p>
+<hr>
+<pre id="log"></pre>
+
+<!-- The test: -->
+<iframe id="iframe" src="data:text/html,<script>;</script>" style="display:none"></iframe>
+<script>
+function log(s)
+{
+ document.getElementById("log").appendChild(document.createTextNode(s));
+}
+
+var wiggleRoom = 20;
+
+window.onload = function main()
+{
+ if (!window.layoutTestController || !window.GCController) {
+ log("FAIL: This test uses the layoutTestController and the GCController, so it can only run in DumpRenderTree.\n");
+ return;
+ }
+
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+
+ // Start with no garbage, so GC doesn't run automatically during the test.
+ GCController.collect();
+
+ // Create a little garbage, so we can detect failure in the case where the
+ // test doesn't produce any garbage because it fails to destroy the frame.
+ var garbage = [ { }, { }, { }, { }, { }, { }, { }, { }, { }, { } ];
+ garbage = null;
+
+ // Destroy a frame that has a JavaScript interpreter.
+ var iframe = document.getElementById("iframe");
+ iframe.parentNode.removeChild(iframe);
+
+ // Finish the test on a time-out, to allow the Frame keepAlive timer to fire
+ // and release the frame before we generate results.
+ var continueTest = function continueTest()
+ {
+ // Measure how many garbage JS objects are still around.
+ var jsObjectCountStart = GCController.getJSObjectCount();
+ GCController.collect();
+ var jsObjectCountDelta = jsObjectCountStart - GCController.getJSObjectCount();
+ var garbageCount = jsObjectCountDelta > 0 ? jsObjectCountDelta : 0;
+
+ // Fail if a lot of garbage was left behind. This can mean one of many things:
+ // the frame was not destroyed; the frame destruction did not trigger GC; or
+ // GC was not effective.
+ if (garbageCount > wiggleRoom) {
+ log("FAIL: " + garbageCount + " garbage JS objects left uncollected.\n");
+ } else {
+ log("PASS: " + wiggleRoom + " garbage JS objects or fewer left uncollected after destroying a frame.\n");
+ }
+
+ layoutTestController.notifyDone();
+ }
+ setTimeout(continueTest, 10);
+}
+</script>