Changeset 207703 in webkit


Ignore:
Timestamp:
Oct 21, 2016 7:47:18 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Update custom elements tests
https://bugs.webkit.org/show_bug.cgi?id=163815

Reviewed by Joseph Pecoraro.

LayoutTests/imported/w3c:

Re-import the custom elements as of 5078aa44879c87c38b6430670583951dbeae3025.

  • web-platform-tests/custom-elements/Document-createElement-expected.txt: Moved from from fast/custom-elements/Document-createElement.html.
  • web-platform-tests/custom-elements/Document-createElement.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write-expected.txt: Moved from from fast/custom-elements/parser/.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-element-synchronously-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-element-synchronously.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-elements-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-constructs-custom-elements.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-uses-constructed-element-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-uses-constructed-element.html: Ditto.
  • web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document-expected.txt: Ditto.
  • web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document.html: Ditto.
  • web-platform-tests/custom-elements/parser/w3c-import.log: Added.
  • web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt:
  • web-platform-tests/custom-elements/reactions/DOMTokenList.html:
  • web-platform-tests/custom-elements/reactions/Document-expected.txt:
  • web-platform-tests/custom-elements/reactions/Document.html:
  • web-platform-tests/custom-elements/reactions/Range-expected.txt:
  • web-platform-tests/custom-elements/reactions/resources/reactions.js:
  • web-platform-tests/custom-elements/upgrading-expected.txt: Added.
  • web-platform-tests/custom-elements/upgrading.html: Moved from fast/custom-elements/enqueue-custom-element-upgrade-reaction.html.
  • web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt: Moved from fast/custom-elements/upgrading/.
  • web-platform-tests/custom-elements/upgrading/Node-cloneNode.html: Ditto.
  • web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element-expected.txt: Ditto.
  • web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html: Ditto.
  • web-platform-tests/custom-elements/upgrading/w3c-import.log: Added.
  • web-platform-tests/custom-elements/w3c-import.log:

LayoutTests:

Removed the tests that have been upstreamed and reimported from web-platform-tests.

  • fast/custom-elements/Document-createElement-expected.txt: Removed.
  • fast/custom-elements/enqueue-custom-element-upgrade-reaction-expected.txt: Removed.
  • fast/custom-elements/parser/: Removed.
  • fast/custom-elements/upgrading/: Removed.
Location:
trunk/LayoutTests
Files:
8 added
4 deleted
9 edited
16 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207702 r207703  
     12016-10-21  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Update custom elements tests
     4        https://bugs.webkit.org/show_bug.cgi?id=163815
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Removed the tests that have been upstreamed and reimported from web-platform-tests.
     9
     10        * fast/custom-elements/Document-createElement-expected.txt: Removed.
     11        * fast/custom-elements/enqueue-custom-element-upgrade-reaction-expected.txt: Removed.
     12        * fast/custom-elements/parser/: Removed.
     13        * fast/custom-elements/upgrading/: Removed.
     14
    1152016-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
    216
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r207660 r207703  
     12016-10-21  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Update custom elements tests
     4        https://bugs.webkit.org/show_bug.cgi?id=163815
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Re-import the custom elements as of 5078aa44879c87c38b6430670583951dbeae3025.
     9
     10        * web-platform-tests/custom-elements/Document-createElement-expected.txt: Moved from from fast/custom-elements/Document-createElement.html.
     11        * web-platform-tests/custom-elements/Document-createElement.html: Ditto.
     12        * web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write-expected.txt: Moved from from fast/custom-elements/parser/.
     13        * web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html: Ditto.
     14        * web-platform-tests/custom-elements/parser/parser-constructs-custom-element-synchronously-expected.txt: Ditto.
     15        * web-platform-tests/custom-elements/parser/parser-constructs-custom-element-synchronously.html: Ditto.
     16        * web-platform-tests/custom-elements/parser/parser-constructs-custom-elements-expected.txt: Ditto.
     17        * web-platform-tests/custom-elements/parser/parser-constructs-custom-elements.html: Ditto.
     18        * web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element-expected.txt: Ditto.
     19        * web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element.html: Ditto.
     20        * web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt: Ditto.
     21        * web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html: Ditto.
     22        * web-platform-tests/custom-elements/parser/parser-uses-constructed-element-expected.txt: Ditto.
     23        * web-platform-tests/custom-elements/parser/parser-uses-constructed-element.html: Ditto.
     24        * web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document-expected.txt: Ditto.
     25        * web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document.html: Ditto.
     26        * web-platform-tests/custom-elements/parser/w3c-import.log: Added.
     27        * web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt:
     28        * web-platform-tests/custom-elements/reactions/DOMTokenList.html:
     29        * web-platform-tests/custom-elements/reactions/Document-expected.txt:
     30        * web-platform-tests/custom-elements/reactions/Document.html:
     31        * web-platform-tests/custom-elements/reactions/Range-expected.txt:
     32        * web-platform-tests/custom-elements/reactions/resources/reactions.js:
     33        * web-platform-tests/custom-elements/upgrading-expected.txt: Added.
     34        * web-platform-tests/custom-elements/upgrading.html: Moved from fast/custom-elements/enqueue-custom-element-upgrade-reaction.html.
     35        * web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt: Moved from fast/custom-elements/upgrading/.
     36        * web-platform-tests/custom-elements/upgrading/Node-cloneNode.html: Ditto.
     37        * web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element-expected.txt: Ditto.
     38        * web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html: Ditto.
     39        * web-platform-tests/custom-elements/upgrading/w3c-import.log: Added.
     40        * web-platform-tests/custom-elements/w3c-import.log:
     41
    1422016-10-20  Zan Dobersek  <zdobersek@igalia.com>
    243
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/Document-createElement.html

    r207702 r207703  
    22<html>
    33<head>
    4 <title>Custom Elements: Extensions to Document interface</title>
     4<title>Custom Elements: document.createElement should create an element with synchronous custom elements flag set</title>
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    6 <meta name="assert" content="document.createElement should instantiate a custom element">
    7 <script src="../../resources/testharness.js"></script>
    8 <script src="../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../resources/testharness.css'>
    10 <script src="resources/document-types.js"></script>
     6<meta name="assert" content="document.createElement should create an element with synchronous custom elements flag set">
     7<link rel="help" content="https://dom.spec.whatwg.org/#dom-document-createelement">
     8<link rel="help" content="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
     11<script src="resources/custom-elements-helper.js"></script>
    1112</head>
    1213<body>
     
    222223}, 'document.createElement must not report a NotSupportedError when the element is inserted and removed from another element during construction');
    223224
    224 DocumentTypes.forEach(function (entry, testNumber) {
     225document_types().forEach(function (entry, testNumber) {
    225226    if (entry.isOwner)
    226227        return;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must construct custom elements inside document.write">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<link rel="help" href="https://html.spec.whatwg.org/#document.write()">
     10<script src="/resources/testharness.js"></script>
     11<script src="/resources/testharnessreport.js"></script>
    1012</head>
    1113<body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-synchronously.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must construct a custom element synchronously">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
    1011</head>
    1112<body>
     
    1516var childElementCountInConstructor;
    1617var containerChildNodesInConstructor = [];
    17 var containerNextSilbingInConstructor;
     18var containerNextSiblingInConstructor;
    1819class MyCustomElement extends HTMLElement {
    1920    constructor() {
     
    2223        for (var i = 0; i < container.childNodes.length; i++)
    2324            containerChildNodesInConstructor.push(container.childNodes[i]);
    24         containerNextSilbingInConstructor = container.nextSibling;
     25        containerNextSiblingInConstructor = container.nextSibling;
    2526    }
    2627};
     
    4243    assert_equals(containerChildNodesInConstructor[1], document.getElementById('custom-element-previous-element'));
    4344    assert_equals(containerChildNodesInConstructor[2], instance.previousSibling);
    44     assert_equals(containerNextSilbingInConstructor, null);
     45    assert_equals(containerNextSiblingInConstructor, null);
    4546
    4647}, 'HTML parser must only append nodes that appear before a custom element before instantiating the custom element');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-elements.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser creates a custom element">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
    1011</head>
    1112<body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element-expected.txt

    r207702 r207703  
    11CONSOLE MESSAGE: TypeError: The result of constructing a custom element must be a HTMLElement
    22CONSOLE MESSAGE: TypeError: The result of constructing a custom element must be a HTMLElement
    3 CONSOLE MESSAGE: line 32: ReferenceError: Cannot access uninitialized variable.
    4 CONSOLE MESSAGE: line 38: Bad
    5 
    6 Harness Error (FAIL), message = Bad
     3CONSOLE MESSAGE: line 35: ReferenceError: Cannot access uninitialized variable.
     4CONSOLE MESSAGE: line 41: Bad
    75
    86PASS HTML parser must create a fallback HTMLUnknownElement when a custom element constructor returns a Text node
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-fallsback-to-unknown-element.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must fallback to creating a HTMLUnknownElement when a custom element construction fails">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
    1011</head>
    1112<body>
    1213<div id="log"></div>
    1314<script>
     15
     16setup({allow_uncaught_exception:true});
    1417
    1518class ReturnsTextNode extends HTMLElement {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must set the attributes and append the children on a custom element">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
    1011</head>
    1112<body>
     
    3839    assert_equals(customElement.classList[0], 'class1', 'HTML parser must initialize classList on custom elements');
    3940    assert_equals(customElement.classList[1], 'class2', 'HTML parser must initialize classList on custom elements');
    40 
    41     assert_equals(customElement.childNodes.length, 2, 'HTML parser must append child nodes');
    42     assert_equals(customElement.classList[0], 'class1', 'HTML parser must initialize classList on custom elements');
    43     assert_equals(customElement.classList[1], 'class2', 'HTML parser must initialize classList on custom elements');
    44 
    4541}, 'HTML parser must set the attributes');
    4642
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-uses-constructed-element.html

    r207702 r207703  
    22<html>
    33<head>
    4 <title>Custom Elements: Changes to the HTML parser</title>
     4<title>Custom Elements: HTML parser must construct a custom element instead of upgrading</title>
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must construct a custom element instead of upgrading">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<script src="/resources/testharness.js"></script>
     8<script src="/resources/testharnessreport.js"></script>
     9<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     10<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
    1011</head>
    1112<body>
     
    5354    var instance = document.querySelector('instantiates-itself-before-super');
    5455
     56    assert_equals(instance instanceof InstantiatesItselfBeforeSuper, 'HTML parser must insert the synchronously constructed custom element');
    5557    assert_equals(instance, elementCreatedBySuperCall, 'HTML parser must insert the element returned by the custom element constructor');
    5658    assert_not_equals(instance, anotherElementCreatedBeforeSuperCall, 'HTML parser must not insert another instance of the custom element created before super() call');
     
    6264    var instance = document.querySelector('returns-another-instance');
    6365
     66    assert_equals(instance instanceof ReturnsAnotherInstance, 'HTML parser must insert the synchronously constructed custom element');
    6467    assert_equals(instance, anotherInstance, 'HTML parser must insert the element returned by the custom element constructor');
    6568    assert_not_equals(instance, firstInstance, 'HTML parser must not insert the element created by super() call if the constructor returned another element');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document-expected.txt

    r207702 r207703  
    66PASS HTML parser must use the registry of window.document in a document created by document.implementation.createHTMLDocument()
    77PASS HTML parser must use the registry of window.document in a document created by document.implementation.createXHTMLDocument()
     8PASS HTML parser must use the registry of window.document in a document created by new Document
     9PASS HTML parser must use the registry of window.document in a document created by XMLHttpRequest
    810
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document.html

    r207702 r207703  
    22<html>
    33<head>
    4 <title>Custom Elements: Changes to the HTML parser</title>
     4<title>Custom Elements: HTML parser must use the owner document's custom element registry</title>
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must use the owner document's custom element registry">
    7 <script src="../../../resources/testharness.js"></script>
    8 <script src="../../../resources/testharnessreport.js"></script>
    9 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-token">
     8<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
     9<script src="/resources/testharness.js"></script>
     10<script src="/resources/testharnessreport.js"></script>
    1011</head>
    1112<body>
     
    7071document.body.removeChild(iframe);
    7172
    72 var windowlessDocument = document.implementation.createHTMLDocument();
    73 windowlessDocument.open();
    74 windowlessDocument.write('<my-custom-element></my-custom-element>');
    75 windowlessDocument.close();
     73test(function () {
     74    var windowlessDocument = document.implementation.createHTMLDocument();
     75    windowlessDocument.open();
     76    windowlessDocument.write('<my-custom-element></my-custom-element>');
     77    windowlessDocument.close();
    7678
    77 test(function () {
    7879    var instance = windowlessDocument.querySelector('my-custom-element');
    7980
     
    8384}, 'HTML parser must use the registry of window.document in a document created by document.implementation.createHTMLDocument()');
    8485
    85 windowlessDocument = document.implementation.createDocument ('http://www.w3.org/1999/xhtml', 'html', null);
    86 windowlessDocument.documentElement.innerHTML = '<my-custom-element></my-custom-element>';
     86test(function () {
     87    var windowlessDocument = document.implementation.createDocument ('http://www.w3.org/1999/xhtml', 'html', null);
     88    windowlessDocument.documentElement.innerHTML = '<my-custom-element></my-custom-element>';
    8789
    88 test(function () {
    8990    var instance = windowlessDocument.querySelector('my-custom-element');
    90 
    9191    assert_true(instance instanceof HTMLElement);
    9292    assert_false(instance instanceof MyCustomElement);
     
    9494}, 'HTML parser must use the registry of window.document in a document created by document.implementation.createXHTMLDocument()');
    9595
     96test(function () {
     97    var windowlessDocument = new Document;
     98    windowlessDocument.appendChild(windowlessDocument.createElement('html'));
     99    windowlessDocument.documentElement.innerHTML = '<my-custom-element></my-custom-element>';
     100
     101    var instance = windowlessDocument.querySelector('my-custom-element');
     102
     103    assert_true(instance instanceof Element);
     104    assert_false(instance instanceof MyCustomElement);
     105
     106}, 'HTML parser must use the registry of window.document in a document created by new Document');
     107
     108promise_test(function () {
     109    return new Promise(function (resolve, reject) {
     110        var xhr = new XMLHttpRequest();
     111        xhr.open('GET', '../resources/empty-html-document.html');
     112        xhr.overrideMimeType('text/xml');
     113        xhr.onload = function () { resolve(xhr.responseXML); }
     114        xhr.onerror = function () { reject('Failed to fetch the document'); }
     115        xhr.send();
     116    }).then(function (doc) {
     117        doc.documentElement.innerHTML = '<my-custom-element></my-custom-element>';
     118        var instance = doc.querySelector('my-custom-element');
     119        assert_true(instance instanceof Element);
     120        assert_false(instance instanceof MyCustomElement);       
     121    });
     122}, 'HTML parser must use the registry of window.document in a document created by XMLHttpRequest');
     123
    96124</script>
    97125</body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt

    r207170 r207703  
    77PASS remove on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute
    88PASS remove on DOMTokenList must enqueue exactly one attributeChanged reaction when removing multiple values to an attribute
    9 FAIL remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a non-existent value from an attribute assert_array_equals: lengths differ, expected 0 got 1
     9PASS remove on DOMTokenList must enqueue an attributeChanged reaction even when removing a non-existent value from an attribute
    1010PASS remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a value from an unobserved attribute
    1111PASS toggle on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an attribute
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/DOMTokenList.html

    r206999 r207703  
    9090    assert_array_equals(element.takeLog().types(), ['constructed', 'attributeChanged']);
    9191    instance.classList.remove('foo');
    92     assert_array_equals(element.takeLog().types(), []);
    93 }, 'remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a non-existent value from an attribute');
     92    var logEntries = element.takeLog();
     93    assert_array_equals(logEntries.types(), ['attributeChanged']);
     94    assert_attribute_log_entry(logEntries.last(), {name: 'class', oldValue: 'hello world', newValue: 'hello world', namespace: null});
     95}, 'remove on DOMTokenList must enqueue an attributeChanged reaction even when removing a non-existent value from an attribute');
    9496
    9597test(function () {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Document-expected.txt

    r207571 r207703  
    11
    2 FAIL importNode on Document must construct a new custom element when importing a custom element assert_array_equals: lengths differ, expected 1 got 0
     2PASS importNode on Document must not construct a new custom element when importing a custom element into a window-less document
     3PASS importNode on Document must construct a new custom element when importing a custom element from a template
    34PASS adoptNode on Document must enqueue an adopted reaction when importing a custom element
    45PASS execCommand on Document must enqueue a disconnected reaction when deleting a custom element from a contenteditable element
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Document.html

    r207520 r207703  
    2424    newDoc.importNode(instance);
    2525
    26     var logEntries = element.takeLog();
    27     assert_array_equals(logEntries.types(), ['constructed']);
    28     assert_equals(logEntries.last().oldDocument, document);
    29     assert_equals(logEntries.last().newDocument, newDoc);
    30 }, 'importNode on Document must construct a new custom element when importing a custom element');
     26    assert_array_equals(element.takeLog().types(), []);
     27}, 'importNode on Document must not construct a new custom element when importing a custom element into a window-less document');
     28
     29test(function () {
     30    var element = define_new_custom_element();
     31    var template = document.createElement('template');
     32    template.innerHTML = `<${element.name}></${element.name}>`;
     33    assert_array_equals(element.takeLog().types(), []);
     34    document.importNode(template.content, true);
     35    assert_array_equals(element.takeLog().types(), ['constructed']);
     36}, 'importNode on Document must construct a new custom element when importing a custom element from a template');
    3137
    3238test(function () {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Range-expected.txt

    r207520 r207703  
    99PASS surroundContents on Range must enqueue a connected reaction
    1010PASS surroundContents on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    11 FAIL createContextualFragment on Range must construct a custom element assert_equals: expected (function) function "class CustomElement extends HTMLElement {
    12         constru..." but got (object) object "[object Object]"
     11FAIL createContextualFragment on Range must construct a custom element assert_array_equals: lengths differ, expected 2 got 1
    1312
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/resources/reactions.js

    r207520 r207703  
    7474        assert_array_equals(element.takeLog().types(), []);
    7575        var instance = testFunction(document, `<${element.name} id="hello" class="foo"></${element.name}>`);
    76         assert_equals(Object.getPrototypeOf(instance.querySelector(element.name)), element.class);
     76        assert_equals(Object.getPrototypeOf(instance.querySelector(element.name)), element.class.prototype);
    7777        var logEntries = element.takeLog();
    7878        assert_array_equals(logEntries.types(), ['constructed', 'attributeChanged']);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html

    r207702 r207703  
    88<link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade">
    99<link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-upgrade-reaction">
    10 <script src="../../resources/testharness.js"></script>
    11 <script src="../../resources/testharnessreport.js"></script>
    12 <link rel='stylesheet' href='../../resources/testharness.css'>
    13 <script src="resources/document-types.js"></script>
     10<script src="/resources/testharness.js"></script>
     11<script src="/resources/testharnessreport.js"></script>
     12<script src="resources/custom-elements-helpers.js"></script>
    1413</head>
    1514<body>
     
    2322function generateNextCustomElementName() { return 'custom-' + customElementNumber++; }
    2423
    25 DocumentTypes.filter(function (entry) { return !entry.isOwner && !entry.hasBrowsingContext; }).forEach(function (entry) {
     24// Tests for documents without a browsing context.
     25document_types().filter(function (entry) { return !entry.isOwner && !entry.hasBrowsingContext; }).forEach(function (entry) {
    2626    var documentName = entry.name;
    2727    var getDocument = entry.create;
     
    8686});
    8787
    88 DocumentTypes.filter(function (entry) { return !entry.isOwner && entry.hasBrowsingContext; }).forEach(function (entry) {
     88// Tests for documents with a browsing context.
     89document_types().filter(function (entry) { return !entry.isOwner && entry.hasBrowsingContext; }).forEach(function (entry) {
    8990    var documentName = entry.name;
    9091    var getDocument = entry.create;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt

    r207702 r207703  
    33PASS Node.prototype.cloneNode(false) must be able to clone a custom element inside an iframe
    44PASS Node.prototype.cloneNode(true) must be able to clone a descendent custom element
    5 PASS Node.prototype.cloneNode(true) must be able to clone a descendent custom element
     5PASS Node.prototype.cloneNode(true) must set parentNode, previousSibling, and nextSibling before upgrading custom elements
    66PASS HTMLElement constructor must throw an InvalidStateError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself after super() call
    77PASS HTMLElement constructor must throw an InvalidStateError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself before super() call
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html

    r207702 r207703  
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    66<meta name="assert" content="HTML parser must add an unresolved custom element to the upgrade candidates map">
    7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/custom/#upgrading">
    8 <script src="../../../resources/testharness.js"></script>
    9 <script src="../../../resources/testharnessreport.js"></script>
    10 <link rel='stylesheet' href='../../../resources/testharness.css'>
     7<link rel="help" href="https://html.spec.whatwg.org/#upgrades">
     8<script src="/resources/testharness.js"></script>
     9<script src="/resources/testharnessreport.js"></script>
    1110</head>
    1211<body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log

    r206838 r207703  
    1717List of files:
    1818/LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html
     19/LayoutTests/imported/w3c/web-platform-tests/custom-elements/Document-createElement.html
    1920/LayoutTests/imported/w3c/web-platform-tests/custom-elements/HTMLElement-constructor.html
    2021/LayoutTests/imported/w3c/web-platform-tests/custom-elements/OWNERS
     
    2425/LayoutTests/imported/w3c/web-platform-tests/custom-elements/disconnected-callbacks.html
    2526/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reaction-timing.html
     27/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html
Note: See TracChangeset for help on using the changeset viewer.