From 73c790c1475613c6c9755c26cadb5ec670ce2b35 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 22 Aug 2023 12:43:24 -0700 Subject: [PATCH] Fix influence of on dir=auto computation of its shadow tree ancestors. This change treats a element as being a strong character, of its resolved directionality, when resolving dir=auto on its shadow tree ancestor. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag because we're hoping to ship that feature soon and it makes sense to ship related changes to direction handling all at once rather than piecemeal. 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/9166 https://github.com/whatwg/html/pull/9452 https://github.com/whatwg/html/pull/9554 This fixes the failures of: external/wpt/shadow-dom/directionality/dir-shadow-30.html external/wpt/shadow-dom/directionality/dir-shadow-34.html in the still-unlanded WPT PR at https://github.com/web-platform-tests/wpt/pull/29820 This also changes the existing WPT html/dom/elements/global-attributes/dir-slots-directionality.tentative.html in the following ways: * split the test into separate test() functions to get separate results * add a sixth test testing * add tests of the :dir() selector for each test (where Chromium fails this test for test 1) * change the expected result of the fourth test to match this code change and the proposed specification Bug: 576815 Change-Id: I83551e9bc5807109c5318bace486cfc93fc25bbb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800366 Reviewed-by: Di Zhang Commit-Queue: David Baron Cr-Commit-Position: refs/heads/main@{#1186743} --- .../dir-slots-directionality.tentative.html | 62 ++++++++++++++----- 1 file changed, 45 insertions(+), 17 deletions(-) diff --git a/html/dom/elements/global-attributes/dir-slots-directionality.tentative.html b/html/dom/elements/global-attributes/dir-slots-directionality.tentative.html index 1f0dc07f8ef5c1e..5e8cedb9c156f7c 100644 --- a/html/dom/elements/global-attributes/dir-slots-directionality.tentative.html +++ b/html/dom/elements/global-attributes/dir-slots-directionality.tentative.html @@ -2,9 +2,9 @@ HTML Test: dir=auto|rtl with slots, and direction should be RTL - + +
@@ -12,27 +12,55 @@
اختبر
+
اختبر