From 11dc4c7557f5a4c879c1ce65b9cb59b91310bbf5 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Fri, 6 Oct 2023 09:38:38 -0400 Subject: [PATCH] Make computation of directionality account for shadow trees This specifies (with some additional detail) the proposal in https://github.com/whatwg/html/issues/3699#issuecomment-951423468. This changes three things: * the inheritance of directionality, * the inheritance of language, and * the computation of dir=auto to account for shadow trees. This builds on the work in #9452 and #9554 to refactor this section, and builds on work by Brian Kardell, Eric Meyer, and others in #7424 and in #9166 and work by fantasai, rniwa, smaug, MyIdShin, Brian Kardell, and others in #3699. Fixes #3699. --- source | 181 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 135 insertions(+), 46 deletions(-) diff --git a/source b/source index 5f3e26cc485..c99f8d6004d 100644 --- a/source +++ b/source @@ -13283,7 +13283,8 @@ Transport Protocol">HTTP</abbr> today.</p> +
If the node's parent element is not null
+

Use the language of that parent element.

+ +
Otherwise
+

If there is a pragma-set default language set, then that is the language of + the node. If there is no pragma-set default language set, then language information + from a higher-level protocol (such as HTTP), if any, must be used as the final fallback language + instead. In the absence of any such language information, and in cases where the higher-level + protocol reports multiple languages, the language of the node is unknown, and the corresponding + language tag is the empty string.

+

If the resulting value is not a recognized language tag, then it must be treated as an unknown language having the given language tag, distinct from all other languages. For the purposes of @@ -13551,7 +13560,17 @@ Transport Protocol">HTTP</abbr> today.</p> +slot, [dir=ltr i], [dir=rtl i], [dir=auto i] { + unicode-bidi: isolate; } bdo, bdo[dir] { unicode-bidi: isolate-override; }