mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939
This commit is contained in:
parent
e8fdc677f4
commit
2b35c55ac7
63 changed files with 2068 additions and 340 deletions
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Shadow DOM: Attaching a ShadowRoot for custom elements</title>
|
||||
<meta name="author" title="Hayato Ito" href="mailto:hayato@chromium.org">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-attachshadow">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
class MyAutonomousCustomElement extends HTMLElement {
|
||||
}
|
||||
|
||||
customElements.define('my-custom', MyAutonomousCustomElement);
|
||||
|
||||
test(() => {
|
||||
assert_true(document.createElement('my-custom').attachShadow({mode: "open"}) instanceof ShadowRoot);
|
||||
}, 'Element.attachShadow must create an instance of ShadowRoot for autonomous custom elements');
|
||||
|
||||
class MyCustomizedBuiltinElement extends HTMLInputElement {
|
||||
}
|
||||
|
||||
customElements.define('my-input', MyCustomizedBuiltinElement, { extends: 'input' });
|
||||
|
||||
test(() => {
|
||||
assert_throws({'name': 'NotSupportedError'}, () => {
|
||||
document.createElement('input', {is: 'my-input'}).attachShadow({mode: "open"});
|
||||
});
|
||||
}, 'Element.attachShadow must throw a NotSupportedError for customized built-in elements');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue