-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make computation of directionality account for Shadow DOM. #9796
Conversation
This specifies (with some additional detail) the proposal in whatwg#3699 (comment) . This changes three things: * the inheritance of directionality * the inheritance of language * the computation of dir=auto to account for Shadow DOM. This builds on the work in whatwg#9452 and whatwg#9554 to refactor this section, and builds on work by Brian Kardell, Eric Meyer, and others in whatwg#7424 and in whatwg#9166 and work by fantasai, rniwa, smaug, MyIdShin, Brian Kardell, and others in whatwg#3699. Closes whatwg#9166. Fixes whatwg#3699.
This PR is a revised version of #9166 based on the refactoring mentioned above. I'm sure there are some edge cases that come out differently. Another thing that I intended to be different is what is described in #3699 (comment) . One other thing that I noticed while writing this is that the rules for processing text directionality are slightly different for an I'm hoping at least some of @fantasai @rniwa @bkardell and @annevk are able to review. (I can't assign reviewers, it seems.) |
One other review note is that the way I ended up needing to use the concept of "auto directionality", it ended up easier to redefine it so that it can be null if no directionality is computed rather than including the fallback to parent directionality, and the user of the "auto directionality" is now responsible for replacing null with the parent directionality (or, in some new cases, continuing on to the next element or similar). |
Also adding @smaug---- for review and feedback on implementer interest from Mozilla. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this reads a lot better! Thanks for paying attention to the style guide too, that helps a lot. I've mainly focused on the editorial aspects in this review, but I can do another pass later trying to fully understand all the semantics.
The main thing that needs improving is the language section as that currently lacks changes to the implementer requirements for determining the language of a node.
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 #29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31
Thanks for the review, @annevk. I think I've addressed all of your comments. Two notes:
|
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 #29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, couple more nits and suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace</span></span>, and the <code data-x="attr-lang">lang</code> attribute in no namespace | ||
must be <span data-x="ignore">ignored</span> for the purposes of determining the element's | ||
language.</p> | ||
<p>To determine the <dfn export for="Node">language</dfn> of a node, user agents must use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The alternative way to approach this would be to turn this into a set of steps as well, but I think this is okay for now until we sort out the definitive requirements for the last "Otherwise" in the issue you opened.)
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 web-platform-tests/wpt#29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805163 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1202893}
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 #29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805163 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1202893}
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 #29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805163 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1202893}
…auto and descendant directionality to consider non-HTML elements., a=testonly Automatic update from web-platform-tests Fix :dir() selector and updates for dir=auto and descendant directionality to consider non-HTML elements. This changes behavior only when the CSSPseudoDir flag is enabled. This is based on the proposed behavior described in: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#9796 and on the behavior specified in: https://drafts.csswg.org/selectors-4/#the-dir-pseudo Bug: 576815 Change-Id: I57323aeda8850f382756cd36b3717d34e8911f5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908695 Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1204886} -- wpt-commits: 9c46bae54706a175a99a9f127a4a8065704c2cc2 wpt-pr: 42315 UltraBlame original commit: 28cd492bf06128adefbd727f510e3773c4c531ab
…rees., a=testonly Automatic update from web-platform-tests Add test for lang attribute and shadow trees. (#42364) This tests the lang attribute changes in whatwg/html#9796. It replaces the lang attribute tests from #29820. Co-authored-by: Anne van Kesteren <annevkannevk.nl> -- wpt-commits: 3538a9f3031846a83f95f9c514388fc4f35437fc wpt-pr: 42364 UltraBlame original commit: d4a31b5d4e9c6e85c5d6072481fd42108b885857
…auto and descendant directionality to consider non-HTML elements., a=testonly Automatic update from web-platform-tests Fix :dir() selector and updates for dir=auto and descendant directionality to consider non-HTML elements. This changes behavior only when the CSSPseudoDir flag is enabled. This is based on the proposed behavior described in: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#9796 and on the behavior specified in: https://drafts.csswg.org/selectors-4/#the-dir-pseudo Bug: 576815 Change-Id: I57323aeda8850f382756cd36b3717d34e8911f5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908695 Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1204886} -- wpt-commits: 9c46bae54706a175a99a9f127a4a8065704c2cc2 wpt-pr: 42315 UltraBlame original commit: 28cd492bf06128adefbd727f510e3773c4c531ab
…rees., a=testonly Automatic update from web-platform-tests Add test for lang attribute and shadow trees. (#42364) This tests the lang attribute changes in whatwg/html#9796. It replaces the lang attribute tests from #29820. Co-authored-by: Anne van Kesteren <annevkannevk.nl> -- wpt-commits: 3538a9f3031846a83f95f9c514388fc4f35437fc wpt-pr: 42364 UltraBlame original commit: d4a31b5d4e9c6e85c5d6072481fd42108b885857
…ots-directionality.html., a=testonly Automatic update from web-platform-tests Remove tentative from filename of dir-slots-directionality.html. whatwg/html#9796 has landed, so this is now specified, and the test no longer should be labeled as tentative. Bug: 576815 Change-Id: Ica2371532c761da678c38237e4bdd9b991388f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4948050 Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1210887} -- wpt-commits: f84c5af86a97af47983ec10ec6b56b905692d8e6 wpt-pr: 42583
…ots-directionality.html., a=testonly Automatic update from web-platform-tests Remove tentative from filename of dir-slots-directionality.html. whatwg/html#9796 has landed, so this is now specified, and the test no longer should be labeled as tentative. Bug: 576815 Change-Id: Ica2371532c761da678c38237e4bdd9b991388f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4948050 Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1210887} -- wpt-commits: f84c5af86a97af47983ec10ec6b56b905692d8e6 wpt-pr: 42583
…: isolate style., a=testonly Automatic update from web-platform-tests Give <slot> element default unicode-bidi: isolate style. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. This implements a part of the behavior described in: whatwg/html#3699 (comment) which has been specified in: whatwg/html#9554 whatwg/html#9796 Bug: 576815 Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1214439} -- wpt-commits: a79306e06659bde55be85c3af5c1d7d4a51c0cbd wpt-pr: 42717
…ode-bidi: isolate style.", a=testonly Automatic update from web-platform-tests Revert "Give <slot> element default unicode-bidi: isolate style." This reverts commit 198d41cfd6eac5fd9ee34e6314e34f938b6d31b5. Reason for revert: This reverts a change that was the first of two closely related changes. Given that the other change, in https://crrev.com/c/4973701, turned out to have problems (and I haven't attempted to land it), I've proposed reverting both in the HTML spec at whatwg/html#9880. I'm therefore reverting this (the first half) until the HTML spec discussion is sorted out. Original change's description: > Give <slot> element default unicode-bidi: isolate style. > > This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. > > This implements a part of the behavior described in: > whatwg/html#3699 (comment) > which has been specified in: > whatwg/html#9554 > whatwg/html#9796 > > Bug: 576815 > Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 > Reviewed-by: Chris Harrelson <chrishtr@chromium.org> > Reviewed-by: Di Zhang <dizhangg@chromium.org> > Commit-Queue: David Baron <dbaron@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974023 Reviewed-by: Philip Rogers <pdr@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: David Baron <dbaron@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746
…: isolate style., a=testonly Automatic update from web-platform-tests Give <slot> element default unicode-bidi: isolate style. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. This implements a part of the behavior described in: whatwg/html#3699 (comment) which has been specified in: whatwg/html#9554 whatwg/html#9796 Bug: 576815 Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1214439} -- wpt-commits: a79306e06659bde55be85c3af5c1d7d4a51c0cbd wpt-pr: 42717
…ode-bidi: isolate style.", a=testonly Automatic update from web-platform-tests Revert "Give <slot> element default unicode-bidi: isolate style." This reverts commit 198d41cfd6eac5fd9ee34e6314e34f938b6d31b5. Reason for revert: This reverts a change that was the first of two closely related changes. Given that the other change, in https://crrev.com/c/4973701, turned out to have problems (and I haven't attempted to land it), I've proposed reverting both in the HTML spec at whatwg/html#9880. I'm therefore reverting this (the first half) until the HTML spec discussion is sorted out. Original change's description: > Give <slot> element default unicode-bidi: isolate style. > > This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. > > This implements a part of the behavior described in: > whatwg/html#3699 (comment) > which has been specified in: > whatwg/html#9554 > whatwg/html#9796 > > Bug: 576815 > Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 > Reviewed-by: Chris Harrelson <chrishtr@chromium.org> > Reviewed-by: Di Zhang <dizhangg@chromium.org> > Commit-Queue: David Baron <dbaron@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974023 Reviewed-by: Philip Rogers <pdr@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: David Baron <dbaron@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746
…ots-directionality.html., a=testonly Automatic update from web-platform-tests Remove tentative from filename of dir-slots-directionality.html. whatwg/html#9796 has landed, so this is now specified, and the test no longer should be labeled as tentative. Bug: 576815 Change-Id: Ica2371532c761da678c38237e4bdd9b991388f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4948050 Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1210887} -- wpt-commits: f84c5af86a97af47983ec10ec6b56b905692d8e6 wpt-pr: 42583 UltraBlame original commit: 91728099be29f0ec62e88282bc45515c61b4ac7c
…: isolate style., a=testonly Automatic update from web-platform-tests Give <slot> element default unicode-bidi: isolate style. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. This implements a part of the behavior described in: whatwg/html#3699 (comment) which has been specified in: whatwg/html#9554 whatwg/html#9796 Bug: 576815 Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 Reviewed-by: Chris Harrelson <chrishtrchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1214439} -- wpt-commits: a79306e06659bde55be85c3af5c1d7d4a51c0cbd wpt-pr: 42717 UltraBlame original commit: c1d0594b7c2341b1247e69987405d8038e57308b
…ode-bidi: isolate style.", a=testonly Automatic update from web-platform-tests Revert "Give <slot> element default unicode-bidi: isolate style." This reverts commit 198d41cfd6eac5fd9ee34e6314e34f938b6d31b5. Reason for revert: This reverts a change that was the first of two closely related changes. Given that the other change, in https://crrev.com/c/4973701, turned out to have problems (and I haven't attempted to land it), I've proposed reverting both in the HTML spec at whatwg/html#9880. I'm therefore reverting this (the first half) until the HTML spec discussion is sorted out. Original change's description: > Give <slot> element default unicode-bidi: isolate style. > > This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. > > This implements a part of the behavior described in: > whatwg/html#3699 (comment) > which has been specified in: > whatwg/html#9554 > whatwg/html#9796 > > Bug: 576815 > Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 > Reviewed-by: Chris Harrelson <chrishtrchromium.org> > Reviewed-by: Di Zhang <dizhanggchromium.org> > Commit-Queue: David Baron <dbaronchromium.org> > Cr-Commit-Position: refs/heads/main{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974023 Reviewed-by: Philip Rogers <pdrchromium.org> Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> Auto-Submit: David Baron <dbaronchromium.org> Commit-Queue: Philip Rogers <pdrchromium.org> Cr-Commit-Position: refs/heads/main{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746 UltraBlame original commit: 4f46a8fcb456fa55fd784b0714da59ad7b206c79
…ots-directionality.html., a=testonly Automatic update from web-platform-tests Remove tentative from filename of dir-slots-directionality.html. whatwg/html#9796 has landed, so this is now specified, and the test no longer should be labeled as tentative. Bug: 576815 Change-Id: Ica2371532c761da678c38237e4bdd9b991388f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4948050 Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1210887} -- wpt-commits: f84c5af86a97af47983ec10ec6b56b905692d8e6 wpt-pr: 42583 UltraBlame original commit: 91728099be29f0ec62e88282bc45515c61b4ac7c
…: isolate style., a=testonly Automatic update from web-platform-tests Give <slot> element default unicode-bidi: isolate style. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. This implements a part of the behavior described in: whatwg/html#3699 (comment) which has been specified in: whatwg/html#9554 whatwg/html#9796 Bug: 576815 Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 Reviewed-by: Chris Harrelson <chrishtrchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1214439} -- wpt-commits: a79306e06659bde55be85c3af5c1d7d4a51c0cbd wpt-pr: 42717 UltraBlame original commit: c1d0594b7c2341b1247e69987405d8038e57308b
…ode-bidi: isolate style.", a=testonly Automatic update from web-platform-tests Revert "Give <slot> element default unicode-bidi: isolate style." This reverts commit 198d41cfd6eac5fd9ee34e6314e34f938b6d31b5. Reason for revert: This reverts a change that was the first of two closely related changes. Given that the other change, in https://crrev.com/c/4973701, turned out to have problems (and I haven't attempted to land it), I've proposed reverting both in the HTML spec at whatwg/html#9880. I'm therefore reverting this (the first half) until the HTML spec discussion is sorted out. Original change's description: > Give <slot> element default unicode-bidi: isolate style. > > This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. > > This implements a part of the behavior described in: > whatwg/html#3699 (comment) > which has been specified in: > whatwg/html#9554 > whatwg/html#9796 > > Bug: 576815 > Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 > Reviewed-by: Chris Harrelson <chrishtrchromium.org> > Reviewed-by: Di Zhang <dizhanggchromium.org> > Commit-Queue: David Baron <dbaronchromium.org> > Cr-Commit-Position: refs/heads/main{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974023 Reviewed-by: Philip Rogers <pdrchromium.org> Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> Auto-Submit: David Baron <dbaronchromium.org> Commit-Queue: Philip Rogers <pdrchromium.org> Cr-Commit-Position: refs/heads/main{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746 UltraBlame original commit: 4f46a8fcb456fa55fd784b0714da59ad7b206c79
…ots-directionality.html., a=testonly Automatic update from web-platform-tests Remove tentative from filename of dir-slots-directionality.html. whatwg/html#9796 has landed, so this is now specified, and the test no longer should be labeled as tentative. Bug: 576815 Change-Id: Ica2371532c761da678c38237e4bdd9b991388f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4948050 Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1210887} -- wpt-commits: f84c5af86a97af47983ec10ec6b56b905692d8e6 wpt-pr: 42583 UltraBlame original commit: 91728099be29f0ec62e88282bc45515c61b4ac7c
…: isolate style., a=testonly Automatic update from web-platform-tests Give <slot> element default unicode-bidi: isolate style. This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. This implements a part of the behavior described in: whatwg/html#3699 (comment) which has been specified in: whatwg/html#9554 whatwg/html#9796 Bug: 576815 Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 Reviewed-by: Chris Harrelson <chrishtrchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1214439} -- wpt-commits: a79306e06659bde55be85c3af5c1d7d4a51c0cbd wpt-pr: 42717 UltraBlame original commit: c1d0594b7c2341b1247e69987405d8038e57308b
…ode-bidi: isolate style.", a=testonly Automatic update from web-platform-tests Revert "Give <slot> element default unicode-bidi: isolate style." This reverts commit 198d41cfd6eac5fd9ee34e6314e34f938b6d31b5. Reason for revert: This reverts a change that was the first of two closely related changes. Given that the other change, in https://crrev.com/c/4973701, turned out to have problems (and I haven't attempted to land it), I've proposed reverting both in the HTML spec at whatwg/html#9880. I'm therefore reverting this (the first half) until the HTML spec discussion is sorted out. Original change's description: > Give <slot> element default unicode-bidi: isolate style. > > This is behind the RuntimeEnabledFeatures::CSSPseudoDirEnabled() flag. > > This implements a part of the behavior described in: > whatwg/html#3699 (comment) > which has been specified in: > whatwg/html#9554 > whatwg/html#9796 > > Bug: 576815 > Change-Id: Ice471838c7251fc69d87abfa723f3eef1a4c455a > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4800075 > Reviewed-by: Chris Harrelson <chrishtrchromium.org> > Reviewed-by: Di Zhang <dizhanggchromium.org> > Commit-Queue: David Baron <dbaronchromium.org> > Cr-Commit-Position: refs/heads/main{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974023 Reviewed-by: Philip Rogers <pdrchromium.org> Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> Auto-Submit: David Baron <dbaronchromium.org> Commit-Queue: Philip Rogers <pdrchromium.org> Cr-Commit-Position: refs/heads/main{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746 UltraBlame original commit: 4f46a8fcb456fa55fd784b0714da59ad7b206c79
When dir=auto fails to find text with strong directionality (or a <slot> 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 <slot>, 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#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 web-platform-tests#29820 Bug: 576815 Change-Id: I9fc7c85875074ad41704ab45ec70c7632c3f8d31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4805163 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1202893}
…ality to consider non-HTML elements. This changes behavior only when the CSSPseudoDir flag is enabled. This is based on the proposed behavior described in: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9554 whatwg/html#9796 and on the behavior specified in: https://drafts.csswg.org/selectors-4/#the-dir-pseudo Bug: 576815 Change-Id: I57323aeda8850f382756cd36b3717d34e8911f5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908695 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204886}
This tests the lang attribute changes in whatwg/html#9796. It replaces the lang attribute tests from web-platform-tests#29820. Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
In whatwg#9796 I refactored the term "auto directionality" to move the fallback to the parent directionality out of the definition of "auto directionality", since I needed the null result in one case to continue a tree traversal rather than returning. However, I missed fixing up one of the references to the term (should I blame the line break?), leaving a case where the spec could define the directionality of a <bdi> element as null. This fixes that case, and converts the <ol> to a <dl class="switch">.
In whatwg#9796 I refactored the term "auto directionality" to move the fallback to the parent directionality out of the definition of "auto directionality", since I needed the null result in one case to continue a tree traversal rather than returning. However, I missed fixing up one of the references to the term (should I blame the line break?), leaving a case where the spec could define the directionality of a <bdi> element as null. This fixes that case, and converts the <ol> to a <dl class="switch">.
In #9796 I refactored the term "auto directionality" to move the fallback to the parent directionality out of the definition of "auto directionality", since I needed the null result in one case to continue a tree traversal rather than returning. However, I missed fixing up one of the references to the term (should I blame the line break?), leaving a case where the spec could define the directionality of a <bdi> element as null. This fixes that case, and converts the <ol> to a <dl class="switch">. Tests: web-platform-tests/wpt#43896.
As well as some of the corresponding changes to its directionality and language. This reverts recent changes to the rendering section for the slot element that I made recently in 1dc4c7557f5a4c879c1ce65b9cb59b91310bbf5 (PR #9796, fixing #3699). These changes had specified that all slot elements, even those without a dir attribute, specify the direction and unicode-bidi properties. When I attempted to implement these changes, I discovered that they broke a significant number of web-platform-tests, due to a pattern that makes me suspect they would pose a compatibility problem. In particular, specifying the CSS direction property for all slot elements breaks inheritance of CSS direction into slotted elements, including those in user-agent shadow DOM. (This makes a clearly visible change when elements are implemented in terms of user-agent shadow DOM, which probably is not intended.) While I realize that the recommended practice is to specify the HTML dir attribute rather than the CSS direction property, I believe the CSS direction property is used enough that this is not acceptable. (https://chromestatus.com/metrics/css/timeline/popularity/3 says the property is used on around 40% of page loads. While the number of interesting uses is probably substantially lower, it's also probably still significant.)
This specifies (with some additional detail) the proposal in #3699 (comment) . This changes three things:
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.
Closes #9166.
Fixes #3699.
Some aspects of the PR template are copied from #9166.
html/dom/elements/global-attributes/dir*
andcss/selectors/dir*
(See WHATWG Working Mode: Changes for more details.)
/dom.html ( diff )
/rendering.html ( diff )