Changeset 206463 in webkit
- Timestamp:
- Sep 27, 2016 2:04:15 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 32 added
- 2 deleted
- 4 edited
- 29 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206461 r206463 1 2016-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Import w3c shadow DOM tests and fix one assertion 4 https://bugs.webkit.org/show_bug.cgi?id=162629 5 6 Reviewed by Chris Dumez. 7 8 Deleted the duplicated copies of tests in fast/shadow/ since this patch re-imports them via web-platform-tests. 9 10 * fast/shadow-dom/Element-interface-attachShadow-expected.txt: Removed. 11 * fast/shadow-dom/Node-prototype-cloneNode-expected.txt: Removed. 12 1 13 2016-09-27 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r206462 r206463 1 2016-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Import w3c shadow DOM tests and fix one assertion 4 https://bugs.webkit.org/show_bug.cgi?id=162629 5 6 Reviewed by Chris Dumez. 7 8 Import shadow DOM tests in web-platform-tests as of 7163d6eeed81e9e020545fbe0c4b11fc2c5963cd 9 except untriaged tests for v0 API, which we obviously don't implement. 10 11 Most of these tests are the ones we upstreamed from fast/shadow-dom/. 12 13 * web-platform-tests/shadow-dom/Document-prototype-adoptNode-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-adoptNode-expected.txt. 14 * web-platform-tests/shadow-dom/Document-prototype-adoptNode.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-adoptNode.html. 15 * web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-currentScript-expected.txt. 16 * web-platform-tests/shadow-dom/Document-prototype-currentScript.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-currentScript.html. 17 * web-platform-tests/shadow-dom/Document-prototype-importNode-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-importNode-expected.txt. 18 * web-platform-tests/shadow-dom/Document-prototype-importNode.html: Renamed from LayoutTests/fast/shadow-dom/Document-prototype-importNode.html. 19 * web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt: Added. 20 * web-platform-tests/shadow-dom/Element-interface-attachShadow.html: Renamed from LayoutTests/fast/shadow-dom/Element-interface-attachShadow.html. 21 * web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Element-interface-shadowRoot-attribute-expected.txt. 22 * web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute.html: Renamed from LayoutTests/fast/shadow-dom/Element-interface-shadowRoot-attribute.html. 23 * web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface-expected.txt. 24 * web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html: Renamed from LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface.html. 25 * web-platform-tests/shadow-dom/HTMLSlotElement-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/HTMLSlotElement-interface-expected.txt. 26 * web-platform-tests/shadow-dom/HTMLSlotElement-interface.html: Renamed from LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html. 27 * web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY-expected.txt: Renamed from LayoutTests/fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY-expected.txt. 28 * web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html: Renamed from LayoutTests/fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html. 29 * web-platform-tests/shadow-dom/Node-prototype-cloneNode-expected.txt: Added. 30 * web-platform-tests/shadow-dom/Node-prototype-cloneNode.html: Renamed from LayoutTests/fast/shadow-dom/Node-prototype-cloneNode.html. 31 * web-platform-tests/shadow-dom/OWNERS: Added. 32 * web-platform-tests/shadow-dom/ShadowRoot-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/ShadowRoot-interface-expected.txt. 33 * web-platform-tests/shadow-dom/ShadowRoot-interface.html: Renamed from LayoutTests/fast/shadow-dom/ShadowRoot-interface.html. 34 * web-platform-tests/shadow-dom/Slotable-interface-expected.txt: Renamed from LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt. 35 * web-platform-tests/shadow-dom/Slotable-interface.html: Renamed from LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html. 36 * web-platform-tests/shadow-dom/event-composed-expected.txt: Added. 37 * web-platform-tests/shadow-dom/event-composed-path-expected.txt: Added. 38 * web-platform-tests/shadow-dom/event-composed-path-with-related-target-expected.txt: Added. 39 * web-platform-tests/shadow-dom/event-composed-path-with-related-target.html: Added. 40 * web-platform-tests/shadow-dom/event-composed-path.html: Added. 41 * web-platform-tests/shadow-dom/event-composed.html: Added. 42 * web-platform-tests/shadow-dom/event-inside-shadow-tree-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-inside-shadow-tree-expected.txt. 43 * web-platform-tests/shadow-dom/event-inside-shadow-tree.html: Renamed from LayoutTests/fast/shadow-dom/event-inside-shadow-tree.html. 44 * web-platform-tests/shadow-dom/event-inside-slotted-node-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-inside-slotted-node-expected.txt. 45 * web-platform-tests/shadow-dom/event-inside-slotted-node.html: Renamed from LayoutTests/fast/shadow-dom/event-inside-slotted-node.html. 46 * web-platform-tests/shadow-dom/event-with-related-target-expected.txt: Renamed from LayoutTests/fast/shadow-dom/event-with-related-target-expected.txt. 47 * web-platform-tests/shadow-dom/event-with-related-target.html: Renamed from LayoutTests/fast/shadow-dom/event-with-related-target.html. 48 * web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt: Added. 49 * web-platform-tests/shadow-dom/leaktests/get-elements.html: Added. 50 * web-platform-tests/shadow-dom/leaktests/html-collection-expected.txt: Added. 51 * web-platform-tests/shadow-dom/leaktests/html-collection.html: Added. 52 * web-platform-tests/shadow-dom/leaktests/w3c-import.log: Added. 53 * web-platform-tests/shadow-dom/leaktests/window-frames-expected.txt: Added. 54 * web-platform-tests/shadow-dom/leaktests/window-frames.html: Added. 55 * web-platform-tests/shadow-dom/resources/Document-prototype-currentScript-helper.js: Renamed from LayoutTests/fast/shadow-dom/resources/Document-prototype-currentScript-helper.js. 56 * web-platform-tests/shadow-dom/resources/event-path-test-helpers.js: Added. 57 * web-platform-tests/shadow-dom/resources/shadow-dom-utils.js: Added. 58 * web-platform-tests/shadow-dom/resources/shadow-dom.js: Added. 59 * web-platform-tests/shadow-dom/resources/w3c-import.log: Added. 60 * web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree-expected.txt: Added. 61 * web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html: Added. 62 * web-platform-tests/shadow-dom/slotchange-event-expected.txt: Renamed from LayoutTests/fast/shadow-dom/slotchange-event-expected.txt. 63 * web-platform-tests/shadow-dom/slotchange-event.html: Renamed from LayoutTests/fast/shadow-dom/slotchange-event.html. 64 * web-platform-tests/shadow-dom/slotchange-expected.txt: Added. 65 * web-platform-tests/shadow-dom/slotchange.html: Added. 66 * web-platform-tests/shadow-dom/slots-expected.txt: Added. 67 * web-platform-tests/shadow-dom/slots-fallback-expected.txt: Added. 68 * web-platform-tests/shadow-dom/slots-fallback.html: Added. 69 * web-platform-tests/shadow-dom/slots.html: Added. 70 * web-platform-tests/shadow-dom/w3c-import.log: Added. 71 1 72 2016-09-27 Chris Dumez <cdumez@apple.com> 2 73 -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-adoptNode.html
r206462 r206463 6 6 <meta name="assert" content="The adoptNode(node) method must throw a HierarchyRequestError exception if node is a shadow root."> 7 7 <link rel="help" href="https://dom.spec.whatwg.org/#dom-document-adoptnode"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt
r206462 r206463 1 CONSOLE MESSAGE: line 2422: Error: assert_equals: expected null but got Element node <script id="outerScriptElement"> 2 3 var outerScriptElement ... 4 CONSOLE MESSAGE: line 2422: Error: assert_equals: expected null but got Element node <script id="outerScriptElement"> 5 6 var outerScriptElement ... 7 8 Harness Error (FAIL), message = Error: assert_equals: expected null but got Element node <script id="outerScriptElement"> 9 10 var outerScriptElement ... 1 11 2 12 PASS document.currentScript must not to be set to a script element in a shadow tree in open mode -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html
r206462 r206463 2 2 <html> 3 3 <head> 4 <title> DOM and Shadow DOM: Document.prototype.adoptNode</title>4 <title>HTML: Document.prototype.currentScript</title> 5 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> 6 6 <meta name="assert" content="If the script element is in a document, then set the script element's node document's currentScript attribute to the script element."> 7 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> … … 22 21 var shadowRoot = host.attachShadow({mode: mode}); 23 22 var scriptElement = document.createElement('script'); 24 scriptElement.textContent = 'assert_equals(document.currentScript, outerScriptElement)';23 scriptElement.textContent = 'assert_equals(document.currentScript, null)'; 25 24 shadowRoot.appendChild(scriptElement); 26 25 … … 43 42 var testCase = asyncScriptTests.shift(); 44 43 var mode = testCase.mode; 45 var remove = testCase.mode;46 44 if (!testCase) 47 45 return; -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-importNode.html
r206462 r206463 6 6 <meta name="assert" content="The importNode(node, deep) method must throw a NotSupportedError exception if node is a shadow root."> 7 7 <link rel="help" href="https://dom.spec.whatwg.org/#dom-document-importnode"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow.html
r206462 r206463 6 6 <meta name="assert" content="Element.prototype.attachShadow should create an instance of ShadowRoot"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> … … 79 78 }, 'Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree'); 80 79 81 var htmlElementNames = ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi',82 'bdo', 'bgsound', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',83 'command', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption',84 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr',85 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'layer', 'legend', 'li', 'link', 'listing',86 'main', 'map', 'mark', 'marquee', 'menu', 'meta', 'meter', 'nav', 'nobr', 'noembed', 'noframes', 'nolayer', 'object', 'ol', 'optgroup',87 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script',88 'section', 'select', 'slot', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td',89 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp', 'noscript'];90 var allowingAttachShadow = ["article", "aside", "blockquote", "body", "div", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header", "nav", "p", "section", "span"];91 92 80 test(function () { 93 for (var elementName of htmlElementNames) { 94 if (allowingAttachShadow.indexOf(elementName) >= 0) 95 continue; 96 81 for (var elementName of ['button', 'details', 'input', 'marquee', 'meter', 'progress', 'select', 'textarea', 'keygen']) { 97 82 assert_throws({'name': 'NotSupportedError'}, function () { 98 83 document.createElement(elementName).attachShadow({mode: "open"}); … … 103 88 }, 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' element must throw'); 104 89 } 105 }, 'Element.attachShadow must throw a NotSupportedError on HTML elements whose local name is not one of ' + allowingAttachShadow.join(', ')); 106 107 test(function () { 108 for (var elementName of allowingAttachShadow) { 109 assert_true(document.createElement(elementName).attachShadow({mode: "open"}) instanceof ShadowRoot, 110 'Calling attachShadow({mode: "open"}) on ' + elementName + ' element must not throw'); 111 112 assert_true(document.createElement(elementName).attachShadow({mode: "closed"}) instanceof ShadowRoot, 113 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' element must not throw'); 114 } 115 }, 'Element.attachShadow must not throw a NotSupportedError on ' + allowingAttachShadow.join(', ')); 116 117 test(function () { 118 assert_throws({'name': 'NotSupportedError'}, function () { 119 document.createElement('w3cfutureelement').attachShadow({mode: "open"}); 120 }, 'Calling attachShadow({mode: "open"}) on a HTML element whose local name is "w3cfutureelement" must throw'); 121 122 assert_throws({'name': 'NotSupportedError'}, function () { 123 document.createElement('w3cfutureelement').attachShadow({mode: "closed"}); 124 }, 'Calling attachShadow({mode: "closed"}) on a HTML element whose local name is "w3cfutureelement" must throw'); 125 126 }, 'Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which does not have a valid custom element'); 127 128 test(function () { 129 assert_true(document.createElement('custom-element').attachShadow({mode: "open"}) instanceof ShadowRoot, 130 'Calling attachShadow({mode: "open"}) on a HTML element whose local name is "custom-element" element must not throw'); 131 132 assert_true(document.createElement('custom-element').attachShadow({mode: "closed"}) instanceof ShadowRoot, 133 'Calling attachShadow({mode: "closed"}) on a HTML element whose local name is "custom-element" must not throw'); 134 135 }, 'Element.attachShadow must throw a NotSupportedError on a HTMLKnownElement which has a valid custom element'); 90 }, 'Element.attachShadow must throw a NotSupportedError for button, details, input, marquee, meter, progress, select, textarea, and keygen elements'); 136 91 137 92 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute.html
r206462 r206463 6 6 <meta name="assert" content="shadowRoot attribute on Element interface must return the associated open shadow tree if there is one"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html
r206462 r206463 6 6 <meta name="assert" content="Event interface must have composedPath() as a method"> 7 7 <link rel="help" href="http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface"> 8 <script src="../../ resources/testharness.js"></script>9 <script src="../../ resources/testharnessreport.js"></script>8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 10 10 <script src="resources/event-path-test-helpers.js"></script> 11 <link rel='stylesheet' href='../../resources/testharness.css'>12 11 </head> 13 12 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/HTMLSlotElement-interface-expected.txt
r206462 r206463 12 12 PASS assignedNodes({"flattened":true}) must update when slot and name attributes are modified 13 13 PASS assignedNodes must update when a default slot is introduced dynamically by a slot rename 14 PASS assignedNodes ({"flattened":false}) must update when slot and name attributes are modified15 PASS assignedNodes ({"flattened":true}) must update when slot and name attributes are modified14 PASS assignedNodes must update when a default slot is introduced dynamically by a slot rename 15 PASS assignedNodes must update when a default slot is introduced dynamically by a slot rename 16 16 PASS assignedNodes must update when slot elements are inserted or removed 17 17 PASS assignedNodes must update when slot elements are inserted or removed -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/HTMLSlotElement-interface.html
r206462 r206463 6 6 <meta name="assert" content="HTMLSlotElement must exist on window with name attribute and getAssignedNode() method"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> … … 145 144 146 145 testMutatingSlotName(null); 147 testMutatingSlot tedContents({flattened: false});148 testMutatingSlot tedContents({flattened: true});146 testMutatingSlotName({flattened: false}); 147 testMutatingSlotName({flattened: true}); 149 148 150 149 function testInsertingAndRemovingSlots(options) -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html
r206462 r206463 6 6 <meta name="assert" content="The MouseEvent offsetX and offsetY attributes must return the coordinates relative to the origin of the padding edge of the relative target"> 7 7 <link rel="help" href="http://w3c.github.io/webcomponents/spec/shadow/#event-dispatch"> 8 <script src="../../ resources/testharness.js"></script>9 <script src="../../ resources/testharnessreport.js"></script>8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 10 10 <script src="resources/event-path-test-helpers.js"></script> 11 <link rel='stylesheet' href='../../resources/testharness.css'>12 11 </head> 13 12 <body> … … 116 115 117 116 var eventLogs = attachLoggers([target, container, shadowRoot, host, document.body]); 118 var mouseEvent = new MouseEvent('mousedown', {clientX: 51, clientY: 37, scoped: false, bubbles: true});117 var mouseEvent = new MouseEvent('mousedown', {clientX: 51, clientY: 37, composed: true, bubbles: true}); 119 118 target.dispatchEvent(mouseEvent); 120 119 -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Node-prototype-cloneNode.html
r206462 r206463 2 2 <html> 3 3 <head> 4 <title> Shadow DOM: Extensions to Node interface</title>4 <title>DOM: cloneNode(deep)</title> 5 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> 6 <meta name="assert" content="Invoking the cloneNode() method on a ShadowRoot instance must always throw a NotSupportedError."> 7 <link rel="help" href="http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 6 <meta name="assert" content="If context object is a shadow root, then it must throw a NotSupportedError."> 7 <link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode"> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> … … 38 37 var shadowRoot = element.attachShadow({mode: 'open'}); 39 38 40 assert_equals(element.cloneNode(false).shadowRoot, null, 'cloneNode(false) on an open shadow host mode must clone its shadow root'); 41 assert_equals(element.cloneNode(true).shadowRoot, null, 'cloneNode(true) on an open shadow host mode must clone its shadow root'); 42 }, 'cloneNode on an open shadow root must throw a NotSupportedError'); 39 assert_equals(element.cloneNode(false).shadowRoot, null, 'cloneNode(false) on an element with an open shadow root should not clone its shadow root'); 40 assert_equals(element.cloneNode(true).shadowRoot, null, 'cloneNode(true) on an element with an open shadow root should not clone its shadow root'); 41 }, 'cloneNode on an element with an open shadow root should not clone its shadow root'); 42 43 test(function () { 44 var element = document.createElement('div'); 45 var shadowRoot = element.attachShadow({mode: 'closed'}); 46 47 assert_true(element.cloneNode(false).attachShadow({mode: 'closed'}) instanceof ShadowRoot, 48 'An element returned by cloneNode(false) on an element with a closed shadow root should allow attachShadow'); 49 50 assert_true(element.cloneNode(true).attachShadow({mode: 'closed'}) instanceof ShadowRoot, 51 'An element returned by cloneNode(true) on an element with a closed shadow root should allow attachShadow'); 52 53 }, 'cloneNode on an element with a closed shadow root should not clone its shadow root'); 43 54 44 55 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html
r206462 r206463 6 6 <meta name="assert" content="ShadowRoot interface and its attributes must be defined"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Slotable-interface-expected.txt
r206462 r206463 1 1 2 PASS assignedSlot attribute must be defined on NonDocumentTypeChildNode interface2 PASS assignedSlot attribute must be defined on Element and Text interfaces 3 3 PASS assignedSlot must return null when the node does not have an assigned node 4 4 PASS assignedSlot must return the assigned slot -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Slotable-interface.html
r206462 r206463 4 4 <title>Shadow DOM: Slotable interface</title> 5 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> 6 <meta name="assert" content="Slotable interface must have assignedSlot attribute"> 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 6 <meta name="assert" content="Element and Text interfaces must implement Slotable interface"> 7 <link rel="help" href="https://dom.spec.whatwg.org/#slotable"> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> … … 23 22 assert_false('assignedSlot' in document.createProcessingInstruction('target', 'data'), 'assignedSlot must not be defined on a processing instruction node'); 24 23 25 }, 'assignedSlot attribute must be defined on NonDocumentTypeChildNode interface');24 }, 'assignedSlot attribute must be defined on Element and Text interfaces'); 26 25 27 26 test(function () { -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-shadow-tree.html
r206462 r206463 6 6 <meta name="assert" content="The event path calculation algorithm must be used to determine event path"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#event-paths"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-slotted-node.html
r206462 r206463 6 6 <meta name="assert" content="The event path calculation algorithm must be used to determine event path"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#event-paths"> 8 <script src="../../resources/testharness.js"></script> 9 <script src="../../resources/testharnessreport.js"></script> 10 <link rel='stylesheet' href='../../resources/testharness.css'> 8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 11 10 </head> 12 11 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-with-related-target.html
r206462 r206463 6 6 <meta name="assert" content="The retargeting algorithm is used to determine relative targets"> 7 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#retargeting-relatedtarget"> 8 <script src="../../ resources/testharness.js"></script>9 <script src="../../ resources/testharnessreport.js"></script>8 <script src="../../../../resources/testharness.js"></script> 9 <script src="../../../../resources/testharnessreport.js"></script> 10 10 <script src="resources/event-path-test-helpers.js"></script> 11 <link rel='stylesheet' href='../../resources/testharness.css'>12 11 </head> 13 12 <body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slotchange-event.html
r206462 r206463 4 4 <title>Shadow DOM: slotchange event</title> 5 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> 6 < script src="../../resources/testharness.js"></script>7 <script src="../../ resources/testharnessreport.js"></script>8 < link rel='stylesheet' href='../../resources/testharness.css'>6 <link rel="help" href="https://dom.spec.whatwg.org/#signaling-slot-change"> 7 <script src="../../../../resources/testharness.js"></script> 8 <script src="../../../../resources/testharnessreport.js"></script> 9 9 </head> 10 10 <body> 11 11 <div id="log"></div> 12 12 <script> 13 // FIXME: Fix these test cases once https://github.com/w3c/webcomponents/issues/571 is resolved. 13 14 14 15 function treeName(mode, connectedToDocument) -
trunk/Source/WebCore/ChangeLog
r206462 r206463 1 2016-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Import w3c shadow DOM tests and fix one assertion 4 https://bugs.webkit.org/show_bug.cgi?id=162629 5 6 Reviewed by Chris Dumez. 7 8 The assertion failure was caused by RelatedNodeRetargeter's constructor mixing up the ancestor tree scopes 9 for the target and the related target. Fixed the bug by reversing the two. 10 11 Tests: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html 12 13 * dom/EventPath.cpp: 14 (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): i and m_ancestorTreeScopes are for the related target 15 and j and targetTreeScopeAncestors are for the target. 16 1 17 2016-09-27 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebCore/dom/EventPath.cpp
r206285 r206463 289 289 bool lowestCommonAncestorIsDocumentScope = i + 1 == m_ancestorTreeScopes.size(); 290 290 if (lowestCommonAncestorIsDocumentScope && !relatedNode.inDocument() && !target.inDocument()) { 291 Node& targetAncestorInDocumentScope = i ? *downcast<ShadowRoot>(m_ancestorTreeScopes[i - 1]->rootNode()).shadowHost() : target;292 Node& relatedNodeAncestorInDocumentScope = j ? *downcast<ShadowRoot>(targetTreeScopeAncestors[j - 1]->rootNode()).shadowHost() : relatedNode;291 Node& relatedNodeAncestorInDocumentScope = i ? *downcast<ShadowRoot>(m_ancestorTreeScopes[i - 1]->rootNode()).shadowHost() : relatedNode; 292 Node& targetAncestorInDocumentScope = j ? *downcast<ShadowRoot>(targetTreeScopeAncestors[j - 1]->rootNode()).shadowHost() : target; 293 293 if (&targetAncestorInDocumentScope.rootNode() != &relatedNodeAncestorInDocumentScope.rootNode()) { 294 294 m_hasDifferentTreeRoot = true;
Note: See TracChangeset
for help on using the changeset viewer.