-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make language of a node consider lang attribute on SVG elements. #9882
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 25, 2023
This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52
What about MathML? cc @bkardell |
I did check https://www.w3.org/TR/MathML/chapter2.html#fund.globatt before posting this, and it explicitly says to use (Also, Gecko's code explicitly allows the unnamespaced |
Thanks, https://w3c.github.io/mathml-core/ doesn't seem to say anything about this either. Might be best to stick with |
annevk
approved these changes
Oct 25, 2023
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Oct 25, 2023
This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215017}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 25, 2023
This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215017}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 25, 2023
This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215017}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Nov 7, 2023
…nce rules., a=testonly Automatic update from web-platform-tests Implement updated HTML language inheritance rules. This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215017} -- wpt-commits: 6148c29da568184fae4184f739ecccaafd651af6 wpt-pr: 42732
vinnydiehl
pushed a commit
to vinnydiehl/mozilla-unified
that referenced
this pull request
Nov 7, 2023
…nce rules., a=testonly Automatic update from web-platform-tests Implement updated HTML language inheritance rules. This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhangg@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Di Zhang <dizhangg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1215017} -- wpt-commits: 6148c29da568184fae4184f739ecccaafd651af6 wpt-pr: 42732
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Nov 8, 2023
…nce rules., a=testonly Automatic update from web-platform-tests Implement updated HTML language inheritance rules. This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1215017} -- wpt-commits: 6148c29da568184fae4184f739ecccaafd651af6 wpt-pr: 42732 UltraBlame original commit: 6425b442dc96bbae14adf5799ce58ea64fcfd493
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Nov 8, 2023
…nce rules., a=testonly Automatic update from web-platform-tests Implement updated HTML language inheritance rules. This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1215017} -- wpt-commits: 6148c29da568184fae4184f739ecccaafd651af6 wpt-pr: 42732 UltraBlame original commit: 6425b442dc96bbae14adf5799ce58ea64fcfd493
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Nov 8, 2023
…nce rules., a=testonly Automatic update from web-platform-tests Implement updated HTML language inheritance rules. This makes two changes to match the HTML spec: * only honor the unnamespaced lang attribute on HTML and SVG elements * have <slot> elements in a shadow tree inherit language from the shadow host Note that an update to the HTML specification regarding the SVG elements case is proposed in whatwg/html#9882, but https://www.w3.org/TR/SVG/struct.html#LangAttribute already defines it. These changes match the related changes to the dir attribute, but use a separate feature flag as a killswitch, since they are separable. Fixed: 1490711 Bug: 576815 Change-Id: I6462181e6d4433aa1dcc9a2c42e5c12754830e52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974775 Commit-Queue: Di Zhang <dizhanggchromium.org> Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Di Zhang <dizhanggchromium.org> Cr-Commit-Position: refs/heads/main{#1215017} -- wpt-commits: 6148c29da568184fae4184f739ecccaafd651af6 wpt-pr: 42732 UltraBlame original commit: 6425b442dc96bbae14adf5799ce58ea64fcfd493
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The rules for finding the language of a node were made somewhat more formal in 11dc4c7 (PR #9796, fixing #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.
(See WHATWG Working Mode: Changes for more details.)
/dom.html ( diff )