Skip to content

Commit

Permalink
Bug 1860907 [wpt PR 42732] - Implement updated HTML language inherita…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
marco-c committed Nov 8, 2023
1 parent ccb6432 commit 113caa3
Showing 1 changed file with 204 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
test
(
(
)
=
>
{
const
container
=
document
.
createElement
(
"
div
"
)
;
document
.
body
.
append
(
container
)
;
container
.
setAttribute
(
"
lang
"
"
en
-
CA
"
)
;
const
child
=
document
.
createElementNS
(
"
div
"
"
test
"
)
;
container
.
append
(
child
)
;
child
.
setAttribute
(
"
lang
"
"
en
-
NZ
"
)
;
assert_true
(
container
.
matches
(
"
:
lang
(
en
-
CA
)
"
)
"
container
matches
en
-
CA
"
)
;
assert_true
(
child
.
matches
(
"
:
lang
(
en
-
CA
)
"
)
"
child
matches
en
-
CA
"
)
;
assert_false
(
container
.
matches
(
"
:
lang
(
en
-
NZ
)
"
)
"
container
does
not
match
en
-
NZ
"
)
;
assert_false
(
child
.
matches
(
"
:
lang
(
en
-
NZ
)
"
)
"
child
does
not
match
en
-
NZ
"
)
;
container
.
remove
(
)
;
}
"
unnamespaced
lang
attribute
only
works
on
elements
in
the
HTML
namespace
"
)
;

0 comments on commit 113caa3

Please sign in to comment.