Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect recursion for dir=auto special cases
dir=auto has special-case behavior for both (1) auto-directionality form-associated elements and (2) slots with assigned nodes. In these special cases dir=auto is intended to have special behavior when used on the element, but this special behavior was not intended to apply when dir=auto was used on an ancestor. The wording for this behavior was incorrect for at least one case, where the handling of the slot case needs recursion over the assigned nodes as though they were descendants. This was uncovered by the Gecko implementor adding a test for this case as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1876163#c13. Fix this by splitting "contained text auto directionality" into a separate algorithm and invoking that, rather than the complete "auto directionality" algorithm, when handling an Element assigned to a slot. This special case handling also incorrectly missed applying exclusions of descendants (for a different set of special cases) to the special traversal for computing dir=auto on a slot element, which traverses its assigned nodes (in order) rather than its descendants. Also fix that exclusion by adding a canExcludeRoot boolean to the "contained text auto directionality" algorithm. Fixes whatwg#10488.
- Loading branch information