Changeset 238692 in webkit
- Timestamp:
- Nov 29, 2018 1:26:28 PM (5 years ago)
- Location:
- trunk/LayoutTests/imported/w3c
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r238683 r238692 1 2018-11-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Update web-platform-tests/shadow-dom 4 https://bugs.webkit.org/show_bug.cgi?id=192137 5 6 Reviewed by Antti Koivisto. 7 8 Re-imported the shadow DOM tests from wpt. 9 10 * resources/import-expectations.json: 11 * web-platform-tests/shadow-dom/ShadowRoot-interface.html: 12 * web-platform-tests/shadow-dom/event-dispatch-order.tentative-expected.txt: Added. 13 * web-platform-tests/shadow-dom/event-dispatch-order.tentative.html: Added. 14 * web-platform-tests/shadow-dom/input-type-radio-expected.txt: Added. 15 * web-platform-tests/shadow-dom/input-type-radio.html: Added. 16 * web-platform-tests/shadow-dom/resources/shadow-dom.js: 17 (dispatchEventWithLog): 18 (assert_event_path_equals): 19 * web-platform-tests/shadow-dom/slots-outside-shadow-dom-expected.txt: Added. 20 * web-platform-tests/shadow-dom/slots-outside-shadow-dom.html: Added. 21 * web-platform-tests/shadow-dom/w3c-import.log: 22 1 23 2018-11-29 Youenn Fablet <youenn@apple.com> 2 24 -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html
r206999 r238692 95 95 var shadowRoot = host.attachShadow({'mode': mode}); 96 96 97 assert_equals(shadowRoot.styleSheets.length, 0, 'shadowRoot.styleSheets must be empty when the shadow root does not contain any stylesheets');98 97 shadowRoot.innerHTML = '<span></span><style> a.rule {} </style><style> b.rule {} </style>'; 98 assert_equals(shadowRoot.styleSheets.length, 0, 'shadowRoot.styleSheets must be empty when the shadow root is not connected'); 99 100 document.body.appendChild(host); 99 101 assert_equals(shadowRoot.styleSheets.length, 2, 'shadowRoot.styleSheets must contain two items when the shadow root has two style elements'); 100 102 var styles = shadowRoot.querySelectorAll('style'); -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/shadow-dom.js
r206463 r238692 54 54 } 55 55 56 function dispatchEventWithLog(nodes, target, event) { 56 // TODO: Refactor this so that only interested results are recorded. 57 // Callers of this function would not be interested in every results. 58 function dispatchEventWithLog(nodes, target, event, options) { 57 59 58 60 function labelFor(e) { … … 71 73 continue; 72 74 attachedNodes.push(node); 73 node.addEventListener(event.type, (e) => { 75 if (options && options.capture) { 76 // Record [currentTarget, target, relatedTarget, composedPath(), 'capture' | 'non-capture'] 77 // TODO: Support registering listeners in different orders. 78 // e.g. Register a non-capture listener at first, then register a capture listener. 79 node.addEventListener(event.type, (e) => { 80 log.push([id, 81 labelFor(e.target), 82 e.relatedTarget ? labelFor(e.relatedTarget) : null, 83 e.composedPath().map((n) => { 84 return labelFor(n); 85 }), 86 'capture']); 87 }, true); 88 node.addEventListener(event.type, (e) => { 89 log.push([id, 90 labelFor(e.target), 91 e.relatedTarget ? labelFor(e.relatedTarget) : null, 92 e.composedPath().map((n) => { 93 return labelFor(n); 94 }), 95 'non-capture']); 96 }); 97 } else { 74 98 // Record [currentTarget, target, relatedTarget, composedPath()] 75 log.push([id, 76 labelFor(e.target), 77 e.relatedTarget ? labelFor(e.relatedTarget) : null, 78 e.composedPath().map((n) => { 79 return labelFor(n); 80 })]); 81 }); 99 node.addEventListener(event.type, (e) => { 100 log.push([id, 101 labelFor(e.target), 102 e.relatedTarget ? labelFor(e.relatedTarget) : null, 103 e.composedPath().map((n) => { 104 return labelFor(n); 105 })] 106 ); 107 }); 108 } 82 109 } 83 110 } … … 123 150 assert_equals(actual.length, expected.length); 124 151 for (let i = 0; i < actual.length; ++i) { 152 assert_equals(actual[i].length, expected[i].length); 125 153 assert_equals(actual[i][0], expected[i][0], 'currentTarget at ' + i + ' should be same'); 126 154 assert_equals(actual[i][1], expected[i][1], 'target at ' + i + ' should be same'); 127 155 assert_equals(actual[i][2], expected[i][2], 'relatedTarget at ' + i + ' should be same'); 128 156 assert_array_equals(actual[i][3], expected[i][3], 'composedPath at ' + i + ' should be same'); 157 if (actual[i][4]) { 158 assert_equals(actual[i][4], expected[i][4], 'listener type should be same at ' + i); 159 } 129 160 } 130 161 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/w3c-import.log
r235881 r238692 36 36 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path.html 37 37 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed.html 38 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-dispatch-order.tentative.html 38 39 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-shadow-tree.html 39 40 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-slotted-node.html … … 44 45 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/historical.html 45 46 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-element-list.html 47 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html 46 48 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html 47 49 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html … … 54 56 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots-fallback-in-document.html 55 57 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html 58 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots-outside-shadow-dom.html 56 59 /LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots.html
Note: See TracChangeset
for help on using the changeset viewer.