Bug 1450754 [wpt PR 10272] - Fix customElements.upgrade() tests for <template>, a=testonly
authorDomenic Denicola <d@domenic.me>
Mon, 09 Apr 2018 21:31:38 +0000
changeset 467248 8cfc4131191bfd7fc017bcaf2702396b94bb8173
parent 467247 022e65717ac8ffc346fb6dd026022a7e9736f287
child 467249 3f0a1ed7321692654d74ee66b280fe4ce0e699b9
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1450754, 10272
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1450754 [wpt PR 10272] - Fix customElements.upgrade() tests for <template>, a=testonly Automatic update from web-platform-testsFix customElements.upgrade() tests for <template> (#10272) * Fix customElements.upgrade() tests for <template> See https://github.com/w3c/web-platform-tests/pull/9869#issuecomment-378002725. * Actually fix things wpt-commits: 5b68d219206139c0bfeec65c88e765749aed57fb wpt-pr: 10272 wpt-commits: 5b68d219206139c0bfeec65c88e765749aed57fb wpt-pr: 10272
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/custom-elements/custom-element-registry/upgrade.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -546362,17 +546362,17 @@
    "4f3d4da1aae8efab035a4b951147904d71e7de3b",
    "testharness"
   ],
   "custom-elements/custom-element-registry/per-global.html": [
    "3b143f80d77a0b15b59cc6e6f5344f85dafe4f4e",
    "testharness"
   ],
   "custom-elements/custom-element-registry/upgrade.html": [
-   "a5c2ced54f7031d02009c9853a7ee4e883151cb3",
+   "1f82577bf6aab4ba72b3e3f017a091ad29680da7",
    "testharness"
   ],
   "custom-elements/disconnected-callbacks.html": [
    "ad030517981b11892126023bc758b7fe323a3d14",
    "testharness"
   ],
   "custom-elements/historical.html": [
    "991ebcff1d8b59a7a4d959f3061a17e0e8a83704",
--- a/testing/web-platform/tests/custom-elements/custom-element-registry/upgrade.html
+++ b/testing/web-platform/tests/custom-elements/custom-element-registry/upgrade.html
@@ -140,15 +140,18 @@ test(() => {
   assert_false(el1 instanceof Element1, "element 1 must not yet be upgraded despite upgrading the template");
   assert_false(el2 instanceof Element2, "element 2 must not yet be upgraded despite upgrading the template");
   assert_false(el3 instanceof Element3, "element 3 must not yet be upgraded despite upgrading the template");
   assert_false(el4 instanceof Element4, "element 4 must not yet be upgraded despite upgrading the template");
   assert_false(el5 instanceof Element5, "element 5 must not yet be upgraded despite upgrading the template");
 
   customElements.upgrade(template.content);
 
-  assert_true(el1 instanceof Element1, "element 1 must now be upgraded");
-  assert_true(el2 instanceof Element2, "element 2 must now be upgraded");
-  assert_true(el3 instanceof Element3, "element 3 must now be upgraded");
-  assert_true(el4 instanceof Element4, "element 4 must now be upgraded");
-  assert_true(el5 instanceof Element5, "element 5 must now be upgraded");
+  // Template contents owner documents don't have a browsing context, so
+  // https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition does not find any
+  // custom element definition.
+  assert_false(el1 instanceof Element1, "element 1 must still not be upgraded after upgrading the template contents");
+  assert_false(el2 instanceof Element2, "element 2 must still not be upgraded after upgrading the template contents");
+  assert_false(el3 instanceof Element3, "element 3 must still not be upgraded after upgrading the template contents");
+  assert_false(el4 instanceof Element4, "element 4 must still not be upgraded after upgrading the template contents");
+  assert_false(el5 instanceof Element5, "element 5 must still not be upgraded after upgrading the template contents");
 }, "Elements inside a template contents DocumentFragment node");
 </script>