WebKit Bugzilla
Attachment 349375 Details for
Bug 189494
: Update shadow DOM and custom elements tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Added the missing expected.txt
bug-189494-20180910204252.patch (text/plain), 78.87 KB, created by
Ryosuke Niwa
on 2018-09-10 20:42:53 PDT
(
hide
)
Description:
Added the missing expected.txt
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-09-10 20:42:53 PDT
Size:
78.87 KB
patch
obsolete
>Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 235880) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-09-10 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Update shadow DOM and custom elements tests >+ https://bugs.webkit.org/show_bug.cgi?id=189494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a CRASH test expectation which hits a debug asssertion. >+ The failure is tracked by the bug 189493. >+ >+ * TestExpectations: >+ > 2018-09-10 Truitt Savell <tsavell@apple.com> > > Rebaseline test after https://trac.webkit.org/changeset/235866/webkit. >Index: LayoutTests/TestExpectations >=================================================================== >--- LayoutTests/TestExpectations (revision 235880) >+++ LayoutTests/TestExpectations (working copy) >@@ -2237,6 +2237,8 @@ webkit.org/b/187269 [ Debug ] imported/w > > webkit.org/b/185308 legacy-animation-engine/animations/combo-transform-translate+scale.html [ Pass Failure ] > >+webkit.org/b/189493 [ Debug ] imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html [ Crash ] >+ > fast/gradients/conic-repeating.html [ Skip ] > fast/gradients/conic.html [ Skip ] > fast/gradients/conic-off-center.html [ Skip ] >Index: LayoutTests/imported/w3c/ChangeLog >=================================================================== >--- LayoutTests/imported/w3c/ChangeLog (revision 235880) >+++ LayoutTests/imported/w3c/ChangeLog (working copy) >@@ -1,3 +1,50 @@ >+2018-09-10 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Update shadow DOM and custom elements tests >+ https://bugs.webkit.org/show_bug.cgi?id=189494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Re-imported WPT tests for shadow DOM and custom elements. >+ >+ * resources/import-expectations.json: >+ * web-platform-tests/custom-elements/range-and-constructors-expected.txt: Added. >+ * web-platform-tests/custom-elements/range-and-constructors.html: Added. >+ * web-platform-tests/custom-elements/w3c-import.log: >+ * web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt: >+ * web-platform-tests/shadow-dom/Document-prototype-currentScript.html: >+ * web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt: Added. >+ * web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html: Added. >+ * web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt: Added. >+ * web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html: Added. >+ * web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt: >+ * web-platform-tests/shadow-dom/Element-interface-attachShadow.html: >+ * web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt: >+ * web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html: >+ * web-platform-tests/shadow-dom/OWNERS: Removed. >+ * web-platform-tests/shadow-dom/directionality-001.tentative-expected.html: Added. >+ * web-platform-tests/shadow-dom/directionality-001.tentative.html: Added. >+ * web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt: Added. >+ * web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html: Added. >+ * web-platform-tests/shadow-dom/form-control-form-attribute-expected.txt: Added. >+ * web-platform-tests/shadow-dom/form-control-form-attribute.html: Added. >+ * web-platform-tests/shadow-dom/getElementById-dynamic-001-expected.txt: Added. >+ * web-platform-tests/shadow-dom/getElementById-dynamic-001.html: Added. >+ * web-platform-tests/shadow-dom/input-element-list-expected.txt: Added. >+ * web-platform-tests/shadow-dom/input-element-list.html: Added. >+ * web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html: Added. >+ * web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html: Added. >+ * web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html: Added. >+ * web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html: Added. >+ * web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt: >+ * web-platform-tests/shadow-dom/leaktests/get-elements.html: >+ * web-platform-tests/shadow-dom/leaktests/w3c-import.log: >+ * web-platform-tests/shadow-dom/resources/event-path-test-helpers.js: >+ (dispatchEventWithEventLog): >+ * web-platform-tests/shadow-dom/resources/shadow-dom-utils.js: >+ * web-platform-tests/shadow-dom/resources/w3c-import.log: >+ * web-platform-tests/shadow-dom/w3c-import.log: >+ > 2018-09-10 Ryosuke Niwa <rniwa@webkit.org> > > Revert the errornous change to the test in r235864. >Index: LayoutTests/imported/w3c/resources/import-expectations.json >=================================================================== >--- LayoutTests/imported/w3c/resources/import-expectations.json (revision 235880) >+++ LayoutTests/imported/w3c/resources/import-expectations.json (working copy) >@@ -1,5 +1,7 @@ > { > "css/geometry": "import", >+ "custom-elements": "import", >+ "shadow-dom": "import", > "tools": "import", > "web-platform-tests/2dcontext": "skip", > "web-platform-tests/2dcontext/imagebitmap": "import", >Index: LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors-expected.txt (working copy) >@@ -0,0 +1,4 @@ >+ >+FAIL Range.cloneContents should invoke constructor in tree order assert_array_equals: property 0, expected "root-0" but got "root-0-0" >+FAIL Range.extractContents should invoke constructor in tree order assert_array_equals: property 0, expected "root-0" but got "root-0-0" >+ >Index: LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors.html (working copy) >@@ -0,0 +1,61 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<title>Custom elements: Range APIs should invoke constructor in tree order</title> >+<meta name="author" title="Edgar Chen" href="mailto:echen@mozilla.com"> >+<link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element"> >+<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element"> >+<line rel="help" href="https://dom.spec.whatwg.org/#concept-range-extract"> >+<line rel="help" href="https://dom.spec.whatwg.org/#concept-range-clone"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<div id="log"></div> >+ >+<c-e data-index="root"> >+ <c-e data-index="root-0"> >+ <c-e data-index="root-0-0"> >+ <c-e data-index="root-0-0-0"></c-e> >+ <span id="start"></span> >+ </c-e> >+ </c-e> >+ <c-e data-index="root-1"></c-e> >+ <span id="end"></span> >+</c-e> >+ >+<script> >+ >+var logs = []; >+class CE extends HTMLElement { >+ constructor() { >+ super(); >+ logs.push(this.dataset.index); >+ } >+} >+customElements.define('c-e', CE); >+ >+function getRange() { >+ const range = new Range(); >+ range.setStart(document.getElementById('start'), 0); >+ range.setEnd(document.getElementById('end'), 0); >+ return range; >+} >+ >+test(function () { >+ // Clear log for testing. >+ logs = []; >+ getRange().cloneContents(); >+ assert_array_equals(logs, ['root-0', 'root-0-0', 'root-1']); >+}, 'Range.cloneContents should invoke constructor in tree order'); >+ >+test(function () { >+ // Clear log for testing. >+ logs = []; >+ getRange().extractContents(); >+ assert_array_equals(logs, ['root-0', 'root-0-0']); >+}, 'Range.extractContents should invoke constructor in tree order'); >+ >+</script> >+</body> >+</html> >Index: LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log (working copy) >@@ -30,5 +30,6 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/custom-elements/historical.html > /LayoutTests/imported/w3c/web-platform-tests/custom-elements/microtasks-and-constructors.html > /LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined.html >+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors.html > /LayoutTests/imported/w3c/web-platform-tests/custom-elements/reaction-timing.html > /LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt (working copy) >@@ -1,10 +1,8 @@ > >-Harness Error (FAIL), message = 1 duplicate test name: "document.currentScript must be set to a script element that loads an external script in a document tree" >- > PASS document.currentScript must not to be set to a script element in a shadow tree in open mode > PASS document.currentScript must not to be set to a script element in a shadow tree in closed mode > PASS document.currentScript must be set to a script element that loads an external script in a document tree >-PASS document.currentScript must be set to a script element that loads an external script in a document tree >+PASS document.currentScript must be set to a script element that loads an external script in a document tree (2) > PASS document.currentScript must not be set to a script element that loads an external script in an open shadow tree > PASS document.currentScript must not be set to a script element that loads an external script in a closed shadow tree > PASS document.currentScript must be set to a script element that loads an external script that was in an open shadow tree and then removed >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html (working copy) >@@ -1,6 +1,7 @@ > <!DOCTYPE html> > <html> > <head> >+<meta charset=utf-8> > <title>HTML: Document.prototype.currentScript</title> > <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> > <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."> >@@ -12,11 +13,16 @@ > <div id="log"></div> > <script id="outerScriptElement"> > >+function assert_shadowdom_supported() { >+ assert_true('attachShadow' in document.createElement('div'), 'Shadow DOM is not supported'); >+} >+ > var outerScriptElement = document.currentScript; > > function testInlineScript(mode) > { > test(function () { >+ assert_shadowdom_supported(); > var host = document.createElement('div'); > var shadowRoot = host.attachShadow({mode: mode}); > var scriptElement = document.createElement('script'); >@@ -40,11 +46,16 @@ var testedScriptElement = null; > function executeNextTest() > { > var testCase = asyncScriptTests.shift(); >- var mode = testCase.mode; > if (!testCase) > return; > >+ var mode = testCase.mode; >+ >+ testCase.test.add_cleanup(() => { >+ setTimeout(executeNextTest, 1); >+ }); > testCase.test.step(function () { >+ assert_shadowdom_supported(); > testedScriptElement = document.createElement('script'); > testedScriptElement.src = 'resources/Document-prototype-currentScript-helper.js'; > >@@ -66,7 +77,6 @@ function executeNextTest() > assert_equals(document.currentScript, testCase.expected()); > }); > testCase.test.done(); >- setTimeout(executeNextTest, 1); > } > } > >@@ -75,7 +85,7 @@ var asyncScriptTests = [ > test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree'), > mode: null, remove: false, expected: function () { return testedScriptElement; }}, > { >- test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree'), >+ test: async_test('document.currentScript must be set to a script element that loads an external script in a document tree (2)'), > mode: null, remove: true, expected: function () { return testedScriptElement; }}, > { > test: async_test('document.currentScript must not be set to a script element that loads an external script in an open shadow tree'), >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt (working copy) >@@ -0,0 +1,42 @@ >+ >+PASS document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline >+PASS document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: block >+PASS document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline-block >+FAIL document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: inline assert_equals: expected Element node <test-element style="display: inline;">text</test-element> but got Element node <slot></slot> >+FAIL document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: block assert_equals: expected Element node <test-element style="display: block;">text</test-element> but got Element node <slot></slot> >+FAIL document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: inline-block assert_equals: expected Element node <test-element style="display: inline-block;">text</test-e... but got Element node <slot></slot> >+PASS document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline >+PASS document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: block >+PASS document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline-block >+PASS document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: inline >+PASS document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: block >+PASS document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: inline-block >+PASS document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: inline >+PASS document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: block >+PASS document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: inline-block >+FAIL document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element assigned to a slot when the hit-tested text node is assigned to a slot in the shadow tree of the child element and the outer shadow host has display: inline assert_equals: expected Element node <inner-host>hello</inner-host> but got Element node <slot></slot> >+FAIL document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element assigned to a slot when the hit-tested text node is assigned to a slot in the shadow tree of the child element and the outer shadow host has display: block assert_equals: expected Element node <inner-host>hello</inner-host> but got Element node <slot></slot> >+FAIL document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element assigned to a slot when the hit-tested text node is assigned to a slot in the shadow tree of the child element and the outer shadow host has display: inline-block assert_equals: expected Element node <inner-host>hello</inner-host> but got Element node <slot></slot> >+PASS document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is its direct child and the outer shadow host has display: inline >+PASS document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is its direct child and the outer shadow host has display: block >+PASS document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is its direct child and the outer shadow host has display: inline-block >+PASS document.elementFromPoint, shadowRoot.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is a child of another element and innerShadow.elementFromPoint must return the parent element of the hit-tested text node under it when the outer shadow host has display: inline >+PASS document.elementFromPoint, shadowRoot.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is a child of another element and innerShadow.elementFromPoint must return the parent element of the hit-tested text node under it when the outer shadow host has display: block >+PASS document.elementFromPoint, shadowRoot.elementFromPoint must return a child element with its own shadow tree assigned to a slot when the hit-tested text node is a child of another element and innerShadow.elementFromPoint must return the parent element of the hit-tested text node under it when the outer shadow host has display: inline-block >+PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline >+PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: block >+PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline-block >+FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: inline assert_array_equals: property 0, expected Element node <test-element style="display: inline;">text</test-element> but got Element node <slot></slot> >+FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: block assert_array_equals: lengths differ, expected 4 got 5 >+FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: inline-block assert_array_equals: lengths differ, expected 4 got 5 >+PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline >+PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: block >+PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline-block >+FAIL document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: inline assert_array_equals: lengths differ, expected 5 got 4 >+PASS document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: block >+PASS document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: inline-block >+PASS document.elementsFromPoint must return the shadow host and its ancestors and shadowRoot.elementsFromPoint must return the slot parent of the fallback text and its non-shadow ancestors when the hit-tested text node is a fallback content and the host has display: inline >+PASS document.elementsFromPoint must return the shadow host and its ancestors and shadowRoot.elementsFromPoint must return the slot parent of the fallback text and its non-shadow ancestors when the hit-tested text node is a fallback content and the host has display: block >+PASS document.elementsFromPoint must return the shadow host and its ancestors and shadowRoot.elementsFromPoint must return the slot parent of the fallback text and its non-shadow ancestors when the hit-tested text node is a fallback content and the host has display: inline-block >+FAIL shadowRoot.elementsFromPoint must behave the same with document.elementsFromPoint regarding HTML element assert_array_equals: lengths differ, expected 5 got 4 >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html (working copy) >@@ -0,0 +1,256 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Shadow DOM and CSSOM View: Document.prototype.elementFromPoint</title> >+ <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> >+ <meta name="assert" content="DocumentOrShadowRoot must have elementFromPoint and must return retarget the result against the context object."> >+ <link rel="help" href="https://www.w3.org/TR/cssom-view-1/#dom-document-elementfrompoint"> >+ <link rel="help" href="https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin"> >+ <script src="/resources/testharness.js"></script> >+ <script src="/resources/testharnessreport.js"></script> >+ </head> >+ <body> >+ <div id="container"></div> >+ <style> >+test-element { display: block; width: 100px; height: 100px; } >+ </style> >+ <script> >+ >+function pointInElement(node) { >+ let x = 5; >+ let y = 5; >+ do { >+ x += node.offsetLeft; >+ y += node.offsetTop; >+ node = node.offsetParent; >+ } while (node); >+ return [x, y]; >+} >+ >+const displayValues = ['inline', 'block', 'inline-block']; >+var container = document.getElementById('container'); >+customElements.define('test-element', class extends HTMLElement { >+ constructor() { >+ super(); >+ } >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = 'hello'; >+ container.appendChild(host); >+ assert_equals(document.elementFromPoint(...pointInElement(host)), host); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), host); >+ }, 'document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = 'text'; >+ container.appendChild(host); >+ assert_equals(document.elementFromPoint(...pointInElement(host)), host); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), host); >+ }, 'document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = '<span>text</span>'; >+ container.appendChild(host); >+ assert_equals(document.elementFromPoint(...pointInElement(host)), host.querySelector('span')); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), host.querySelector('span')); >+ }, 'document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<span>text</span>'; >+ container.appendChild(host); >+ assert_equals(document.elementFromPoint(...pointInElement(host)), host); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), shadow.querySelector('span')); >+ }, 'document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot>fallback</slot>'; >+ container.appendChild(host); >+ assert_equals(document.elementFromPoint(...pointInElement(host)), host); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), shadow.querySelector('slot')); >+ }, 'document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: ' + displayValue); >+}); >+ >+ >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = '<inner-host>hello</inner-host>'; >+ container.appendChild(host); >+ >+ let innerHost = host.querySelector('inner-host'); >+ let innerShadow = innerHost.attachShadow({mode: 'closed'}); >+ innerShadow.innerHTML = '<slot></slot>'; >+ assert_equals(document.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(innerShadow.elementFromPoint(...pointInElement(host)), innerHost); >+ }, 'document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element assigned to a slot' >+ + ' when the hit-tested text node is assigned to a slot in the shadow tree of the child element and the outer shadow host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = '<inner-host></inner-host>'; >+ container.appendChild(host); >+ >+ let innerHost = host.querySelector('inner-host'); >+ let innerShadow = innerHost.attachShadow({mode: 'closed'}); >+ innerShadow.innerHTML = 'hello'; >+ assert_equals(document.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(innerShadow.elementFromPoint(...pointInElement(host)), innerHost); >+ }, 'document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element with its own shadow tree assigned to a slot' >+ + ' when the hit-tested text node is its direct child and the outer shadow host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = '<inner-host></inner-host>'; >+ container.appendChild(host); >+ >+ let innerHost = host.querySelector('inner-host'); >+ let innerShadow = innerHost.attachShadow({mode: 'closed'}); >+ innerShadow.innerHTML = '<span>hello</span>'; >+ >+ assert_equals(document.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(shadow.elementFromPoint(...pointInElement(host)), innerHost); >+ assert_equals(innerShadow.elementFromPoint(...pointInElement(host)), innerShadow.querySelector('span')); >+ }, 'document.elementFromPoint, shadowRoot.elementFromPoint must return a child element with its own shadow tree assigned to a slot' >+ + ' when the hit-tested text node is a child of another element and innerShadow.elementFromPoint must return the parent element of the hit-tested text node under it when the outer shadow host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = 'hello'; >+ container.appendChild(host); >+ assert_array_equals(document.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ }, 'document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<slot></slot>'; >+ host.innerHTML = 'text'; >+ container.appendChild(host); >+ assert_array_equals(document.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ },'document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<div><slot></slot></div>'; >+ host.innerHTML = '<span>text</span>'; >+ container.appendChild(host); >+ assert_array_equals(document.elementsFromPoint(...pointInElement(host)), [host.querySelector('span'), host, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(...pointInElement(host)), [host.querySelector('span'), shadow.querySelector('div'), host, container, document.body, document.documentElement]); >+ }, 'document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<span>text</span>'; >+ container.appendChild(host); >+ assert_array_equals(document.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(...pointInElement(host)), [shadow.querySelector('span'), host, container, document.body, document.documentElement]); >+ }, 'document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root and' >+ + 'shadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: ' + displayValue); >+}); >+ >+displayValues.forEach(function (displayValue) { >+ test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = displayValue; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<div><slot>fallback</slot></div>'; >+ container.appendChild(host); >+ assert_array_equals(document.elementsFromPoint(...pointInElement(host)), [host, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(...pointInElement(host)), [shadow.querySelector('slot'), shadow.querySelector('div'), host, container, document.body, document.documentElement]); >+ }, 'document.elementsFromPoint must return the shadow host and its ancestors and shadowRoot.elementsFromPoint must return the slot parent of the fallback text and its non-shadow ancestors when the hit-tested text node is a fallback content and the host has display: ' + displayValue); >+}); >+ >+test(function () { >+ container.innerHTML = ''; >+ let host = document.createElement('test-element'); >+ host.style.display = 'block'; >+ let shadow = host.attachShadow({mode: 'closed'}); >+ shadow.innerHTML = '<div style="margin: 2px;">not hit</div>'; >+ let aboveHost = document.createElement("div"); >+ aboveHost.appendChild(host); >+ container.appendChild(aboveHost); >+ document.documentElement.style = 'background-attachment: scroll; height: 2px;'; >+ let boundingRect = host.getBoundingClientRect(); >+ assert_array_equals(document.elementsFromPoint(boundingRect.x, boundingRect.y), [host, aboveHost, container, document.body, document.documentElement]); >+ assert_array_equals(shadow.elementsFromPoint(boundingRect.x, boundingRect.y), [host, aboveHost, container, document.body, document.documentElement]); >+}, 'shadowRoot.elementsFromPoint must behave the same with document.elementsFromPoint regarding HTML element'); >+ >+container.innerHTML = ''; >+ >+ </script> >+ </body> >+</html> >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt (working copy) >@@ -0,0 +1,4 @@ >+ >+PASS Element.attachShadow must create an instance of ShadowRoot for autonomous custom elements >+PASS Element.attachShadow must throw a NotSupportedError for customized built-in elements >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html (working copy) >@@ -0,0 +1,29 @@ >+<!DOCTYPE html> >+<title>Shadow DOM: Attaching a ShadowRoot for custom elements</title> >+<meta name="author" title="Hayato Ito" href="mailto:hayato@chromium.org"> >+<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-attachshadow"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+class MyAutonomousCustomElement extends HTMLElement { >+} >+ >+customElements.define('my-custom', MyAutonomousCustomElement); >+ >+test(() => { >+ assert_true(document.createElement('my-custom').attachShadow({mode: "open"}) instanceof ShadowRoot); >+}, 'Element.attachShadow must create an instance of ShadowRoot for autonomous custom elements'); >+ >+class MyCustomizedBuiltinElement extends HTMLInputElement { >+} >+ >+customElements.define('my-input', MyCustomizedBuiltinElement, { extends: 'input' }); >+ >+test(() => { >+ assert_throws({'name': 'NotSupportedError'}, () => { >+ document.createElement('input', {is: 'my-input'}).attachShadow({mode: "open"}); >+ }); >+}, 'Element.attachShadow must throw a NotSupportedError for customized built-in elements'); >+</script> >+</body> >+</html> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt (working copy) >@@ -4,5 +4,5 @@ PASS Nodes other than Element should not > PASS Element.attachShadow must throw a TypeError if mode is not "open" or "closed" > PASS Element.attachShadow must create an instance of ShadowRoot > PASS Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree >-PASS Element.attachShadow must throw a NotSupportedError for button, details, input, marquee, meter, progress, select, textarea, and keygen elements >+PASS Element.attachShadow must throw a NotSupportedError for non-safelisted elements > >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow.html (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow.html (working copy) >@@ -7,6 +7,7 @@ > <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict"> > <script src="/resources/testharness.js"></script> > <script src="/resources/testharnessreport.js"></script> >+<script src="resources/shadow-dom-utils.js"></script> > </head> > <body> > <div id="log"></div> >@@ -78,7 +79,7 @@ test(function () { > }, 'Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree'); > > test(function () { >- for (var elementName of ['button', 'details', 'input', 'marquee', 'meter', 'progress', 'select', 'textarea', 'keygen']) { >+ for (var elementName of ATTACHSHADOW_DISALLOWED_ELEMENTS) { > assert_throws({'name': 'NotSupportedError'}, function () { > document.createElement(elementName).attachShadow({mode: "open"}); > }, 'Calling attachShadow({mode: "open"}) on ' + elementName + ' element must throw'); >@@ -87,7 +88,7 @@ test(function () { > document.createElement(elementName).attachShadow({mode: "closed"}); > }, 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' element must throw'); > } >-}, 'Element.attachShadow must throw a NotSupportedError for button, details, input, marquee, meter, progress, select, textarea, and keygen elements'); >+}, 'Element.attachShadow must throw a NotSupportedError for non-safelisted elements'); > > </script> > </body> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt (working copy) >@@ -1,20 +1,18 @@ > >-PASS composedPath() must exist on Event > PASS composedPath() must return an empty array when the event has not been dispatched > PASS composedPath() must return an empty array when the event is no longer dispatched >-PASS composed must exist on Event > PASS composed on EventInit must default to false > PASS composed on EventInit must set the composed flag >-FAIL The event must propagate out of open mode shadow boundaries when the composed flag is set assert_array_equals: value is 5, expected array >-FAIL The event must propagate out of closed mode shadow boundaries when the composed flag is set assert_array_equals: value is 5, expected array >-FAIL The event must not propagate out of open mode shadow boundaries when the composed flag is unset assert_array_equals: value is 2, expected array >-FAIL The event must not propagate out of closed mode shadow boundaries when the composed flag is unset assert_array_equals: value is 2, expected array >-FAIL The event must not propagate out of open mode shadow boundaries when the composed flag is unset on an event with relatedTarget assert_array_equals: value is 2, expected array >-FAIL The event must not propagate out of closed mode shadow boundaries when the composed flag is unset on an event with relatedTarget assert_array_equals: value is 2, expected array >-FAIL The event must not propagate out of open mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set assert_array_equals: value is 5, expected array >-FAIL The event must not propagate out of closed mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set assert_array_equals: value is 5, expected array >-FAIL The event must propagate out of open mode shadow tree in which the relative target and the relative related target are the same assert_array_equals: value is 4, expected array >-FAIL The event must propagate out of closed mode shadow tree in which the relative target and the relative related target are the same assert_array_equals: value is 4, expected array >-FAIL composedPath() must contain and only contain the unclosed nodes of target in open mode shadow trees assert_array_equals: value is 9, expected array >-FAIL composedPath() must contain and only contain the unclosed nodes of target in closed mode shadow trees assert_array_equals: value is 9, expected array >+PASS The event must propagate out of open mode shadow boundaries when the composed flag is set >+PASS The event must propagate out of closed mode shadow boundaries when the composed flag is set >+PASS The event must not propagate out of open mode shadow boundaries when the composed flag is unset >+PASS The event must not propagate out of closed mode shadow boundaries when the composed flag is unset >+PASS The event must not propagate out of open mode shadow boundaries when the composed flag is unset on an event with relatedTarget >+PASS The event must not propagate out of closed mode shadow boundaries when the composed flag is unset on an event with relatedTarget >+PASS The event must not propagate out of open mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set >+PASS The event must not propagate out of closed mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set >+PASS The event must propagate out of open mode shadow tree in which the relative target and the relative related target are the same >+PASS The event must propagate out of closed mode shadow tree in which the relative target and the relative related target are the same >+PASS composedPath() must contain and only contain the unclosed nodes of target in open mode shadow trees >+PASS composedPath() must contain and only contain the unclosed nodes of target in closed mode shadow trees > >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html (working copy) >@@ -14,11 +14,6 @@ > <script> > > test(function () { >- assert_true('composedPath' in Event.prototype); >- assert_true('composedPath' in new Event('my-event')); >-}, 'composedPath() must exist on Event'); >- >-test(function () { > var event = new Event('my-event'); > assert_array_equals(event.composedPath(), []); > }, 'composedPath() must return an empty array when the event has not been dispatched'); >@@ -30,11 +25,6 @@ test(function () { > }, 'composedPath() must return an empty array when the event is no longer dispatched'); > > test(function () { >- assert_true('composed' in Event.prototype); >- assert_true('composed' in new Event('my-event')); >-}, 'composed must exist on Event'); >- >-test(function () { > var event = new Event('my-event'); > assert_false(event.composed); > }, 'composed on EventInit must default to false'); >@@ -64,7 +54,7 @@ function testComposedEvent(mode) { > > var expectedPath = ['A1a', 'A1-SR', 'A1', 'A-SR', 'A']; > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], expectedPath); > assert_array_equals(log.pathAtTargets[1], expectedPath); > assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : ['A1', 'A-SR', 'A'], >@@ -92,7 +82,7 @@ function testNonComposedEvent(mode) { > > var expectedPath = ['A1a', 'A1-SR']; > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], expectedPath); > assert_array_equals(log.pathAtTargets[1], expectedPath); > }, 'The event must not propagate out of ' + mode + ' mode shadow boundaries when the composed flag is unset'); >@@ -118,7 +108,7 @@ function testNonComposedEventWithRelated > > var expectedPath = ['A1a', 'A1-SR']; > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], expectedPath); > assert_array_equals(log.pathAtTargets[1], expectedPath); > assert_array_equals(log.relatedTargets, ['A2-S', 'A2-S']); >@@ -146,7 +136,7 @@ function testScopedEventWithUnscopedRela > var expectedPath = ['B1a', 'B1c-S', 'B1-SR', 'B1', 'B-SR']; > var pathExposedToB1a = ['B1a', 'B1', 'B-SR']; > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], mode == 'open' ? expectedPath : pathExposedToB1a); > assert_array_equals(log.pathAtTargets[1], expectedPath); > assert_array_equals(log.pathAtTargets[2], expectedPath); >@@ -177,7 +167,7 @@ function testComposedEventWithRelatedTar > var expectedPath = ['A1a', 'A1-SR', 'A1', 'A-SR']; > var pathExposedToA1 = ['A1', 'A-SR']; > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], expectedPath); > assert_array_equals(log.pathAtTargets[1], expectedPath); > assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : pathExposedToA1); >@@ -212,7 +202,7 @@ function testComposedEventThroughSlot(mo > var pathExposedToA1 = [ 'B', 'A2-S', 'A-SR', 'A']; > > assert_array_equals(log.eventPath, expectedPath); >- assert_array_equals(log.eventPath.length, log.pathAtTargets.length); >+ assert_equals(log.eventPath.length, log.pathAtTargets.length); > assert_array_equals(log.pathAtTargets[0], mode == 'open' ? expectedPath : pathExposedToB1a); > assert_array_equals(log.pathAtTargets[1], mode == 'open' ? expectedPath : pathExposedToB1cS); > assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : pathExposedToB1cS); >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/OWNERS >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/OWNERS (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/OWNERS (nonexistent) >@@ -1,4 +0,0 @@ >-@kojiishi >-@rniwa >-@takayoshikochi >-@hayatoito >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative-expected.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative-expected.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative-expected.html (working copy) >@@ -0,0 +1,6 @@ >+<!doctype html> >+<title>CSS Test Reference</title> >+<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Ãlvarez"> >+<div dir="rtl"> 123 456 <span><span> 789 101112 </span></span></div> >+<div dir="rtl"> 123 456 <span dir="ltr"><span> 789 101112 </span></span></div> >+<div dir="rtl"> 123 456 <span><span> 789 101112 </span></span></div> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative.html (working copy) >@@ -0,0 +1,19 @@ >+<!doctype html> >+<title>Test: directionality propagation in Shadow DOM.</title> >+<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Ãlvarez"> >+<link rel="help" href="https://html.spec.whatwg.org/#the-dir-attribute"> >+<link rel="help" href="https://github.com/whatwg/html/issues/3699"> >+<link rel="match" href="directionality-001-ref.html"> >+<div id="host0" dir="rtl"><span> 789 101112 </span></div> >+<div id="host1" dir="rtl"><span> 789 101112 </span></div> >+<div id="host2" dir="rtl"><span> 789 101112 </span></div> >+<script> >+ host0.attachShadow({mode: 'closed'}).innerHTML = >+ '<div> 123 456 <span><slot></slot></span></div>'; >+ >+ host1.attachShadow({mode: 'closed'}).innerHTML = >+ '<div> 123 456 <span dir="ltr"><slot></slot></span></div>'; >+ >+ host2.attachShadow({mode: 'closed'}).innerHTML = >+ '<div> 123 456 <span><slot dir="ltr"></slot></span></div>'; >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt (working copy) >@@ -0,0 +1,4 @@ >+ >+FAIL Event.composedPath() should return the same result even if DOM is mutated (1/2) assert_array_equals: lengths differ, expected 3 got 2 >+FAIL Event.composedPath() should return the same result even if DOM is mutated (2/2) assert_array_equals: lengths differ, expected 5 got 2 >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html (working copy) >@@ -0,0 +1,59 @@ >+<!DOCTYPE html> >+<title>Shadow DOM: Event.composedPath() should return the same result even if DOM is mutated</title> >+<meta name="author" title="Hayato Ito" href="mailto:hayato@google.com"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/shadow-dom.js"></script> >+ >+<div id="test1"> >+ <div id="host"> >+ <template id="sr" data-mode="closed"> >+ <div id="target"></div> >+ </template> >+ </div> >+</div> >+ >+<script> >+async_test((t) => { >+ const n = createTestTree(document.querySelector('#test1')); >+ n.host.addEventListener('my-event', t.step_func((e) => { >+ const path_before = e.composedPath(); >+ // Move the target out of a closed shadow tree >+ n.host.append(n.target); >+ const path_after = e.composedPath(); >+ assert_array_equals(path_before, path_after); >+ t.done(); >+ })); >+ const event = new Event('my-event', { bubbles: true, composed: true }); >+ n.target.dispatchEvent(event); >+}, 'Event.composedPath() should return the same result even if DOM is mutated (1/2)'); >+</script> >+ >+<div id="test2"> >+ <div id="host1"> >+ <template id="sr1" data-mode="closed"> >+ <div id="host2"> >+ <template id="sr2" data-mode="open"> >+ <div id="target"></div> >+ </template> >+ </div> >+ </template> >+ </div> >+</div> >+ >+<script> >+async_test((t) => { >+ const n = createTestTree(document.querySelector('#test2')); >+ n.host1.addEventListener('my-event', t.step_func((e) => { >+ const path_before = e.composedPath(); >+ // Move nodes out of a closed shadow tree >+ n.host1.append(n.host2); >+ n.host1.append(n.target); >+ const path_after = e.composedPath(); >+ assert_array_equals(path_before, path_after); >+ t.done(); >+ })); >+ const event = new Event('my-event', { bubbles: true, composed: true }); >+ n.target.dispatchEvent(event); >+}, 'Event.composedPath() should return the same result even if DOM is mutated (2/2)'); >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute-expected.txt (working copy) >@@ -0,0 +1,7 @@ >+form >+ >+ >+PASS Form control's form attribute should point to the form element. >+FAIL Shadow form control's form attribute should work also in shadow DOM. assert_equals: expected null but got Element node <form id="form">form</form> >+PASS Form element as form control's ancestor should work also in shadow DOM. >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html (working copy) >@@ -0,0 +1,80 @@ >+<!doctype html> >+<meta charset=utf-8> >+<title>Form controls' form attribute</title> >+<script src=/resources/testharness.js></script> >+<script src=/resources/testharnessreport.js></script> >+<div id="testcontent"> >+ <form id="form">form</form> >+ <input id="input" form="form"> >+</div> >+ >+<script> >+ >+test(() => { >+ assert_equals(document.getElementById('input').form, >+ document.getElementById('form')); >+}, "Form control's form attribute should point to the form element."); >+ >+test(() => { >+ var testcontent = document.getElementById("testcontent"); >+ var host = document.createElement("div"); >+ var sr = host.attachShadow({mode: "open"}); >+ sr.innerHTML = testcontent.innerHTML; >+ var input = sr.getElementById("input"); >+ var form = sr.getElementById("form"); >+ >+ // Should have null form when shadow DOM isn't connected. >+ assert_equals(input.form, null); >+ >+ testcontent.appendChild(host); >+ assert_equals(input.form, form); >+ >+ host.remove(); >+ assert_equals(input.form, null); >+ >+ testcontent.appendChild(host); >+ assert_equals(input.form, form); >+ >+ input.remove(); >+ assert_equals(input.form, null); >+ >+ sr.appendChild(input); >+ assert_equals(input.form, form); >+ >+ form.id = "foobar"; >+ assert_equals(input.form, null); >+ >+ form.id = "form"; >+ assert_equals(input.form, form); >+ >+ form.remove(); >+ assert_equals(input.form, null); >+ >+ sr.appendChild(form); >+ assert_equals(input.form, form); >+ >+ host.remove(); >+}, "Shadow form control's form attribute should work also in shadow DOM."); >+ >+test(() => { >+ var testcontent = document.getElementById("testcontent"); >+ var host = document.createElement("div"); >+ var sr = host.attachShadow({mode: "open"}); >+ sr.innerHTML = "<form id='form'><input id='input'></form>"; >+ var input = sr.getElementById("input"); >+ var form = sr.getElementById("form"); >+ >+ assert_equals(input.form, form); >+ >+ input.remove(); >+ assert_equals(input.form, null); >+ >+ form.appendChild(input); >+ assert_equals(input.form, form); >+ >+ form.remove(); >+ assert_equals(input.form, form); >+ >+ host.remove(); >+}, "Form element as form control's ancestor should work also in shadow DOM."); >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001-expected.txt (working copy) >@@ -0,0 +1,3 @@ >+ >+PASS ShadowRoot.getElementById keeps working after host has been removed >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001.html (working copy) >@@ -0,0 +1,23 @@ >+<!doctype html> >+<title>Shadow DOM: ShadowRoot.getElementById in shadow trees keeps working after host is removed from tree</title> >+<link rel="help" href="https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid"> >+<link rel="help" href="https://bugzil.la/1475203"> >+<link rel="author" name="Emilio Cobos Ãlvarez" href="emilio@crisal.io"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<div id="host"></div> >+<script> >+test(function() { >+ let host = document.getElementById("host"); >+ host.attachShadow({ mode: "open" }).innerHTML = `<div id="test-id"></div>`; >+ >+ let element = host.shadowRoot.getElementById("test-id"); >+ assert_true(!!element); >+ >+ host.remove(); >+ assert_equals(host.shadowRoot.getElementById("test-id"), element); >+ >+ element.remove(); >+ assert_equals(host.shadowRoot.getElementById("test-id"), null); >+}, "ShadowRoot.getElementById keeps working after host has been removed"); >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list-expected.txt (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list-expected.txt (working copy) >@@ -0,0 +1,5 @@ >+ >+ >+FAIL Input element's list attribute should point to the datalist element. assert_equals: expected (object) null but got (undefined) undefined >+FAIL Input element's list attribute should point to the datalist element in Shadow DOM. assert_equals: expected (object) null but got (undefined) undefined >+ >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list.html (working copy) >@@ -0,0 +1,39 @@ >+<!doctype html> >+<meta charset=utf-8> >+<title>Input.list</title> >+<script src=/resources/testharness.js></script> >+<script src=/resources/testharnessreport.js></script> >+<div id="testcontent"> >+ <input id="input" list="datalist"> >+</div> >+<script> >+ >+test(() => { >+ assert_equals(document.getElementById('input').list, null); >+ var dl = document.createElement("datalist"); >+ dl.id = "datalist"; >+ document.getElementById("testcontent").appendChild(dl); >+ assert_equals(document.getElementById('input').list, dl); >+}, "Input element's list attribute should point to the datalist element."); >+ >+ >+test(() => { >+ var host = document.createElement("div"); >+ document.getElementById("testcontent").appendChild(host); >+ var sr = host.attachShadow({mode: "open"}); >+ var input = document.createElement("input"); >+ input.setAttribute("list", "datalist"); >+ sr.appendChild(input); >+ assert_equals(input.list, null); >+ >+ var dl = document.createElement("datalist"); >+ dl.id = "datalist"; >+ sr.appendChild(dl); >+ assert_equals(input.list, dl); >+ >+ dl.remove(); >+ assert_equals(input.list, null); >+}, "Input element's list attribute should point to the datalist element in Shadow DOM."); >+ >+ >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html (working copy) >@@ -0,0 +1 @@ >+<!DOCTYPE html> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html (working copy) >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<title>Layout using slot elements</title> >+<link rel="author" title="Hayato Ito" href="mailto:hayato@google.com"/> >+<link rel="help" href="https://dom.spec.whatwg.org/#shadow-tree-slots"> >+<link rel="match" href="reference/empty.html"/> >+<div id="host"></div> >+<script> >+const host = document.querySelector('#host'); >+const sr = host.attachShadow({ mode: 'open' }); >+sr.innerHTML = '<slot name=s1></slot>' >+host.innerHTML = '<div id=d1 slot=s1></div>'; >+ >+document.body.offsetLeft; >+document.querySelector('#d1').setAttribute('slot', 's2'); >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html (working copy) >@@ -0,0 +1 @@ >+<!DOCTYPE html> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html (nonexistent) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html (working copy) >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<title>Layout using slot elements</title> >+<link rel="author" title="Hayato Ito" href="mailto:hayato@google.com"/> >+<link rel="help" href="https://dom.spec.whatwg.org/#shadow-tree-slots"> >+<link rel="match" href="reference/empty.html"/> >+<div id="host"></div> >+<script> >+const host = document.querySelector('#host'); >+const sr = host.attachShadow({ mode: 'open' }); >+ >+sr.innerHTML = '<slot><div id="fallback">Should not be displayed</div></slot>' >+ >+document.body.offsetLeft; >+host.appendChild(document.createElement('div')); >+</script> >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/w3c-import.log >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/w3c-import.log (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/w3c-import.log (working copy) >@@ -1,7 +1,7 @@ > The tests in this directory were imported from the W3C repository. > Do NOT modify these tests directly in WebKit. > Instead, create a pull request on the WPT github: >- https://github.com/w3c/web-platform-tests >+ https://github.com/web-platform-tests/wpt > > Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport > >@@ -17,16 +17,21 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-adoptNode.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Document-prototype-importNode.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-attachShadow.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/HTMLSlotElement-interface.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/META.yml > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Node-prototype-cloneNode.html >-/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/OWNERS > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Range-prototype-insertNode.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Slotable-interface.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative-expected.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/directionality-001.tentative.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed.html >@@ -34,7 +39,14 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-slotted-node.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-post-dispatch.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-with-related-target.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/getElementById-dynamic-001.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/historical.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html >+/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slotchange-customelements.html > /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slotchange-event.html >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt (working copy) >@@ -1,7 +1,7 @@ > > PASS getElementsById() should not leak nodes in shadow tree >-FAIL getElementsByClassName() should not leak nodes in shadow tree assert_array_equals: value is 0, expected array >-FAIL getElementsByName() should not leak nodes in shadow tree assert_array_equals: value is 0, expected array >-FAIL getElementsByTagName() should not leak nodes in shadow tree assert_array_equals: value is 0, expected array >+PASS getElementsByClassName() should not leak nodes in shadow tree >+PASS getElementsByName() should not leak nodes in shadow tree >+PASS getElementsByTagName() should not leak nodes in shadow tree > PASS getElementsByTagNameNS() should not leak nodes in shadow tree > >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements.html >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements.html (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/get-elements.html (working copy) >@@ -85,12 +85,12 @@ test(function() { > assert_equals(doc.querySelectorAll('.bar').length, 1); > assert_equals(doc.getElementsByClassName('bar')[0].getAttribute('label'), 'doc-div'); > >- assert_array_equals(hostOpen.querySelectorAll('.bar').length, 0); >+ assert_equals(hostOpen.querySelectorAll('.bar').length, 0); > > assert_equals(shadowOpen.querySelectorAll('.bar').length, 1); > assert_equals(shadowOpen.querySelectorAll('.bar')[0].getAttribute('label'), 'shadow-open-div'); > >- assert_array_equals(hostClosed.querySelectorAll('.bar').length, 0); >+ assert_equals(hostClosed.querySelectorAll('.bar').length, 0); > > assert_equals(shadowClosed.querySelectorAll('.bar').length, 1); > assert_equals(shadowClosed.querySelectorAll('.bar')[0].getAttribute('label'), 'shadow-closed-div'); >@@ -106,11 +106,11 @@ test(function() { > > assert_equals(doc.querySelectorAll('[name=baz]').length, 1); > >- assert_array_equals(hostOpen.querySelectorAll('[name=baz]').length, 0); >+ assert_equals(hostOpen.querySelectorAll('[name=baz]').length, 0); > assert_equals(shadowOpen.querySelectorAll('[name=baz]').length, 1); > assert_equals(shadowOpen.querySelectorAll('[name=baz]')[0].getAttribute('label'), 'shadow-open-form'); > >- assert_array_equals(hostClosed.querySelectorAll('[name=baz]').length, 0); >+ assert_equals(hostClosed.querySelectorAll('[name=baz]').length, 0); > assert_equals(shadowClosed.querySelectorAll('[name=baz]').length, 1); > assert_equals(shadowClosed.querySelectorAll('[name=baz]')[0].getAttribute('label'), 'shadow-closed-form'); > }, 'getElementsByName() should not leak nodes in shadow tree'); >@@ -126,12 +126,12 @@ test(function() { > assert_equals(doc.querySelectorAll('my-element').length, 1); > assert_equals(doc.getElementsByTagName('my-element')[0].getAttribute('label'), 'doc-my-element'); > >- assert_array_equals(hostOpen.querySelectorAll('my-element').length, 0); >+ assert_equals(hostOpen.querySelectorAll('my-element').length, 0); > // ShadowRoot isn't an Element, does not have getElementsByTagName(). > assert_equals(shadowOpen.querySelectorAll('my-element').length, 1); > assert_equals(shadowOpen.querySelectorAll('my-element')[0].getAttribute('label'), 'shadow-open-my-element'); > >- assert_array_equals(hostClosed.querySelectorAll('my-element').length, 0); >+ assert_equals(hostClosed.querySelectorAll('my-element').length, 0); > assert_equals(shadowClosed.querySelectorAll('my-element').length, 1); > assert_equals(shadowClosed.querySelectorAll('my-element')[0].getAttribute('label'), 'shadow-closed-my-element'); > }, 'getElementsByTagName() should not leak nodes in shadow tree'); >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/w3c-import.log >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/w3c-import.log (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/leaktests/w3c-import.log (working copy) >@@ -1,7 +1,7 @@ > The tests in this directory were imported from the W3C repository. > Do NOT modify these tests directly in WebKit. > Instead, create a pull request on the WPT github: >- https://github.com/w3c/web-platform-tests >+ https://github.com/web-platform-tests/wpt > > Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport > >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/event-path-test-helpers.js >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/event-path-test-helpers.js (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/event-path-test-helpers.js (working copy) >@@ -16,9 +16,6 @@ function dispatchEventWithEventLog(shado > eventPath.push(this.label); > relatedTargets.push(event.relatedTarget ? event.relatedTarget.label : null); > >- if (!event.composedPath) // Don't fail all tests just for the lack of composedPath. >- return; >- > pathAtTargets.push(event.composedPath().map(function (node) { return node.label; })); > targets.push(event.target); > }).bind(node)); >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/shadow-dom-utils.js >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/shadow-dom-utils.js (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/shadow-dom-utils.js (working copy) >@@ -59,6 +59,8 @@ var HTML5_ELEMENT_NAMES = [ > 'wbr' > ]; > >+var ATTACHSHADOW_DISALLOWED_ELEMENTS = HTML5_ELEMENT_NAMES.filter(el => !ATTACHSHADOW_SAFELISTED_ELEMENTS.includes(el)); >+ > function unit(f) { > return function () { > var ctx = newContext(); >Index: LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/w3c-import.log >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/w3c-import.log (revision 235880) >+++ LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/w3c-import.log (working copy) >@@ -1,7 +1,7 @@ > The tests in this directory were imported from the W3C repository. > Do NOT modify these tests directly in WebKit. > Instead, create a pull request on the WPT github: >- https://github.com/w3c/web-platform-tests >+ https://github.com/web-platform-tests/wpt > > Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189494
:
349374
| 349375