From 98fef9b2cd54380faafed8dd44f418bae30881c3 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Thu, 28 Sep 2023 15:42:15 -0700 Subject: [PATCH] Make dir=auto fall back to the parent's directionality rather than ltr. When dir=auto fails to find text with strong directionality (or a element) to determine the directionality of the element, it should fall back to the directionality that it would have inherited from its parent (or, for , its shadow host) rather than falling back to ltr. This requires updating directionality invalidation to account for the possibility that elements with dir=auto can inherit directionality. This is based on the proposed behavior described in: https://github.com/whatwg/html/issues/3699#issuecomment-951423468 which is in the process of being specified in: https://github.com/whatwg/html/pull/9554 https://github.com/whatwg/html/pull/9796 This is one of two changes needed to fix the failure of: external/wpt/html/dom/elements/global-attributes/dir-shadow-41.html in the still-unlanded WPT PR at https://github.com/web-platform-tests/wpt/pull/29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805163 Commit-Queue: David Baron Reviewed-by: Di Zhang Cr-Commit-Position: refs/heads/main@{#1202893} --- html/dom/elements/global-attributes/dir_auto-N-EN-ref.html | 6 +++--- html/dom/elements/global-attributes/dir_auto-N-EN.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html b/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html index 496d699d73c79cf..0d938b2e168beec 100644 --- a/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html +++ b/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html @@ -10,7 +10,7 @@ + If there is no strong character, as in this test, the direction defaults to the parent." />