Skip to content

Commit

Permalink
Bug 1874045 [wpt PR 43933] - Fix HTML directionality inheritance for …
Browse files Browse the repository at this point in the history
…empty <bdi> elements with no dir attribute., a=testonly

Automatic update from web-platform-tests
Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute.

This correctly initializes the flag indicating that the HTML
directionality is inherited from the parent for <bdi> elements, which
behaves like it has dir=auto by default.  Even without this change, it
gets initialized correctly when a dir attribute is changed or when the
text content of the element changes.

This also clears the same flag when the dir attribute changes.  This
should affect some other cases of dir attribute changes, but we somehow
didn't hit it until fixing the previous bug exposed the problem.

This fixes the failure of a test that I added in
web-platform-tests/wpt#43896 in response to
noticing and fixing an error I made in the HTML spec in
whatwg/html#10005 .

Bug: 576815
Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678
Commit-Queue: Mason Freed <masonfchromium.org>
Reviewed-by: Di Zhang <dizhanggchromium.org>
Auto-Submit: David Baron <dbaronchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1246176}

--

wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97
wpt-pr: 43933

UltraBlame original commit: 47d17edd3a1e39fc011b5453c3bab92e905b0e2d
  • Loading branch information
marco-c committed Jan 16, 2024
1 parent 3290376 commit 42026a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
&#x202D; - The LRO (left-to-right override) formatting character.
&#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
In each DIV of the test:
- the first BDI, having no characters with strong direction, should be LTR by default;
- the first BDI, having no characters with strong direction, should inherit the parent direction;
- the second BDI, having an LTR character first, should be LTR by default;
- the third BDI, having an RTL character first, should be RTL by default.
</div>
<div class="test">
<div dir="ltr"><bdi>[:)]</bdi>, <bdi>[+- a &#x05D1;]</bdi>, <bdi>[1 &#x05D2; d]</bdi>...</div>
<div dir="rtl"><bdi>[:)]</bdi>, <bdi>[+- a &#x05D1;]</bdi>, <bdi>[1 &#x05D2; d]</bdi>...</div>
<div dir="rtl"><bdi>[(:]</bdi>, <bdi>[+- a &#x05D1;]</bdi>, <bdi>[1 &#x05D2; d]</bdi>...</div>
</div>
<div class="ref">
<div dir="ltr">&#x202D;[:)], [+- a &#x05D1;], [d &#x05D2; 1]...&#x202C;</div>
Expand Down

0 comments on commit 42026a4

Please sign in to comment.