Skip to content

Commit

Permalink
Bug 1624037 [wpt PR 22368] - Add the shadowrootdelegatesfocus attribu…
Browse files Browse the repository at this point in the history
…te to declarative Shadow DOM, a=testonly

Automatic update from web-platform-tests
Add the shadowrootdelegatesfocus attribute to declarative Shadow DOM

This CL adds the ability to control the delegatesFocus (and eventually
the manualSlotting) parameter of the attachShadow command using
declarative Shadow DOM.

Bug: 1042130
Change-Id: I8cc973ca196151fdc29a1194e25eb86f15849e16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107362
Commit-Queue: Mason Freed <masonfreedchromium.org>
Reviewed-by: Kouhei Ueno <kouheichromium.org>
Auto-Submit: Mason Freed <masonfreedchromium.org>
Cr-Commit-Position: refs/heads/master{#752229}

--

wpt-commits: f2c1dfe9ae186350086dbe505c4baaab63ace1cc
wpt-pr: 22368

UltraBlame original commit: 31435b66c9698951d6253ff0b5d7b4b38561ce42
  • Loading branch information
marco-c committed Mar 31, 2020
1 parent b539e59 commit 70067e4
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,26 @@
assert_true(!!s1,"Slot should be inside the shadow root");
}, 'Declarative Shadow DOM: Missing closing tag');

test(() => {
const div = document.createElement('div');
div.innerHTML = `
<div id="host">
<template shadowroot="open" shadowrootdelegatesfocus>
</template>
</div>
`;
var host = div.querySelector('#host');
assert_true(!!host.shadowRoot,"No shadow root found");
assert_true(host.shadowRoot.delegatesFocus,"delegatesFocus should be true");
div.innerHTML = `
<div id="host">
<template shadowroot="open">
</template>
</div>
`;
host = div.querySelector('#host');
assert_true(!!host.shadowRoot,"No shadow root found");
assert_false(host.shadowRoot.delegatesFocus,"delegatesFocus should be false without the shadowrootdelegatesfocus attribute");
}, 'Declarative Shadow DOM: delegates focus attribute');

</script>

0 comments on commit 70067e4

Please sign in to comment.