-
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
Fix case where the directionality of a <bdi> could be null. #10005
Conversation
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">.
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.
I assume we already have test coverage?
This adds tests related to whatwg/html#10005
This adds tests related to whatwg/html#10005
It turns out that we didn't (at least I couldn't find any empty |
Thanks! Is the only case where this matters the last test which currently fails in all implementations? I guess it's still worth doing as you might have non-empty contents without characters that imply a particular direction in which case you do really want the parent direction to win. The empty case is just not a compelling use case, but does make a good test. |
Yes, that's the only testcase where it matters. (And, yes, it is a normative change, but it's reverting an unintentional normative change from #9796.) |
This adds tests related to whatwg/html#10005.
…dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in #43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992
…i> element., a=testonly Automatic update from web-platform-tests HTML: more tests for directionality of <bdi> element This adds tests related to whatwg/html#10005. -- wpt-commits: 556b7eb5a3fc5dda915f70435b1a15220617baac wpt-pr: 43896
…dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176}
…dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in #43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176}
…dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in #43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176}
…empty <bdi> elements with no dir attribute., a=testonly Automatic update from web-platform-tests Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176} -- wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97 wpt-pr: 43933
…i> element., a=testonly Automatic update from web-platform-tests HTML: more tests for directionality of <bdi> element This adds tests related to whatwg/html#10005. -- wpt-commits: 556b7eb5a3fc5dda915f70435b1a15220617baac wpt-pr: 43896 UltraBlame original commit: 74224b8725e584d55ec90c7e9162552dca7dd83e
…empty <bdi> elements with no dir attribute., a=testonly Automatic update from web-platform-tests Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Cr-Commit-Position: refs/heads/main{#1246176} -- wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97 wpt-pr: 43933 UltraBlame original commit: 47d17edd3a1e39fc011b5453c3bab92e905b0e2d
…i> element., a=testonly Automatic update from web-platform-tests HTML: more tests for directionality of <bdi> element This adds tests related to whatwg/html#10005. -- wpt-commits: 556b7eb5a3fc5dda915f70435b1a15220617baac wpt-pr: 43896 UltraBlame original commit: 74224b8725e584d55ec90c7e9162552dca7dd83e
…empty <bdi> elements with no dir attribute., a=testonly Automatic update from web-platform-tests Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Cr-Commit-Position: refs/heads/main{#1246176} -- wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97 wpt-pr: 43933 UltraBlame original commit: 47d17edd3a1e39fc011b5453c3bab92e905b0e2d
…i> element., a=testonly Automatic update from web-platform-tests HTML: more tests for directionality of <bdi> element This adds tests related to whatwg/html#10005. -- wpt-commits: 556b7eb5a3fc5dda915f70435b1a15220617baac wpt-pr: 43896 UltraBlame original commit: 74224b8725e584d55ec90c7e9162552dca7dd83e
…empty <bdi> elements with no dir attribute., a=testonly Automatic update from web-platform-tests Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Auto-Submit: David Baron <dbaronchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Cr-Commit-Position: refs/heads/main{#1246176} -- wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97 wpt-pr: 43933 UltraBlame original commit: 47d17edd3a1e39fc011b5453c3bab92e905b0e2d
…i> element., a=testonly Automatic update from web-platform-tests HTML: more tests for directionality of <bdi> element This adds tests related to whatwg/html#10005. -- wpt-commits: 556b7eb5a3fc5dda915f70435b1a15220617baac wpt-pr: 43896
…empty <bdi> elements with no dir attribute., a=testonly Automatic update from web-platform-tests Fix HTML directionality inheritance for empty <bdi> elements with no dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in web-platform-tests/wpt#43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176} -- wpt-commits: 40b49b7273614349e83ad17076bc2c3c5531bb97 wpt-pr: 43933
This adds tests related to whatwg/html#10005.
…dir attribute. This correctly initializes the flag indicating that the HTML directionality is inherited from the parent for <bdi> elements, which behaves like it has dir=auto by default. Even without this change, it gets initialized correctly when a dir attribute is changed or when the text content of the element changes. This also clears the same flag when the dir attribute changes. This should affect some other cases of dir attribute changes, but we somehow didn't hit it until fixing the previous bug exposed the problem. This fixes the failure of a test that I added in #43896 in response to noticing and fixing an error I made in the HTML spec in whatwg/html#10005 . Bug: 576815 Change-Id: I3006d45079694d90dd178f8c439e22f6419bd992 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186678 Commit-Queue: Mason Freed <masonf@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Auto-Submit: David Baron <dbaron@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246176}
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 element as null.
This fixes that case, and converts the
<ol>
to a<dl class="switch">
./dom.html ( diff )