Repository navigation
Make the directionality account for missing parent element - #9554
Conversation
|
I found a test that hits this parent condition and fails in WebKit and Gecko: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/11875. @emilio @rniwa what do you think? That should be fixed, right? |
|
Yes please. This is what I was aiming for initially, but better. It reads much more clearly and seems like it should be much easier to weave Shadow DOM bits into that. Thanks @annevk |
| <li><p>If <var>codePoint</var> is non-null and it is of bidirectional character type AL or R, | ||
| then return '<span data-x="concept-rtl">rtl</span>'.</p></li> | ||
|
|
||
| <p>Otherwise, if the element is a <span>document element</span>, <span>the directionality</span> | ||
| of the element is '<span data-x="concept-ltr">ltr</span>'.</p> | ||
| <li><p>If <var>codePoint</var> is non-null and it is of bidirectional character type L, then | ||
| return '<span data-x="concept-ltr">ltr</span>'.</p></li> |
There was a problem hiding this comment.
I would group these two rather than flatten them out, I think it helps structure the logic better have the LTR vs RTL fork grouped into a single step of the algorithm. But your call.
There was a problem hiding this comment.
I'm not sure I understand this. Have a separate callout algorithm for these two steps?
There was a problem hiding this comment.
It looks like you restructured this bit, so it's less awkward now. :)
Might consider putting "If codepoint is ..." as a switch with 3 branches rather than 3 independent steps, though. They're not really ordered steps...
fantasai
left a comment
There was a problem hiding this comment.
I'm not sure how this will work with the shadow DOM changes since codePoint will no longer necessarily be a codepoint. But in isolation this change seems fine? Some comments inline for bits that were hard to read.
|
I'm happy to see this moving along. A few comments: From #9554 (comment) :
In both Gecko and WebKit, the behavior of that testcase seems to depend on the use of I notice that the PR preview is not up-to-date with the most recent commit to this PR; it would be nice if it were, but I don't know why it wouldn't be. One thing that I find a little jarring is that there seems to be some confusion about whether definitions or algorithms are being invoked; one of @fantasai's review comments points to this. Maybe it's sort of the norm in some specs these days, but I find it a bit confusing. I'd expect a definition X to be invoked as "the X of E" whereas an algorithm Y to be invoked as "compute the Y given E" or maybe "compute the Y with E". |
…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 #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
…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 #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
…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 #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 <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1186743}
…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 #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 <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1186743}
The current algorithm has no defined exit for when an element has no parent element and its dir attribute is in the undefined state. And also rewrite it to make it easier to change as we want to account for shadow trees in a future version. This was inspired by work from Brian Kardell and fantasai in this area. Closes #9452.
…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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1204886}
…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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1204886}
…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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1204886}
…directionality rather than ltr., a=testonly Automatic update from web-platform-tests Make dir=auto fall back to the parent's directionality rather than ltr. 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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1202893} -- wpt-commits: fe5ba77ea2f030223883b87eaa1644fbdc2be916 wpt-pr: 42202
…directionality rather than ltr., a=testonly Automatic update from web-platform-tests Make dir=auto fall back to the parent's directionality rather than ltr. 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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1202893} -- wpt-commits: fe5ba77ea2f030223883b87eaa1644fbdc2be916 wpt-pr: 42202
This specifies (with some additional detail) the proposal in #3699 (comment). 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.
This specifies (with some additional detail) the proposal in whatwg#3699 (comment). 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 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. Fixes whatwg#3699.
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
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: Ib9d38e167b16a5d45c77799d2ee102b6c0ad63d2
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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214439}
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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214439}
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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214439}
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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1214439} Bug: 576815 Change-Id: I0f52b30c345d4962a36a36e5d2651221db96bcde No-Presubmit: true No-Tree-Checks: true No-Try: true
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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > 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 <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: David Baron <[email protected]> Commit-Queue: Philip Rogers <[email protected]> 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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > 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 <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: David Baron <[email protected]> Commit-Queue: Philip Rogers <[email protected]> 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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > 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 <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: David Baron <[email protected]> Commit-Queue: Philip Rogers <[email protected]> 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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> 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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Commit-Queue: David Baron <[email protected]> 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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > 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 <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: David Baron <[email protected]> Commit-Queue: Philip Rogers <[email protected]> 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 <[email protected]> Reviewed-by: Di Zhang <[email protected]> Commit-Queue: David Baron <[email protected]> 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 <[email protected]> > Reviewed-by: Di Zhang <[email protected]> > Commit-Queue: David Baron <[email protected]> > 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 <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: David Baron <[email protected]> Commit-Queue: Philip Rogers <[email protected]> Cr-Commit-Position: refs/heads/main@{#1215009} -- wpt-commits: 8cc01fc73b14dcbc92109574c26d85b25f5cfba0 wpt-pr: 42746
The current algorithm has no defined exit for when an element has no parent element and its dir attribute is in the undefined state.
And also rewrite it to make it easier to change as we want to account for shadow trees in a future version.
This was inspired by work from Brian Kardell and fantasai in this area.
Closes #9452.
(See WHATWG Working Mode: Changes for more details.)
/dom.html ( diff )