From 2e54ab554ea78d832b7f130f83082ff848782631 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 24 Oct 2023 09:44:15 -0400 Subject: [PATCH] Fix errors related to elements in auto directionality traversal This fixes some related errors in the section on auto directionality traversal that I made recently in 1dc4c7557f5a4c879c1ce65b9cb59b91310bbf5 (PR #9796, fixing #3699). This list item specifies an algorithm that implementors are expected to turn into a traversal of a subtree that skips parts of the subtree. However, by describing the skipping test in the first sub-item as examining ancestors rather than ancestors-or-self, it introduces a subtle difference between the algorithm that an implementor is likely to write and what the spec describes. This change changes the test to ancestors-or-self, and removes the slot element from the list of conditions so that it is possible to reach the second sub-item for slot elements. The edit above was trying to specify the proposal in https://github.com/whatwg/html/issues/3699#issuecomment-951423468. I found a case where I had intended to match that proposal but made an error: the handling of descendants in the second sub-item was intended to look at their resolved directionality, not their auto directionality. (And this is a simpler test, since the concept always exists, so there's no need to test it for null.) This corrects that error. I believe this combination of changes matches the interaction of these pieces that I intended to write: slot elements with a dir attribute (and their descendants) are skipped, whereas slot elements without a dir attribute provide the strong directionality from their host. --- source | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/source b/source index 27057754f7a..7289a9999c8 100644 --- a/source +++ b/source @@ -13668,16 +13668,14 @@ Transport Protocol">HTTP</abbr> today.</p>