mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
traverse Shadow DOM boundaries when determining element lang (#34529)
Signed-off-by: Ville Lindholm <ville@lindholm.dev>
This commit is contained in:
parent
3363e1a261
commit
af8f35f5ef
2 changed files with 1 additions and 10 deletions
|
@ -4146,7 +4146,7 @@ impl Element {
|
||||||
// https://html.spec.whatwg.org/multipage/#language
|
// https://html.spec.whatwg.org/multipage/#language
|
||||||
pub fn get_lang(&self) -> String {
|
pub fn get_lang(&self) -> String {
|
||||||
self.upcast::<Node>()
|
self.upcast::<Node>()
|
||||||
.inclusive_ancestors(ShadowIncluding::No)
|
.inclusive_ancestors(ShadowIncluding::Yes)
|
||||||
.filter_map(|node| {
|
.filter_map(|node| {
|
||||||
node.downcast::<Element>().and_then(|el| {
|
node.downcast::<Element>().and_then(|el| {
|
||||||
el.get_attribute(&ns!(xml), &local_name!("lang"))
|
el.get_attribute(&ns!(xml), &local_name!("lang"))
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
[lang-attribute-shadow.window.html]
|
|
||||||
[lang on slot inherits from shadow host]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[lang only on host]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[lang on host and slotted element]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue