Skip to content

Commit

Permalink
Give <slot> element default unicode-bidi: isolate style.
Browse files Browse the repository at this point in the history
This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag.

This implements a part of the behavior described in:
whatwg/html#3699 (comment)
which has been specified in:
whatwg/html#9554
whatwg/html#9796

Bug: 576815
Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Di Zhang <dizhangg@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1214439}
  • Loading branch information
dbaron authored and chromium-wpt-export-bot committed Oct 24, 2023
1 parent 446b9bc commit ad41b69
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions html/rendering/bidi-rendering/slot-isolate-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<title>HTML Rendering: slot element has unicode-bidi: isolate</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Google" href="http://www.google.com/">

<div style="unicode-bidi: bidi-override; direction: ltr;">&#x5D0;-&#x5D1;</div>

<div>isolate</div>
22 changes: 22 additions & 0 deletions html/rendering/bidi-rendering/slot-isolate-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>HTML Rendering: slot element has unicode-bidi: isolate</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Google" href="http://www.google.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering">
<link rel="help" href="https://github.com/whatwg/html/pull/9796">
<link rel="match" href="slot-isolate-001-ref.html">

<div>&#x5D0;-<span id="e">&#x5D1;</span></div>

<div id="v"></div>

<script>

let e = document.getElementById("e");
let root = e.attachShadow({mode: "open"});
// use display:inline to override default display:contents
root.innerHTML = "<slot style='display:inline'>\u05D2</slot>";
let val = getComputedStyle(root.querySelector("slot")).unicodeBidi;
document.getElementById("v").innerText = val;

</script>

0 comments on commit ad41b69

Please sign in to comment.