Skip to content

Commit

Permalink
Bug 1862032 [wpt PR 42811] - Revert recent changes to inheritance of …
Browse files Browse the repository at this point in the history
…direction and language for <slot> elements., a=testonly

Automatic update from web-platform-tests
Revert recent changes to inheritance of direction and language for <slot> elements. (#42811)

This changes the way <slot> elements inherit the HTML concepts of
direction and language to inherit from their parent, rather than from
their shadow root's host.

This matches the changes that I'm proposing in:
whatwg/html#9880

These changes are all behind flags that are slated to ship in M120:
CSSPseudoDir for the direction changes and HTMLLangNewInheritance for
the language changes.

Bug: 576815, 1490711
Change-Id: I152d8e21e24e77c9359744019b3ab875c2a21727
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4984312
Reviewed-by: Di Zhang <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1216286}

Co-authored-by: L. David Baron <[email protected]>
--

wpt-commits: e873a33f5a8564beb3864cb779e0c774aa4816c7
wpt-pr: 42811
  • Loading branch information
chromium-wpt-export-bot authored and moz-wptsync-bot committed Nov 19, 2023
1 parent 756f0d1 commit 1a53264
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<p>`dir=ltr` on a div in the shadow tree, text in the light tree</p>
<div id="host" dir="rtl"><div dir="ltr"><span>اختبر.</span></div></div>
<p id="result">The HTML direction / computed CSS `direction` value for the span is: rtl / ltr.</p>
<p id="result">The HTML direction / computed CSS `direction` value for the slot is: ltr / ltr.</p>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<p>`dir=ltr` on a div in the shadow tree, text in the light tree</p>
<div id="host" dir="rtl"><span>اختبر.</span></div>
<p id="result">The HTML direction / computed CSS `direction` value for the span is: </p>
<p id="result">The HTML direction / computed CSS `direction` value for the slot is: </p>

<script type="text/javascript">
let root = host.attachShadow({mode:"open"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</head>
<body>

<p>`dir=ltr` on a div in the shadow tree, `dir=rtl` on the shadow host, no slotted text in the light or dark trees</p>
<div id="host" dir="rtl"><div dir="ltr"><span dir="rtl"></span></div></div>
<p>`dir=rtl` on a div in the shadow tree, `dir=ltr` on the shadow host, no slotted text in the light or dark trees</p>
<div id="host" dir="ltr"><div dir="rtl"><span></span></div></div>
<p id="result">The HTML direction / computed CSS `direction` value is: rtl / rtl (on the slot).</p>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
</head>
<body>

<p>`dir=ltr` on a div in the shadow tree, `dir=rtl` on the shadow host, no slotted text in the light or dark trees</p>
<div id="host" dir="rtl"><span slot="x1"></span></div>
<p>`dir=rtl` on a div in the shadow tree, `dir=ltr` on the shadow host, no slotted text in the light or dark trees</p>
<div id="host" dir="ltr"><span slot="x1"></span></div>
<p id="result">The HTML direction / computed CSS `direction` value is: </p>

<script type="text/javascript">
let root = host.attachShadow({mode:"open"});
root.innerHTML = `<div dir="ltr"><slot dir="auto" name="x1"></slot></div>`;
result.innerHTML += html_direction(root.querySelector("div[dir=ltr]").firstChild) + " / " + getComputedStyle(root.querySelector("div[dir=ltr]").firstChild).direction + " (on the " + root.querySelector("div[dir=ltr]").firstChild.localName + ').';
root.innerHTML = `<div dir="rtl"><slot dir="auto" name="x1"></slot></div>`;
result.innerHTML += html_direction(root.querySelector("div[dir=rtl]").firstChild) + " / " + getComputedStyle(root.querySelector("div[dir=rtl]").firstChild).direction + " (on the " + root.querySelector("div[dir=rtl]").firstChild.localName + ').';
</script>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const TESTS = [
`,
},
{
title: "lang on slot inherits from shadow host",
title: "lang on slot inherits from parent",
light_tree: `
<div id="host" lang="en-GB" data-expected="en-GB"><span lang="en-US" data-expected="en-US"></span></div>
`,
shadow_tree: `
<div lang="en-CA" data-expected="en-CA">
<slot data-expected="en-GB"></slot>
<slot data-expected="en-CA"></slot>
</div>
`,
},
Expand Down

0 comments on commit 1a53264

Please sign in to comment.