Bug 1436991 [wpt PR 9433] - custom-elements: document.createElementNS should not create HTMLUnknownElement for a valid custom element name, a=testonly
authorKent Tamura <tkent@chromium.org>
Tue, 06 Mar 2018 18:29:09 +0000
changeset 407356 3ea4f0746ad6c5817d91571ea2ed579f50c5cded
parent 407355 86d6195a7936ca18903c0c403ecae7f8c75b9282
child 407357 21a741d38bb42d35adac765ecb90dee82a2d0ea6
push id33599
push userapavel@mozilla.com
push dateFri, 09 Mar 2018 19:34:23 +0000
treeherdermozilla-central@3dc420775cf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1436991, 809887, 908128, 535299
milestone60.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 1436991 [wpt PR 9433] - custom-elements: document.createElementNS should not create HTMLUnknownElement for a valid custom element name, a=testonly Automatic update from web-platform-tests Document::CreatRawElement() should check CustomElement::IsValidName(). It failed only if the Document didn't have V0 RegistrationContext. Bug: 809887 Change-Id: I4e5d283658673db3e1db15b136ca5729d29e2442 Reviewed-on: https://chromium-review.googlesource.com/908128 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#535299} <!-- Reviewable:start --> <!-- Reviewable:end --> wpt-commits: e05c355958eb0e673db72063c97dcb8f37a4c3d2 wpt-pr: 9433 reapplied-commits: 370e267e160568862f1fd9ec246ab5bb840f586e, fe4514c84e7ad28e46bad5da93381deb99b177f3, 7806af854343c043a2645a4034fdc7812f65daad, 9ddfd21554293dec5a4bf2e5375ae4f3c9f2ded0, 75f63c4d1ebc949647184fd60972fc7b9fd4affb, 1f3a5b496acd2288cc8cf0c32af86cb35157ea4e, 88b42bd5847abac58a62c4d6b33c1509bfce5f3d, 15c2e4c690700c6c115f8afe5e44ded10d943538, c8d461ef1437641ae7d4ea1d21e1e60cd62910b0, a6088a5f48ee299386a84d2f771902267d7355b1, 0634cd8f08ebe0905a9188fb1398c7b5f889c5dc, c8ee4a012dae506ae06bb5b2ad50942b04c1aaaa, c2c352456a4cf62dcc12f851138b04397675a445, b93a8879555d2fa7e7d4e00a275513a3a6338b35, b86e1331cb36634fd33677043b61fc0c1d8485bc, 44ddf14fd3346658c3223f13652073fafbfa48fa, a1a5840a6bb53e305ba02bcbeb215659342d0edb, 7465cb110ae5ec2e2ca73182caf5293f0efc8fd5, aad5349b3458bc3414e274b33fa86a1123901ff2, eca0907980d2769c449894a6277c60c1a306792f, 38626987c0cfd6e715cfcc6f4f1a1209191a03c5, e4a67f7ddcde6cd99348e9104bd7ed07074da44a, bb3c9990840a0fae2afc840b5952d7874785b112, 042d7adef0bdb9dc80e825c3997ace7519477c42, 99f1ea44fc7915b8b7b33bce4732fa8765fd3ac2, b81999f30c1516a70c153de51a0331d14c8faead
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/custom-elements/Document-createElementNS.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -537414,17 +537414,17 @@
    "9af8f2dc7778feeea4fa8e557d7885b10d325dea",
    "testharness"
   ],
   "custom-elements/Document-createElement.html": [
    "2275720296bd3ea4ef012ed5ef3ea63a4c5f953d",
    "testharness"
   ],
   "custom-elements/Document-createElementNS.html": [
-   "04cd97839e98c6082f67740dbcfc7588e2b251b9",
+   "799f59e3bf8ab0830e44faa3ffef6d3303da42eb",
    "testharness"
   ],
   "custom-elements/HTMLElement-constructor.html": [
    "64522527ef425b90c704b20b000c8feef0d1ca25",
    "testharness"
   ],
   "custom-elements/OWNERS": [
    "9f6553b67cad3b479d3beb678653db4e712ed227",
--- a/testing/web-platform/tests/custom-elements/Document-createElementNS.html
+++ b/testing/web-platform/tests/custom-elements/Document-createElementNS.html
@@ -19,16 +19,24 @@ test(() => {
   class MyElement2 extends HTMLElement {};
 
   customElements.define('my-autonomous2', MyElement2);
   let element = document.createElementNS('urn:example', 'my-autonomous2');
   assert_false(element instanceof MyElement2);
 }, 'autonomous: document.createElementNS should check namespaces.');
 
 test(() => {
+  const xhtmlNS = 'http://www.w3.org/1999/xhtml';
+  assert_false(document.createElementNS(xhtmlNS, 'x-foo') instanceof HTMLUnknownElement);
+  assert_false(document.createElementNS(xhtmlNS, 'x-foo', {}) instanceof HTMLUnknownElement);
+  assert_false((new Document()).createElementNS(xhtmlNS, 'x-foo') instanceof HTMLUnknownElement);
+  assert_false((new Document()).createElementNS(xhtmlNS, 'x-foo', {}) instanceof HTMLUnknownElement);
+}, 'autonomous: document.createElementNS should not create HTMLUnknownElement for a valid custom element name');
+
+test(() => {
   class MyBuiltinElement extends HTMLElement {};
 
   customElements.define('my-builtin', MyBuiltinElement, { extends: 'address' });
   let element = document.createElementNS('http://www.w3.org/1999/xhtml', 'p:address', { is: 'my-builtin'});
   assert_true(element instanceof MyBuiltinElement);
   assert_equals(element.prefix, 'p');
 }, 'builtin: document.createElementNS should create custom elements with prefixes.');