-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unicode-bidi UA stylesheet rules
Per spec: https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering this should be in the UA stylesheet: address, blockquote, center, div, figure, figcaption, footer, form, header, hr, legend, listing, main, p, plaintext, pre, summary, xmp, article, aside, h1, h2, h3, h4, h5, h6, hgroup, nav, section, search, table, caption, colgroup, col, thead, tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, bdi, output, [dir=ltr i], [dir=rtl i], [dir=auto i] { unicode-bidi: isolate; } To avoid breakage, I just added the elements, and not the [dir] related rules, nor did I change the <bdo> rules. Firefox and WebKit are both making the same change: https://bugzilla.mozilla.org/show_bug.cgi?id=1874033 https://bugs.webkit.org/show_bug.cgi?id=267887 The stylesheet change interacts with the code at [1], and that code also handles some of the cases such as [dir=auto] and bdi/bdo. I will clean up some of the code at [1] in a followup CL. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=344-363;drc=20fecf94cc2226674dfefd698e96d8d44485b19c Fixed: 1520671 Change-Id: Icaa32061efc59d963942b0629327bb596ac224ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5240082 Auto-Submit: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Commit-Queue: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1255819}
- Loading branch information
1 parent
78ce8e7
commit 53f8b53
Showing
5 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<title>unicode-bidi UA stylesheet rules</title> | ||
<link rel="author" href="[email protected]"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering"> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
|
||
<body> | ||
<script> | ||
const elements = ['address', 'blockquote', 'center', 'div', 'figure', | ||
'figcaption', 'footer', 'form', 'header', 'hr', 'legend', 'listing', | ||
'main', 'p', 'plaintext', 'pre', 'summary', 'xmp', 'article', 'aside', | ||
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup', 'nav', 'section', 'search', | ||
'table', 'caption', 'colgroup', 'col', 'thead', 'tbody', 'tfoot', 'tr', | ||
'td', 'th', 'dir', 'dd', 'dl', 'dt', 'menu', 'ol', 'ul', 'li', 'bdi', | ||
'output']; | ||
for(let tagname of elements) { | ||
test((t) => { | ||
const element = document.createElement(tagname); | ||
t.add_cleanup(() => element.remove()); | ||
document.body.appendChild(element); | ||
assert_equals(window.getComputedStyle(element, "").unicodeBidi,'isolate'); | ||
},`UA stylesheet rule for unicode-bidi, for <${tagname}>`); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters