Changeset 238692 in webkit


Ignore:
Timestamp:
Nov 29, 2018 1:26:28 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

Update web-platform-tests/shadow-dom
https://bugs.webkit.org/show_bug.cgi?id=192137

Reviewed by Antti Koivisto.

Re-imported the shadow DOM tests from wpt.

  • resources/import-expectations.json:
  • web-platform-tests/shadow-dom/ShadowRoot-interface.html:
  • web-platform-tests/shadow-dom/event-dispatch-order.tentative-expected.txt: Added.
  • web-platform-tests/shadow-dom/event-dispatch-order.tentative.html: Added.
  • web-platform-tests/shadow-dom/input-type-radio-expected.txt: Added.
  • web-platform-tests/shadow-dom/input-type-radio.html: Added.
  • web-platform-tests/shadow-dom/resources/shadow-dom.js:

(dispatchEventWithLog):
(assert_event_path_equals):

  • web-platform-tests/shadow-dom/slots-outside-shadow-dom-expected.txt: Added.
  • web-platform-tests/shadow-dom/slots-outside-shadow-dom.html: Added.
  • web-platform-tests/shadow-dom/w3c-import.log:
Location:
trunk/LayoutTests/imported/w3c
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r238683 r238692  
     12018-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
    1232018-11-29  Youenn Fablet  <youenn@apple.com>
    224
  • trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html

    r206999 r238692  
    9595        var shadowRoot = host.attachShadow({'mode': mode});
    9696
    97         assert_equals(shadowRoot.styleSheets.length, 0, 'shadowRoot.styleSheets must be empty when the shadow root does not contain any stylesheets');
    9897        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);
    99101        assert_equals(shadowRoot.styleSheets.length, 2, 'shadowRoot.styleSheets must contain two items when the shadow root has two style elements');
    100102        var styles = shadowRoot.querySelectorAll('style');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/resources/shadow-dom.js

    r206463 r238692  
    5454}
    5555
    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.
     58function dispatchEventWithLog(nodes, target, event, options) {
    5759
    5860  function labelFor(e) {
     
    7173        continue;
    7274      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 {
    7498        // 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      }
    82109    }
    83110  }
     
    123150  assert_equals(actual.length, expected.length);
    124151  for (let i = 0; i < actual.length; ++i) {
     152    assert_equals(actual[i].length, expected[i].length);
    125153    assert_equals(actual[i][0], expected[i][0], 'currentTarget at ' + i + ' should be same');
    126154    assert_equals(actual[i][1], expected[i][1], 'target at ' + i + ' should be same');
    127155    assert_equals(actual[i][2], expected[i][2], 'relatedTarget at ' + i + ' should be same');
    128156    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    }
    129160  }
    130161}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/w3c-import.log

    r235881 r238692  
    3636/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-composed-path.html
    3737/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
    3839/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-shadow-tree.html
    3940/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/event-inside-slotted-node.html
     
    4445/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/historical.html
    4546/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
    4648/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html
    4749/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html
     
    5456/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots-fallback-in-document.html
    5557/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
    5659/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/slots.html
Note: See TracChangeset for help on using the changeset viewer.