From 40b49b7273614349e83ad17076bc2c3c5531bb97 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Thu, 11 Jan 2024 16:20:39 -0800 Subject: [PATCH] Fix HTML directionality inheritance for empty elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for 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 https://github.com/web-platform-tests/wpt/pull/43896 in response to noticing and fixing an error I made in the HTML spec in https://github.com/whatwg/html/pull/10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed Reviewed-by: Di Zhang Auto-Submit: David Baron Reviewed-by: Mason Freed Cr-Commit-Position: refs/heads/main@{#1246176} --- .../the-bdi-element/bdi-auto-dir-default.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html b/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html index e658500a4ebf02..3a9d90c76b3379 100644 --- a/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html +++ b/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html @@ -30,13 +30,13 @@ ‭ - The LRO (left-to-right override) formatting character. ‬ - 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.
[:)], [+- a ב], [1 ג d]...
-
[:)], [+- a ב], [1 ג d]...
+
[(:], [+- a ב], [1 ג d]...
‭[:)], [+- a ב], [d ג 1]...‬