Skip to content
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

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

dbaron
Copy link
Member

@dbaron dbaron commented Dec 19, 2023

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 )

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">.
Copy link
Member

@annevk annevk left a 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?

source Show resolved Hide resolved
source Show resolved Hide resolved
dbaron added a commit to dbaron/web-platform-tests that referenced this pull request Jan 9, 2024
dbaron added a commit to dbaron/web-platform-tests that referenced this pull request Jan 9, 2024
@dbaron
Copy link
Member Author

dbaron commented Jan 9, 2024

I assume we already have test coverage?

It turns out that we didn't (at least I couldn't find any empty bdi elements with no dir attribute), so I wrote some tests in web-platform-tests/wpt#43896

@dbaron dbaron requested a review from annevk January 9, 2024 14:35
@annevk
Copy link
Member

annevk commented Jan 9, 2024

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.

@annevk annevk added normative change i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. labels Jan 9, 2024
@dbaron
Copy link
Member Author

dbaron commented Jan 9, 2024

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.)

annevk pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 9, 2024
@annevk annevk merged commit bccb55b into whatwg:main Jan 9, 2024
2 checks passed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 10, 2024
…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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 11, 2024
…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
aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 12, 2024
…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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 12, 2024
…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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 12, 2024
…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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 15, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2024
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2024
…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
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Jan 19, 2024
…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
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Jan 19, 2024
…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
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
…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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. normative change
Development

Successfully merging this pull request may close these issues.

2 participants