Title: [196079] trunk/LayoutTests/imported/w3c
Revision
196079
Author
[email protected]
Date
2016-02-03 13:54:36 -0800 (Wed, 03 Feb 2016)

Log Message

Re-sync W3C DOM web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=153831

Reviewed by Darin Adler.

Re-sync W3C DOM web-platform-tests from:
https://github.com/w3c/web-platform-tests/tree/master/dom

* web-platform-tests/dom/collections/domstringmap-supported-property-names-expected.txt: Added.
* web-platform-tests/dom/collections/domstringmap-supported-property-names.html: Added.
* web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt: Added.
* web-platform-tests/dom/collections/namednodemap-supported-property-names.html: Added.
* web-platform-tests/dom/collections/w3c-import.log:
* web-platform-tests/dom/events/Event-dispatch-propagation-stopped-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html: Added.
* web-platform-tests/dom/events/w3c-import.log:
* web-platform-tests/dom/historical-expected.txt:
* web-platform-tests/dom/historical.html:
* web-platform-tests/dom/interface-objects-expected.txt:
* web-platform-tests/dom/interface-objects.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
* web-platform-tests/dom/nodes/Element-classlist-expected.txt:
* web-platform-tests/dom/nodes/Element-classlist.html:
* web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt: Added.
* web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml: Added.
* web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt:
* web-platform-tests/dom/nodes/Node-isEqualNode-xhtml-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt.
* web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml.
* web-platform-tests/dom/nodes/Node-isEqualNode.html: Added.
* web-platform-tests/dom/nodes/attributes-expected.txt:
* web-platform-tests/dom/nodes/attributes.html:
* web-platform-tests/dom/nodes/w3c-import.log:
* web-platform-tests/dom/ranges/Range-constructor-expected.txt: Added.
* web-platform-tests/dom/ranges/Range-constructor.html: Added.
* web-platform-tests/dom/ranges/w3c-import.log:
* web-platform-tests/dom/w3c-import.log:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-03 21:54:36 UTC (rev 196079)
@@ -1,3 +1,49 @@
+2016-02-03  Chris Dumez  <[email protected]>
+
+        Re-sync W3C DOM web-platform-tests
+        https://bugs.webkit.org/show_bug.cgi?id=153831
+
+        Reviewed by Darin Adler.
+
+        Re-sync W3C DOM web-platform-tests from:
+        https://github.com/w3c/web-platform-tests/tree/master/dom
+
+        * web-platform-tests/dom/collections/domstringmap-supported-property-names-expected.txt: Added.
+        * web-platform-tests/dom/collections/domstringmap-supported-property-names.html: Added.
+        * web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt: Added.
+        * web-platform-tests/dom/collections/namednodemap-supported-property-names.html: Added.
+        * web-platform-tests/dom/collections/w3c-import.log:
+        * web-platform-tests/dom/events/Event-dispatch-propagation-stopped-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html: Added.
+        * web-platform-tests/dom/events/w3c-import.log:
+        * web-platform-tests/dom/historical-expected.txt:
+        * web-platform-tests/dom/historical.html:
+        * web-platform-tests/dom/interface-objects-expected.txt:
+        * web-platform-tests/dom/interface-objects.html:
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/dom/interfaces.html:
+        * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
+        * web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
+        * web-platform-tests/dom/nodes/Element-classlist-expected.txt:
+        * web-platform-tests/dom/nodes/Element-classlist.html:
+        * web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt: Added.
+        * web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml: Added.
+        * web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt:
+        * web-platform-tests/dom/nodes/Node-isEqualNode-xhtml-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt.
+        * web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml.
+        * web-platform-tests/dom/nodes/Node-isEqualNode.html: Added.
+        * web-platform-tests/dom/nodes/attributes-expected.txt:
+        * web-platform-tests/dom/nodes/attributes.html:
+        * web-platform-tests/dom/nodes/w3c-import.log:
+        * web-platform-tests/dom/ranges/Range-constructor-expected.txt: Added.
+        * web-platform-tests/dom/ranges/Range-constructor.html: Added.
+        * web-platform-tests/dom/ranges/w3c-import.log:
+        * web-platform-tests/dom/w3c-import.log:
+
 2016-02-01  Chris Dumez  <[email protected]>
 
         Native Bindings Descriptors are Incomplete

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names-expected.txt (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,12 @@
+Simple
+Simple
+John Doe
+Jane Doe
+Jim Doe
+
+PASS Object.getOwnPropertyNames on DOMStringMap, empty data attribute 
+PASS Object.getOwnPropertyNames on DOMStringMap, data attribute trailing hyphen 
+PASS Object.getOwnPropertyNames on DOMStringMap, multiple data attributes 
+PASS Object.getOwnPropertyNames on DOMStringMap, attribute set on dataset in JS 
+PASS Object.getOwnPropertyNames on DOMStringMap, attribute set on element in JS 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names.html (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>DOMStringMap Test: Supported property names</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<div id="edge1" data-="012">Simple</div>
+
+<div id="edge2" data-id-="012">Simple</div>
+
+<div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>
+    John Doe
+</div>
+
+<div id="user2" data-unique-id="1234567890"> Jane Doe </div>
+
+<div id="user3" data-unique-id="4324324241"> Jim Doe </div>
+
+<script>
+
+test(function() {
+    var element = document.querySelector('#edge1');
+    assert_array_equals(Object.getOwnPropertyNames(element.dataset),
+        [""]);
+}, "Object.getOwnPropertyNames on DOMStringMap, empty data attribute");
+
+test(function() {
+    var element = document.querySelector('#edge2');
+    assert_array_equals(Object.getOwnPropertyNames(element.dataset),
+        ["id-"]);
+}, "Object.getOwnPropertyNames on DOMStringMap, data attribute trailing hyphen");
+
+test(function() {
+    var element = document.querySelector('#user');
+    assert_array_equals(Object.getOwnPropertyNames(element.dataset),
+        ['id', 'user', 'dateOfBirth']);
+}, "Object.getOwnPropertyNames on DOMStringMap, multiple data attributes");
+
+test(function() {
+    var element = document.querySelector('#user2');
+    element.dataset.middleName = "mark";
+    assert_array_equals(Object.getOwnPropertyNames(element.dataset),
+        ['uniqueId', 'middleName']);
+}, "Object.getOwnPropertyNames on DOMStringMap, attribute set on dataset in JS");
+
+test(function() {
+    var element = document.querySelector('#user3');
+    element.setAttribute("data-age", 30);
+    assert_array_equals(Object.getOwnPropertyNames(element.dataset),
+        ['uniqueId', 'age']);
+}, "Object.getOwnPropertyNames on DOMStringMap, attribute set on element in JS");
+
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,7 @@
+Simple
+
+
+FAIL Object.getOwnPropertyNames on NamedNodeMap assert_array_equals: lengths differ, expected 4 got 3
+FAIL Object.getOwnPropertyNames on NamedNodeMap of input assert_array_equals: lengths differ, expected 8 got 5
+FAIL Object.getOwnPropertyNames on NamedNodeMap after attribute removal assert_array_equals: lengths differ, expected 6 got 4
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names.html (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>NamedNodeMap Test: Supported property names</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+<div id="simple" class="fancy">Simple</div>
+<input id="result" type="text" value="" width="200px">
+<script>
+
+test(function() {
+    var elt = document.querySelector('#simple');
+    assert_array_equals(Object.getOwnPropertyNames(elt.attributes),
+        ['0','1','id','class']);
+}, "Object.getOwnPropertyNames on NamedNodeMap");
+
+test(function() {
+    var result = document.getElementById("result");
+    assert_array_equals(Object.getOwnPropertyNames(result.attributes),
+        ['0','1','2','3','id','type','value','width']);
+}, "Object.getOwnPropertyNames on NamedNodeMap of input");
+
+test(function() {
+    var result = document.getElementById("result");
+    result.removeAttribute("width");
+    assert_array_equals(Object.getOwnPropertyNames(result.attributes),
+        ['0','1','2','id','type','value']);
+}, "Object.getOwnPropertyNames on NamedNodeMap after attribute removal");
+
+</script>
\ No newline at end of file

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/w3c-import.log (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/w3c-import.log	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/collections/w3c-import.log	2016-02-03 21:54:36 UTC (rev 196079)
@@ -17,3 +17,5 @@
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-empty-name.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html
+/LayoutTests/imported/w3c/web-platform-tests/dom/collections/domstringmap-supported-property-names.html
+/LayoutTests/imported/w3c/web-platform-tests/dom/collections/namednodemap-supported-property-names.html

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped-expected.txt (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,3 @@
+
+PASS  Calling stopPropagation() prior to dispatchEvent()  
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title> Calling stopPropagation() prior to dispatchEvent() </title>
+<script src=""
+<script src=""
+</head>
+<body>
+<div id=log></div>
+
+<table id="table" border="1" style="display: none">
+    <tbody id="table-body">
+    <tr id="table-row">
+        <td id="table-cell">Shady Grove</td>
+        <td>Aeolian</td>
+    </tr>
+    <tr id="parent">
+        <td id="target">Over the river, Charlie</td>
+        <td>Dorian</td>
+    </tr>
+    </tbody>
+</table>
+
+<script>
+test(function() {
+    var event = "foo";
+    var target = document.getElementById("target");
+    var parent = document.getElementById("parent");
+    var tbody = document.getElementById("table-body");
+    var table = document.getElementById("table");
+    var body = document.body;
+    var html = document.documentElement;
+    var current_targets = [window, document, html, body, table, tbody, parent, target];
+    var expected_targets = [];
+    var actual_targets = [];
+    var expected_phases = [];
+    var actual_phases = [];
+
+    var test_event = function(evt) {
+        actual_targets.push(evt.currentTarget);
+        actual_phases.push(evt.eventPhase);
+    };
+
+    for (var i = 0; i < current_targets.length; ++i) {
+        current_targets[i].addEventListener(event, test_event, true);
+        current_targets[i].addEventListener(event, test_event, false);
+    }
+
+    var evt = document.createEvent("Event");
+    evt.initEvent(event, true, true);
+    evt.stopPropagation();
+    target.dispatchEvent(evt);
+
+    assert_array_equals(actual_targets, expected_targets, "actual_targets");
+    assert_array_equals(actual_phases, expected_phases, "actual_phases");
+});
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/w3c-import.log (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/w3c-import.log	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/w3c-import.log	2016-02-03 21:54:36 UTC (rev 196079)
@@ -21,6 +21,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-false.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-handlers-changed.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-omitted-capture.html
+/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-reenter.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-target-moved.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -7,6 +7,7 @@
 PASS Historical DOM features must be removed: DOMImplementationSource 
 PASS Historical DOM features must be removed: DOMLocator 
 PASS Historical DOM features must be removed: DOMObject 
+FAIL Historical DOM features must be removed: DOMSettableTokenList assert_equals: expected (undefined) undefined but got (object) object "[object DOMSettableTokenListConstructor]"
 PASS Historical DOM features must be removed: DOMUserData 
 PASS Historical DOM features must be removed: Entity 
 PASS Historical DOM features must be removed: EntityReference 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/historical.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -18,6 +18,7 @@
   "DOMImplementationSource",
   "DOMLocator",
   "DOMObject",
+  "DOMSettableTokenList",
   "DOMUserData",
   "Entity",
   "EntityReference",

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -19,7 +19,5 @@
 PASS Should be able to delete NodeFilter. 
 PASS Should be able to delete NodeList. 
 PASS Should be able to delete HTMLCollection. 
-PASS Should be able to delete DOMStringList. 
 PASS Should be able to delete DOMTokenList. 
-PASS Should be able to delete DOMSettableTokenList. 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interface-objects.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -31,9 +31,7 @@
   "NodeFilter",
   "NodeList",
   "HTMLCollection",
-  "DOMStringList",
-  "DOMTokenList",
-  "DOMSettableTokenList"
+  "DOMTokenList"
 ];
 test(function() {
   for (var p in window) {

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -707,7 +707,7 @@
 PASS Element interface: attribute tagName 
 PASS Element interface: attribute id 
 PASS Element interface: attribute className 
-PASS Element interface: attribute classList 
+FAIL Element interface: attribute classList assert_equals: setter must be function for PutForwards, Replaceable, or non-readonly attributes expected "function" but got "undefined"
 PASS Element interface: operation hasAttributes() 
 PASS Element interface: attribute attributes 
 FAIL Element interface: operation getAttribute(DOMString) assert_equals: property has wrong .length expected 1 but got 0
@@ -1557,6 +1557,9 @@
 PASS DOMTokenList interface: operation add(DOMString) 
 PASS DOMTokenList interface: operation remove(DOMString) 
 PASS DOMTokenList interface: operation toggle(DOMString,boolean) 
+FAIL DOMTokenList interface: operation replace(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "replace" missing
+FAIL DOMTokenList interface: operation supports(DOMString) assert_own_property: interface prototype object missing non-static operation expected property "supports" missing
+FAIL DOMTokenList interface: attribute value assert_true: The prototype object must have a property "value" expected true got false
 FAIL DOMTokenList interface: stringifier assert_true: property is not enumerable expected true got false
 PASS DOMTokenList must be primary interface of document.body.classList 
 PASS Stringification of document.body.classList 
@@ -1571,10 +1574,9 @@
 PASS DOMTokenList interface: calling remove(DOMString) on document.body.classList with too few arguments must throw TypeError 
 PASS DOMTokenList interface: document.body.classList must inherit property "toggle" with the proper type (5) 
 PASS DOMTokenList interface: calling toggle(DOMString,boolean) on document.body.classList with too few arguments must throw TypeError 
-FAIL DOMSettableTokenList interface: existence and properties of interface object assert_equals: class string of DOMSettableTokenList expected "[object Function]" but got "[object DOMSettableTokenListConstructor]"
-PASS DOMSettableTokenList interface object length 
-PASS DOMSettableTokenList interface object name 
-PASS DOMSettableTokenList interface: existence and properties of interface prototype object 
-PASS DOMSettableTokenList interface: existence and properties of interface prototype object's "constructor" property 
-PASS DOMSettableTokenList interface: attribute value 
+FAIL DOMTokenList interface: document.body.classList must inherit property "replace" with the proper type (6) assert_inherits: property "replace" not found in prototype chain
+FAIL DOMTokenList interface: calling replace(DOMString,DOMString) on document.body.classList with too few arguments must throw TypeError assert_inherits: property "replace" not found in prototype chain
+FAIL DOMTokenList interface: document.body.classList must inherit property "supports" with the proper type (7) assert_inherits: property "supports" not found in prototype chain
+FAIL DOMTokenList interface: calling supports(DOMString) on document.body.classList with too few arguments must throw TypeError assert_inherits: property "supports" not found in prototype chain
+FAIL DOMTokenList interface: document.body.classList must inherit property "value" with the proper type (8) assert_inherits: property "value" not found in prototype chain
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -283,7 +283,7 @@
 
            attribute DOMString id;
            attribute DOMString className;
-  [SameObject] readonly attribute DOMTokenList classList;
+  [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
 
   boolean hasAttributes();
   [SameObject] readonly attribute NamedNodeMap attributes;
@@ -460,13 +460,12 @@
   void add(DOMString... tokens);
   void remove(DOMString... tokens);
   boolean toggle(DOMString token, optional boolean force);
+  void replace(DOMString token, DOMString newToken);
+  boolean supports(DOMString token);
+           attribute DOMString value;
   stringifier;
 //  iterable<DOMString>;
 };
-
-interface DOMSettableTokenList : DOMTokenList {
-            attribute DOMString value;
-};
 </script>
 <script>
 "use strict";

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -337,4 +337,6 @@
 PASS createDocument test 178: "foo","bar",DocumentType node,null 
 PASS createDocument test 178: metadata for "foo","bar",DocumentType node 
 PASS createDocument test 178: characterSet aliases for "foo","bar",DocumentType node 
+FAIL createDocument with missing arguments assert_throws: createDocument() should throw function "function () {
+    document.implementation.createDocument(..." did not throw
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -120,4 +120,14 @@
     }
   })
 })
+
+test(function() {
+  assert_throws(new TypeError(), function() {
+    document.implementation.createDocument()
+  }, "createDocument() should throw")
+
+  assert_throws(new TypeError(), function() {
+    document.implementation.createDocument('')
+  }, "createDocument('') should throw")
+}, "createDocument with missing arguments");
 </script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -62,5 +62,5 @@
 PASS classList.add should treat \n as a space 
 PASS classList.add should treat \f as a space 
 PASS classList.length must be read-only 
-PASS classList must be read-only 
+FAIL classList must have [PutForwards=value] assert_equals: expected 2 but got 1
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -290,15 +290,13 @@
   assert_false(failed,'an error was thrown');
 }, 'classList.length must be read-only');
 test(function () {
-  var failed = false, realList = secondelem.classList;
-  try {
-    secondelem.classList = '';
-  } catch(e) {
-    failed = e;
-  }
+  var realList = secondelem.classList;
+  secondelem.classList = 'foo bar';
   assert_equals(secondelem.classList,realList);
-  assert_false(failed,'an error was thrown');
-}, 'classList must be read-only');
+  assert_equals(secondelem.classList.length,2);
+  assert_equals(secondelem.classList[0],'foo');
+  assert_equals(secondelem.classList[1],'bar');
+}, 'classList must have [PutForwards=value]');
     </script>
   </head>
   <body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,13 @@
+ Link text
+
+FAIL Should throw TypeError if the arguments are wrong. assert_throws: function "function () {
+    document.contains();
+  }" did not throw
+PASS contains(null) should be false 
+PASS document.contains 
+PASS contains with a button 
+PASS contains with a text node 
+PASS contains with a processing instruction 
+FAIL contains with a document fragment NotSupportedError: DOM Exception 9
+PASS contaibs with another document 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Node.nodeName</title>
+<link rel="author" title="Olli Pettay" href=""
+<link rel="author" title="Ms2ger" href=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"/>
+<div id="test">
+  <input type="button" id="testbutton"/>
+  <a id="link">Link text</a>
+</div>
+<script>
+<![CDATA[
+test(function() {
+  assert_throws(new TypeError(), function() {
+    document.contains();
+  });
+  assert_throws(new TypeError(), function() {
+    document.contains(9);
+  });
+}, "Should throw TypeError if the arguments are wrong.");
+
+test(function() {
+  assert_equals(document.contains(null), false, "Document shouldn't contain null.");
+}, "contains(null) should be false");
+
+test(function() {
+  assert_equals(document.contains(document), true, "Document should contain itself!");
+  assert_equals(document.contains(document.createElement("foo")), false, "Document shouldn't contain element which is't in the document");
+  assert_equals(document.contains(document.createTextNode("foo")), false, "Document shouldn't contain text node which is't in the document");
+}, "document.contains");
+
+test(function() {
+  var tb = document.getElementById("testbutton");
+  assert_equals(tb.contains(tb), true, "Element should contain itself.")
+  assert_equals(document.contains(tb), true, "Document should contain element in it!");
+  assert_equals(document.documentElement.contains(tb), true, "Element should contain element in it!");
+}, "contains with a button");
+
+test(function() {
+  var link = document.getElementById("link");
+  var text = link.firstChild;
+  assert_equals(document.contains(text), true, "Document should contain a text node in it.");
+  assert_equals(link.contains(text), true, "Element should contain a text node in it.");
+  assert_equals(text.contains(text), true, "Text node should contain itself.");
+  assert_equals(text.contains(link), false, "text node shouldn't contain its parent.");
+}, "contains with a text node");
+
+test(function() {
+  var pi = document.createProcessingInstruction("adf", "asd");
+  assert_equals(pi.contains(document), false, "Processing instruction shouldn't contain document");
+  assert_equals(document.contains(pi), false, "Document shouldn't contain newly created processing instruction");
+  document.documentElement.appendChild(pi);
+  document.contains(pi, true, "Document should contain processing instruction");
+}, "contains with a processing instruction");
+
+test(function() {
+  if ("createContextualFragment" in document.createRange()) {
+    var df = document.createRange().createContextualFragment("<div>foo</div>");
+    assert_equals(df.contains(df.firstChild), true, "Document fragment should contain its child");
+    assert_equals(df.contains(df.firstChild.firstChild), true,
+       "Document fragment should contain its descendant");
+    assert_equals(df.contains(df), true, "Document fragment should contain itself.");
+  }
+}, "contains with a document fragment");
+
+test(function() {
+  var d = document.implementation.createHTMLDocument("");
+  assert_equals(document.contains(d), false,
+     "Document shouldn't contain another document.");
+  assert_equals(document.contains(d.createElement("div")), false,
+     "Document shouldn't contain an element from another document.");
+  assert_equals(document.contains(d.documentElement), false,
+     "Document shouldn't contain an element from another document.");
+}, "contaibs with another document");
+]]>
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -1,17 +1,11 @@
- 
 
-PASS Node.isEqualNode 
-PASS Node.isEqualNode 1 
-PASS Node.isEqualNode 2 
-PASS Node.isEqualNode 3 
-PASS Node.isEqualNode 4 
-PASS Node.isEqualNode 5 
-PASS Node.isEqualNode 6 
-PASS isEqualNode should return true when the attributes are in a different order 
-PASS isEqualNode should return true if elements have same namespace, prefix, and local name 
-PASS isEqualNode should return false if elements have different namespace 
-PASS isEqualNode should return false if elements have different prefix 
-PASS isEqualNode should return false if elements have different local name 
-PASS isEqualNode should return true when the attributes have different prefixes 
-PASS isEqualNode should return true when only the internal subsets of DocumentTypes differ. 
+PASS doctypes should be compared on name, public ID, and system ID 
+PASS elements should be compared on namespace, namespace prefix, local name, and number of attributes 
+PASS elements should be compared on attribute namespace, local name, and value 
+PASS processing instructions should be compared on target and data 
+PASS text nodes should be compared on data 
+PASS comments should be compared on data 
+PASS document fragments should not be compared based on properties 
+FAIL documents should not be compared based on properties assert_true: default HTML documents, created different ways expected true got false
+PASS node equality testing should test descendant equality too 
 

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml-expected.txt (from rev 196078, trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt) (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,17 @@
+ 
+
+PASS Node.isEqualNode 
+PASS Node.isEqualNode 1 
+PASS Node.isEqualNode 2 
+PASS Node.isEqualNode 3 
+PASS Node.isEqualNode 4 
+PASS Node.isEqualNode 5 
+PASS Node.isEqualNode 6 
+PASS isEqualNode should return true when the attributes are in a different order 
+PASS isEqualNode should return true if elements have same namespace, prefix, and local name 
+PASS isEqualNode should return false if elements have different namespace 
+PASS isEqualNode should return false if elements have different prefix 
+PASS isEqualNode should return false if elements have different local name 
+PASS isEqualNode should return true when the attributes have different prefixes 
+PASS isEqualNode should return true when only the internal subsets of DocumentTypes differ. 
+

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml (from rev 196078, trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml) (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,84 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Node.isEqualNode</title>
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"/>
+<script>
+function testNullHandling(node) {
+  test(function() {
+    assert_false(node.isEqualNode(null))
+    assert_false(node.isEqualNode(undefined))
+  })
+}
+[
+  document.createElement("foo"),
+  document.createTextNode("foo"),
+  document.createProcessingInstruction("foo", "bar"),
+  document.createComment("foo"),
+  document,
+  document.implementation.createDocumentType("html", "", ""),
+  document.createDocumentFragment()
+].forEach(testNullHandling)
+
+test(function() {
+  var a = document.createElement("foo")
+  a.setAttribute("a", "bar")
+  a.setAttribute("b", "baz")
+  var b = document.createElement("foo")
+  b.setAttribute("b", "baz")
+  b.setAttribute("a", "bar")
+  assert_true(a.isEqualNode(b))
+}, "isEqualNode should return true when the attributes are in a different order")
+
+test(function() {
+  var a = document.createElementNS("ns", "prefix:foo")
+  var b = document.createElementNS("ns", "prefix:foo")
+  assert_true(a.isEqualNode(b))
+}, "isEqualNode should return true if elements have same namespace, prefix, and local name")
+
+test(function() {
+  var a = document.createElementNS("ns1", "prefix:foo")
+  var b = document.createElementNS("ns2", "prefix:foo")
+  assert_false(a.isEqualNode(b))
+}, "isEqualNode should return false if elements have different namespace")
+
+test(function() {
+  var a = document.createElementNS("ns", "prefix1:foo")
+  var b = document.createElementNS("ns", "prefix2:foo")
+  assert_false(a.isEqualNode(b))
+}, "isEqualNode should return false if elements have different prefix")
+
+test(function() {
+  var a = document.createElementNS("ns", "prefix:foo1")
+  var b = document.createElementNS("ns", "prefix:foo2")
+  assert_false(a.isEqualNode(b))
+}, "isEqualNode should return false if elements have different local name")
+
+test(function() {
+  var a = document.createElement("foo")
+  a.setAttributeNS("ns", "x:a", "bar")
+  var b = document.createElement("foo")
+  b.setAttributeNS("ns", "y:a", "bar")
+  assert_true(a.isEqualNode(b))
+}, "isEqualNode should return true when the attributes have different prefixes")
+var internalSubset = async_test("isEqualNode should return true when only the internal subsets of DocumentTypes differ.")
+var wait = 2;
+function iframeLoaded() {
+  if (!--wait) {
+    internalSubset.step(function() {
+      var doc1 = document.getElementById("subset1").contentDocument
+      var doc2 = document.getElementById("subset2").contentDocument
+      assert_true(doc1.doctype.isEqualNode(doc2.doctype), "doc1.doctype.isEqualNode(doc2.doctype)")
+      assert_true(doc1.isEqualNode(doc2), "doc1.isEqualNode(doc2)")
+    })
+    internalSubset.done()
+  }
+}
+</script>
+<iframe id="subset1" _onload_="iframeLoaded()" src="" />
+<iframe id="subset2" _onload_="iframeLoaded()" src="" />
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.html (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,161 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Node.prototype.isEqualNode</title>
+<link rel=help href=""
+<script src=""
+<script src=""
+
+<script>
+"use strict";
+
+test(function() {
+
+  var doctype1 = document.implementation.createDocumentType("qualifiedName", "publicId", "systemId");
+  var doctype2 = document.implementation.createDocumentType("qualifiedName", "publicId", "systemId");
+  var doctype3 = document.implementation.createDocumentType("qualifiedName2", "publicId", "systemId");
+  var doctype4 = document.implementation.createDocumentType("qualifiedName", "publicId2", "systemId");
+  var doctype5 = document.implementation.createDocumentType("qualifiedName", "publicId", "systemId3");
+
+  assert_true(doctype1.isEqualNode(doctype1), "self-comparison");
+  assert_true(doctype1.isEqualNode(doctype2), "same properties");
+  assert_false(doctype1.isEqualNode(doctype3), "different name");
+  assert_false(doctype1.isEqualNode(doctype4), "different public ID");
+  assert_false(doctype1.isEqualNode(doctype5), "different system ID");
+
+}, "doctypes should be compared on name, public ID, and system ID");
+
+test(function() {
+
+  var element1 = document.createElementNS("namespace", "prefix:localName");
+  var element2 = document.createElementNS("namespace", "prefix:localName");
+  var element3 = document.createElementNS("namespace2", "prefix:localName");
+  var element4 = document.createElementNS("namespace", "prefix2:localName");
+  var element5 = document.createElementNS("namespace", "prefix:localName2");
+
+  var element6 = document.createElementNS("namespace", "prefix:localName");
+  element6.setAttribute("foo", "bar");
+
+  assert_true(element1.isEqualNode(element1), "self-comparison");
+  assert_true(element1.isEqualNode(element2), "same properties");
+  assert_false(element1.isEqualNode(element3), "different namespace");
+  assert_false(element1.isEqualNode(element4), "different prefix");
+  assert_false(element1.isEqualNode(element5), "different local name");
+  assert_false(element1.isEqualNode(element6), "different number of attributes");
+
+}, "elements should be compared on namespace, namespace prefix, local name, and number of attributes");
+
+test(function() {
+
+  var element1 = document.createElement("element");
+  element1.setAttributeNS("namespace", "prefix:localName", "value");
+
+  var element2 = document.createElement("element");
+  element2.setAttributeNS("namespace", "prefix:localName", "value");
+
+  var element3 = document.createElement("element");
+  element3.setAttributeNS("namespace2", "prefix:localName", "value");
+
+  var element4 = document.createElement("element");
+  element4.setAttributeNS("namespace", "prefix2:localName", "value");
+
+  var element5 = document.createElement("element");
+  element5.setAttributeNS("namespace", "prefix:localName2", "value");
+
+  var element6 = document.createElement("element");
+  element6.setAttributeNS("namespace", "prefix:localName", "value2");
+
+  assert_true(element1.isEqualNode(element1), "self-comparison");
+  assert_true(element1.isEqualNode(element2), "attribute with same properties");
+  assert_false(element1.isEqualNode(element3), "attribute with different namespace");
+  assert_true(element1.isEqualNode(element4), "attribute with different prefix");
+  assert_false(element1.isEqualNode(element5), "attribute with different local name");
+  assert_false(element1.isEqualNode(element6), "attribute with different value");
+
+}, "elements should be compared on attribute namespace, local name, and value");
+
+test(function() {
+
+  var pi1 = document.createProcessingInstruction("target", "data");
+  var pi2 = document.createProcessingInstruction("target", "data");
+  var pi3 = document.createProcessingInstruction("target2", "data");
+  var pi4 = document.createProcessingInstruction("target", "data2");
+
+  assert_true(pi1.isEqualNode(pi1), "self-comparison");
+  assert_true(pi1.isEqualNode(pi2), "same properties");
+  assert_false(pi1.isEqualNode(pi3), "different target");
+  assert_false(pi1.isEqualNode(pi4), "different data");
+
+}, "processing instructions should be compared on target and data");
+
+test(function() {
+
+  var text1 = document.createTextNode("data");
+  var text2 = document.createTextNode("data");
+  var text3 = document.createTextNode("data2");
+
+  assert_true(text1.isEqualNode(text1), "self-comparison");
+  assert_true(text1.isEqualNode(text2), "same properties");
+  assert_false(text1.isEqualNode(text3), "different data");
+
+}, "text nodes should be compared on data");
+
+test(function() {
+
+  var comment1 = document.createComment("data");
+  var comment2 = document.createComment("data");
+  var comment3 = document.createComment("data2");
+
+  assert_true(comment1.isEqualNode(comment1), "self-comparison");
+  assert_true(comment1.isEqualNode(comment2), "same properties");
+  assert_false(comment1.isEqualNode(comment3), "different data");
+
+}, "comments should be compared on data");
+
+test(function() {
+
+  var documentFragment1 = document.createDocumentFragment();
+  var documentFragment2 = document.createDocumentFragment();
+
+  assert_true(documentFragment1.isEqualNode(documentFragment1), "self-comparison");
+  assert_true(documentFragment1.isEqualNode(documentFragment2), "same properties");
+
+}, "document fragments should not be compared based on properties");
+
+test(function() {
+
+  var document1 = document.implementation.createDocument("", "");
+  var document2 = document.implementation.createDocument("", "");
+
+  assert_true(document1.isEqualNode(document1), "self-comparison");
+  assert_true(document1.isEqualNode(document2), "another empty XML document");
+
+  var htmlDoctype = document.implementation.createDocumentType("html", "", "");
+  var document3 = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", htmlDoctype);
+  document3.documentElement.appendChild(document3.createElement("head"));
+  document3.documentElement.appendChild(document3.createElement("body"));
+  var document4 = document.implementation.createHTMLDocument();
+  assert_true(document3.isEqualNode(document4), "default HTML documents, created different ways");
+
+}, "documents should not be compared based on properties");
+
+test(function() {
+
+  testDeepEquality(function() { return document.createElement("foo") });
+  testDeepEquality(function() { return document.createDocumentFragment() });
+  testDeepEquality(function() { return document.implementation.createDocument("", "") });
+  testDeepEquality(function() { return document.implementation.createHTMLDocument() });
+
+  function testDeepEquality(parentFactory) {
+    // Some ad-hoc tests of deep equality
+
+    var parentA = parentFactory();
+    var parentB = parentFactory();
+
+    parentA.appendChild(document.createComment("data"));
+    assert_false(parentA.isEqualNode(parentB));
+    parentB.appendChild(document.createComment("data"));
+    assert_true(parentA.isEqualNode(parentB));
+  }
+
+}, "node equality testing should test descendant equality too");
+</script>

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml	2016-02-03 21:54:36 UTC (rev 196079)
@@ -1,84 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Node.isEqualNode</title>
-<script src=""
-<script src=""
-</head>
-<body>
-<div id="log"/>
-<script>
-function testNullHandling(node) {
-  test(function() {
-    assert_false(node.isEqualNode(null))
-    assert_false(node.isEqualNode(undefined))
-  })
-}
-[
-  document.createElement("foo"),
-  document.createTextNode("foo"),
-  document.createProcessingInstruction("foo", "bar"),
-  document.createComment("foo"),
-  document,
-  document.implementation.createDocumentType("html", "", ""),
-  document.createDocumentFragment()
-].forEach(testNullHandling)
-
-test(function() {
-  var a = document.createElement("foo")
-  a.setAttribute("a", "bar")
-  a.setAttribute("b", "baz")
-  var b = document.createElement("foo")
-  b.setAttribute("b", "baz")
-  b.setAttribute("a", "bar")
-  assert_true(a.isEqualNode(b))
-}, "isEqualNode should return true when the attributes are in a different order")
-
-test(function() {
-  var a = document.createElementNS("ns", "prefix:foo")
-  var b = document.createElementNS("ns", "prefix:foo")
-  assert_true(a.isEqualNode(b))
-}, "isEqualNode should return true if elements have same namespace, prefix, and local name")
-
-test(function() {
-  var a = document.createElementNS("ns1", "prefix:foo")
-  var b = document.createElementNS("ns2", "prefix:foo")
-  assert_false(a.isEqualNode(b))
-}, "isEqualNode should return false if elements have different namespace")
-
-test(function() {
-  var a = document.createElementNS("ns", "prefix1:foo")
-  var b = document.createElementNS("ns", "prefix2:foo")
-  assert_false(a.isEqualNode(b))
-}, "isEqualNode should return false if elements have different prefix")
-
-test(function() {
-  var a = document.createElementNS("ns", "prefix:foo1")
-  var b = document.createElementNS("ns", "prefix:foo2")
-  assert_false(a.isEqualNode(b))
-}, "isEqualNode should return false if elements have different local name")
-
-test(function() {
-  var a = document.createElement("foo")
-  a.setAttributeNS("ns", "x:a", "bar")
-  var b = document.createElement("foo")
-  b.setAttributeNS("ns", "y:a", "bar")
-  assert_true(a.isEqualNode(b))
-}, "isEqualNode should return true when the attributes have different prefixes")
-var internalSubset = async_test("isEqualNode should return true when only the internal subsets of DocumentTypes differ.")
-var wait = 2;
-function iframeLoaded() {
-  if (!--wait) {
-    internalSubset.step(function() {
-      var doc1 = document.getElementById("subset1").contentDocument
-      var doc2 = document.getElementById("subset2").contentDocument
-      assert_true(doc1.doctype.isEqualNode(doc2.doctype), "doc1.doctype.isEqualNode(doc2.doctype)")
-      assert_true(doc1.isEqualNode(doc2), "doc1.isEqualNode(doc2)")
-    })
-    internalSubset.done()
-  }
-}
-</script>
-<iframe id="subset1" _onload_="iframeLoaded()" src="" />
-<iframe id="subset2" _onload_="iframeLoaded()" src="" />
-</body>
-</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -1,5 +1,5 @@
 
-FAIL AttrExodus assert_false: expected false got true
+FAIL AttrExodus assert_false: should not be a Node expected false got true
 PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttribute) 
 PASS setAttribute should lowercase its name argument (upper case attribute) 
 PASS setAttribute should lowercase its name argument (mixed case attribute) 
@@ -39,11 +39,19 @@
 PASS Basic functionality of getAttributeNode/getAttributeNodeNS 
 PASS Basic functionality of setAttributeNode 
 PASS Basic functionality of setAttributeNodeNS 
+FAIL If attr’s element is neither null nor element, throw an InUseAttributeError. Test bug: unrecognized DOMException code "INUSE_ATTRIBUTE_ERR" passed to assert_throws()
+PASS Replacing an attr by itself 
 PASS Basic functionality of removeAttributeNode 
 FAIL setAttributeNode on bound attribute should throw InUseAttributeError Test bug: unrecognized DOMException code "INUSE_ATTRIBUTE_ERR" passed to assert_throws()
+PASS setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute 
+PASS setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute (outer shell) 
+PASS setAttributeNode called with an Attr that has the same name as an existing one should not change attribute order 
 FAIL getAttributeNames tests el.getAttributeNames is not a function. (In 'el.getAttributeNames()', 'el.getAttributeNames' is undefined)
 FAIL Own property correctness with basic attributes assert_array_equals: lengths differ, expected 2 got 3
 FAIL Own property correctness with non-namespaced attribute before same-name namespaced one assert_array_equals: lengths differ, expected 3 got 4
 FAIL Own property correctness with namespaced attribute before same-name non-namespaced one assert_array_equals: lengths differ, expected 3 got 4
 FAIL Own property correctness with two namespaced attributes with the same name-with-prefix assert_array_equals: lengths differ, expected 3 got 4
+FAIL Own property names should only include all-lowercase qualified names for an HTML element in an HTML document assert_array_equals: lengths differ, expected 8 got 7
+FAIL Own property names should include all qualified names for a non-HTML element in an HTML document assert_array_equals: lengths differ, expected 12 got 7
+FAIL Own property names should include all qualified names for an HTML element in a non-HTML document assert_array_equals: lengths differ, expected 12 got 7
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes.html (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes.html	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -19,12 +19,17 @@
 test(function() {
   document.body.setAttribute("abc", "pass")
   var attr = document.body.attributes[0]
-  assert_true(attr instanceof Attr)
-  assert_false(attr instanceof Node)
-  assert_throws(new TypeError(), function() { attr.appendChild(document.createTextNode("fail")) })
-  assert_throws(new TypeError(), function() { attr.appendChild(null) })
+  assert_true(attr instanceof Attr, "should be an Attr")
+  assert_false(attr instanceof Node, "should not be a Node")
+  var removed_members = [
+    "appendChild",
+    "insertBefore",
+    "childNodes",
+  ]
+  removed_members.forEach(function(m) {
+    assert_false(m in attr, m + " should not be supported")
+  })
   assert_equals(attr.value, "pass")
-  assert_false("childNodes" in attr, "Should not have childNodes")
 }, "AttrExodus")
 
 // setAttribute exhaustive tests
@@ -442,6 +447,26 @@
 }, "Basic functionality of setAttributeNodeNS")
 
 test(function() {
+  var el = document.createElement("div");
+  var other = document.createElement("div");
+  attr = document.createAttribute("foo");
+  assert_equals(el.setAttributeNode(attr), null);
+  assert_equals(attr.ownerElement, el);
+  assert_throws("INUSE_ATTRIBUTE_ERR",
+                  function() { other.setAttributeNode(attr) },
+                  "Attribute already associated with el")
+}, "If attr’s element is neither null nor element, throw an InUseAttributeError.");
+
+test(function() {
+  var el = document.createElement("div");
+  attr = document.createAttribute("foo");
+  assert_equals(el.setAttributeNode(attr), null);
+  el.setAttribute("bar", "qux");
+  assert_equals(el.setAttributeNode(attr), attr);
+  assert_equals(el.attributes[0], attr);
+}, "Replacing an attr by itself");
+
+test(function() {
   var el = document.createElement("div")
   el.setAttribute("foo", "bar")
   var attrNode = el.getAttributeNode("foo");
@@ -460,6 +485,60 @@
   assert_throws("INUSE_ATTRIBUTE_ERR", function(){el2.setAttributeNode(attrNode)});
 }, "setAttributeNode on bound attribute should throw InUseAttributeError")
 
+// Have to use an async_test to see what a DOMAttrModified listener sees,
+// because otherwise the event dispatch code will swallow our exceptions.  And
+// we want to make sure this test always happens, even when no mutation events
+// run.
+var setAttributeNode_mutation_test = async_test("setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute");
+
+test(function(){
+  var el = document.createElement("div")
+  var attrNode1 = document.createAttribute("foo");
+  attrNode1.value = "bar";
+  el.setAttributeNode(attrNode1);
+  var attrNode2 = document.createAttribute("foo");
+  attrNode2.value = "baz";
+
+  el.addEventListener("DOMAttrModified", function(e) {
+    // If this never gets called, that's OK, I guess.  But if it gets called, it
+    // better represent a single modification with attrNode2 as the relatedNode.
+    // We have to do an inner test() call here, because otherwise the exceptions
+    // our asserts trigger will get swallowed by the event dispatch code.
+    setAttributeNode_mutation_test.step(function() {
+      assert_equals(e.attrName, "foo");
+      assert_equals(e.attrChange, MutationEvent.MODIFICATION);
+      assert_equals(e.prevValue, "bar");
+      assert_equals(e.newValue, "baz");
+      assert_equals(e.relatedNode, attrNode2);
+    });
+  });
+
+  var oldNode = el.setAttributeNode(attrNode2);
+  assert_equals(oldNode, attrNode1,
+                "Must return the old attr node from a setAttributeNode call");
+}, "setAttributeNode, if it fires mutation events, should fire one with the new node when resetting an existing attribute (outer shell)");
+setAttributeNode_mutation_test.done();
+
+test(function(){
+  var el = document.createElement("div")
+  el.setAttribute("a", "b");
+  el.setAttribute("c", "d");
+
+  assert_array_equals(Array.prototype.map.call(el.attributes, function(a) { return a.name }),
+                      ["a", "c"]);
+  assert_array_equals(Array.prototype.map.call(el.attributes, function(a) { return a.value }),
+                      ["b", "d"]);
+
+  var attrNode = document.createAttribute("a");
+  attrNode.value = "e";
+  el.setAttributeNode(attrNode);
+
+  assert_array_equals(Array.prototype.map.call(el.attributes, function(a) { return a.name }),
+                      ["a", "c"]);
+  assert_array_equals(Array.prototype.map.call(el.attributes, function(a) { return a.value }),
+                      ["e", "d"]);
+}, "setAttributeNode called with an Attr that has the same name as an existing one should not change attribute order");
+
 test(function() {
   var el = document.createElement("div");
   el.setAttribute("foo", "bar");
@@ -532,6 +611,10 @@
                       ["0", "1", "2"])
   assert_array_equals(Object.getOwnPropertyNames(el.attributes),
                       ["0", "1", "2", "a", "b"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
 }, "Own property correctness with non-namespaced attribute before same-name namespaced one");
 
 test(function() {
@@ -545,6 +628,10 @@
                       ["0", "1", "2"])
   assert_array_equals(Object.getOwnPropertyNames(el.attributes),
                       ["0", "1", "2", "a", "b"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
 }, "Own property correctness with namespaced attribute before same-name non-namespaced one");
 
 test(function() {
@@ -558,5 +645,59 @@
                       ["0", "1", "2"])
   assert_array_equals(Object.getOwnPropertyNames(el.attributes),
                       ["0", "1", "2", "a:b", "c:d"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
 }, "Own property correctness with two namespaced attributes with the same name-with-prefix");
+
+test(function() {
+  var el = document.createElement("div");
+  el.setAttributeNS("foo", "A:B", "");
+  el.setAttributeNS("bar", "c:D", "");
+  el.setAttributeNS("baz", "e:F", "");
+  el.setAttributeNS("qux", "g:h", "");
+  el.setAttributeNS("", "I", "");
+  el.setAttributeNS("", "j", "");
+  assert_array_equals(Object.getOwnPropertyNames(el.attributes),
+                      ["0", "1", "2", "3", "4", "5", "g:h", "j"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
+}, "Own property names should only include all-lowercase qualified names for an HTML element in an HTML document");
+
+test(function() {
+  var el = document.createElementNS("", "div");
+  el.setAttributeNS("foo", "A:B", "");
+  el.setAttributeNS("bar", "c:D", "");
+  el.setAttributeNS("baz", "e:F", "");
+  el.setAttributeNS("qux", "g:h", "");
+  el.setAttributeNS("", "I", "");
+  el.setAttributeNS("", "j", "");
+  assert_array_equals(Object.getOwnPropertyNames(el.attributes),
+                      ["0", "1", "2", "3", "4", "5", "A:B", "c:D", "e:F", "g:h", "I", "j"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
+}, "Own property names should include all qualified names for a non-HTML element in an HTML document");
+
+test(function() {
+  var doc = document.implementation.createDocument(null, "");
+  assert_equals(doc.contentType, "application/xml");
+  var el = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
+  el.setAttributeNS("foo", "A:B", "");
+  el.setAttributeNS("bar", "c:D", "");
+  el.setAttributeNS("baz", "e:F", "");
+  el.setAttributeNS("qux", "g:h", "");
+  el.setAttributeNS("", "I", "");
+  el.setAttributeNS("", "j", "");
+  assert_array_equals(Object.getOwnPropertyNames(el.attributes),
+                      ["0", "1", "2", "3", "4", "5", "A:B", "c:D", "e:F", "g:h", "I", "j"])
+  for (var propName of Object.getOwnPropertyNames(el.attributes)) {
+    assert_true(el.attributes[propName] instanceof Attr,
+                "el.attributes has an Attr for property name " + propName);
+  }
+}, "Own property names should include all qualified names for an HTML element in a non-HTML document");
 </script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/w3c-import.log (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/w3c-import.log	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/w3c-import.log	2016-02-03 21:54:36 UTC (rev 196079)
@@ -114,9 +114,11 @@
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-compareDocumentPosition.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-constants.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains.html
+/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-contains.xml
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-insertBefore.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-iframe1.xml
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-iframe2.xml
+/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-lookupNamespaceURI.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-lookupPrefix.xhtml

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor-expected.txt (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor-expected.txt	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,3 @@
+
+PASS Range constructor test 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor.html (0 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor.html	2016-02-03 21:54:36 UTC (rev 196079)
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Range constructor test</title>
+<link rel="author" title="Aryeh Gregor" href=""
+<div id=log></div>
+<script src=""
+<script src=""
+<script>
+"use strict";
+
+test(function() {
+    var range = new Range();
+    assert_equals(range.startContainer, document, "startContainer");
+    assert_equals(range.endContainer, document, "endContainer");
+    assert_equals(range.startOffset, 0, "startOffset");
+    assert_equals(range.endOffset, 0, "endOffset");
+    assert_true(range.collapsed, "collapsed");
+    assert_equals(range.commonAncestorContainer, document,
+                  "commonAncestorContainer");
+});
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/w3c-import.log (196078 => 196079)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/w3c-import.log	2016-02-03 21:26:33 UTC (rev 196078)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/w3c-import.log	2016-02-03 21:54:36 UTC (rev 196079)
@@ -24,6 +24,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-compareBoundaryPoints.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-comparePoint-2.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-comparePoint.html
+/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-constructor.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-deleteContents.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-detach.html
 /LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-extractContents.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to