diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/custom-elements/historical.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/custom-elements/historical.html')
-rw-r--r-- | testing/web-platform/tests/custom-elements/historical.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/custom-elements/historical.html b/testing/web-platform/tests/custom-elements/historical.html new file mode 100644 index 0000000000..5a961b13ad --- /dev/null +++ b/testing/web-platform/tests/custom-elements/historical.html @@ -0,0 +1,35 @@ +<!doctype html> +<title>Custom Elements v0 features</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script> +test(() => { + assert_false('registerElement' in document) +}, 'document.registerElement should not exist') + +// These tests should pass as long as v0 isn't supported: +// v0: a 2nd string argument for createElement. +// v1: a ElementCreationOptions (dictionary) argument. +test(() => { + try { + const element = document.createElement('x', 'string') + // If neither v0/v1 are supported, then there should be no is attribute. + assert_false(element.hasAttribute('is')) + } catch (e) { + // If v1 is supported, then converting string to dictionary should throw. + assert_throws_js(TypeError, function() { throw e }) + } +}, 'document.createElement(localName, "string") should not work') + +// createElementNS is analagous, but for the 3rd argument +test(() => { + try { + const element = document.createElementNS(null, 'x', 'string') + // If neither v0/v1 are supported, then there should be no is attribute. + assert_false(element.hasAttribute('is')) + } catch (e) { + // If v1 is supported, then converting string to dictionary should throw. + assert_throws_js(TypeError, function() { throw e }) + } +}, 'document.createElementNS(namespace, qualifiedName, "string") should not work') +</script> |