-
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
It is unclear how directionality should be inherited into Shadow DOM #3699
Comments
We should upstream the section 6 in Shadow DOM spec to HTML Standard. |
It seems natural that the directionality of text is inherited into the shadow tree. A component can always override the directionality of the content with If the entire document is in RTL, for example, then text inside components (including slotted contents) should supposedly need to be shown in RTL by default. |
Coincidentally, that's what WebKit and Chrome does: https://jsfiddle.net/ho7qhh43/ |
This sounds reasonable, but what about inheriting directionality from slot to assigned nodes? |
https://jsfiddle.net/wcvncxma/ |
A bit modified testcase https://jsfiddle.net/88w2druw/ I still don't understand the case 3. Why dir on |
I think case 3 is simply a bug. We're probably not taking the directionality of the slot into account due to its not generating a CSS box. |
In case dir attribute is used inside shadow DOM, I assume it is inherited also to fallback content of elements, so that querySelector(All) can use :dir pseudo class the normal way? And, should rtl text inside slot's fallback content affect to the ancestors even if the slot had assigned nodes? |
https://w3c.github.io/webcomponents/spec/shadow/#attributes clearly isn't enough here. |
The definition of flat tree is here: https://drafts.csswg.org/css-scoping/#flattening |
The dir attributes sets the CSS |
querySelector doesn't follow the rendering model, I mean, it can return stuff which isn't rendered at all. And dir=auto -handling is also unclear. Per current spec it follows DOM tree, excluding shadow DOM. And should :dir(ltr) or :dir(rtl) work with querySelector when selecting slot's fallback content in case there are assigned nodes to the slot? If not, why? Other selectors do work. |
Right; in particular, selector matching works over the tree-of-trees, not the flat tree, so having (I do think that inheriting it thru the flat tree makes the most sense, unfortunately.) |
Ah, good point. I don't remember details, but Aharon and a few other bidi/i18n experts preferred to inherit the dir and lang attribute when I asked them before, and there were some discussions I could find in w3c bugzilla 27222 and WICG/webcomponents#385. If we want to revisit this, I'm not opposed to it. |
If it inherits through flattened tree, what should the directionality be for fallback content when there are assigned nodes for the slot? This isn't about revisiting anything, but actually defining how this all should work. |
That is to say, in this example: <x-component dir=ltr>
<::shadow>
<slot select=* dir=rtl>
<span id=foo>foo</span>
</slot>
</::shadow>
<span id=bar>bar</span>
</x-component> What's the directionality of #foo and #bar? If directionality inherits thru the flat tree, then #bar inherits an rtl direction from the |
And also, if there is rtl text inside #foo and slot has dir=auto, what should the directionality of #bar be? |
@smaug---- @tabatkins good point. I don't know the answer from the top of my head, but does the directionality of #foo matter if it's not going to be rendered at all? |
directionality of #foo matters because if affects how querySelector(:dir(...)) works. It can't be left undefined. |
|
nvm, I was wrong. ^ |
Allow me to confirm what we're discussing. The original topic was about whether to inherit or not, I still prefer to inherit, but can't read whether we have consensus or not. Do we, or does it depend on another topic how it applies/inherits to fallback contents that are not rendered? For the fallback contents that are not rendered, I don't have opinion. Anyone mind to suggest? |
The directionality of fallback contents is one problem. The larger problem is that selector matching is defined over the tree-of-trees, not the flat tree, but |
I see, thank you, understood the topic. That part is probably about the
so if we're in consensus to do this in flat-tree, we can define this more clearly, like saying "parent in flat-tree, but for elements that are not in flat-tree, inherit from parent in tree-of-trees"? |
That doesn't solve the larger problem I just outlined. Again, Selectors are defined to match on the tree-of-trees, before we construct the flat tree, so if directionality is defined to inherit over the flat tree, |
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
The rules for finding the language of a node were made somewhat more formal in 11dc4c7 (PR whatwg#9796, fixing whatwg#3699). Both before and after that change they considered the lang attribute in the XML namespace, and the lang attribute in no namespace on HTML elements. However, the SVG spec at https://www.w3.org/TR/2018/CR-SVG2-20181004/struct.html#LangSpaceAttrs has very similar wording to the HTML spec prior to that edit, and also defined a lang attribute on SVG elements. This updates the language of a node algorithm in HTML to consider SVG elements as well, since implementing it as written (without this change) breaks the lang attribute in SVG.
This reverts commit 198d41c. 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}
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}
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}
…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 <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204886} -- wpt-commits: 9c46bae54706a175a99a9f127a4a8065704c2cc2 wpt-pr: 42315
…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 <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204886} -- wpt-commits: 9c46bae54706a175a99a9f127a4a8065704c2cc2 wpt-pr: 42315
…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
…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
…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
…: 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
…: 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
…: 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
…: 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
…cestors. This change treats a <slot> 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: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9166 whatwg/html#9452 whatwg/html#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 web-platform-tests#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 <slot dir=auto></slot> * 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 <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1186743}
…or dir=auto This rewrites significant aspects of inheritance of HTML direction (which affects the unshipped :dir() selector and also the shipped dirname attribute), including its invalidation, to match current spec proposals regarding how the inheritance operates on Shadow DOM, and to improve invalidation in response to dynamic changes. Inheritance of direction now operates on the node tree, except that shadow roots and slots both inherit from the shadow host. It previously operated on the flat tree. This change should not affect the computed values of the CSS direction property, since the HTML direction is only mapped to CSS direction on elements where the HTML direction is not inherited. This also restructures the shadow tree-related invalidation code for dir=auto to match the changes implemented in https://crrev.com/26b1b30268b7af4f0e44f298c10338a65e656f40 , which made dir=auto operate on the node tree, and the additional behavior implemented in https://crrev.com/6abc9cbde67c0700be364c7aab86cb29188c7d5d that implemented special rules (looking at slotted children) for <slot dir=auto>. Certain text-like form controls also have similar special rules in which they look at their value. This change can affect the computed values of the CSS direction property when the direction computed by dir=auto is different. The invalidation code for these two distinct things was (in the old code) too tied together to cleanly separate these changes. The reason these changes are the next step of work is because they change (when CSSPseudoDirEnabled) the one caller that passed a stay_within parameter to CalculateAndAdjustAutoDirectionality that is different from this; this enables further (smaller) refactoring that I believe will be needed to fix the failure of external/wpt/shadow-dom/directionality/dir-shadow-41.html in the still-unlanded WPT PR at web-platform-tests#29820 . I believe this existing using of stay_within does not make sense; it doesn't make sense to try to partially traverse the descendants of a dir=auto element with a different termination point. The traversal of a dir=auto element should always start at its start and should terminate at the first strong character or the end of the contents that should influence the dir=auto. (There are cases where the interaction of the stay_within and the use of NodeTraversal/FlatTreeTraversal meant that the stay_within parameter was missed entirely and the tree was searched beyond the contents that should be; this is a step towards the refactoring needed to fix that.) This is based on the proposed behavior described in: whatwg/html#3699 (comment) which is in the process of being specified in: whatwg/html#9166 whatwg/html#9452 whatwg/html#9554 Bug: 576815 Change-Id: Ic31a3f801f64042a3b4979afdc4e141f45e3b228 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4811757 Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1199647}
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}
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.)
Automatic update from web-platform-tests Fix an element directionality This CL fixes the bugs raised up during the discussion of slots at whatwg/html#3699. - Resolve the light tree element's directionality in the light tree and do not walk into the shadow tree for encapsulation. - Resolve the element's directionality when there is not a slotted node. Bug: 1236384 Change-Id: Id22aa3e5b624a2e3234c645e198749360f3a050d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3066807 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Miyoung Shin <myid.shin@igalia.com> Cr-Commit-Position: refs/heads/master@{#909242} -- wpt-commits: 64bba2c43109cc8a3173ac45d4216fa65624d0bc wpt-pr: 29889
...or if it should be inherited at all.
Per current spec it shouldn't be inherited
https://html.spec.whatwg.org/#the-directionality
Well, the spec doesn't really define how it should work in shadow DOM.
If host has dir="rtl", should that get inherited to shadow? If shadow DOM has dir="rtl" should that get inherited to a slots assigned nodes?
The text was updated successfully, but these errors were encountered: