Open Bug 1579075 Opened 5 years ago Updated 8 months ago

:lang pseudo selector doesn't propagate across shadow boundaries.

Categories

(Core :: DOM: Core & HTML, defect, P3)

70 Branch
defect

Tracking

()

People

(Reporter: gullerya, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

I've created custom element with open shadow DOM.
I've added inside that shadow DOM the following CSS rule:
.dollar:lang(en)::before {
content: "$ ";
}
I've added do the shadow DOM element with some number and .dollar class.
I've set on the main HTML document the attribute "lang=en".

Actual results:

'$ ' textual content as defined in the pseudo element NOT appeared.
Looking into the Dev tools show that the rule was not matched.

Expected results:

I'd expect that that lang value of the main HTML document propagate into the shadow DOM and the element within the shadow DOM would match the selector (showing the content of '$ ').

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Blocks: shadowdom
Priority: -- → P3

Given the general agreement on making :dir cross shadow tree boundaries, it seems reasonable to me to make :lang work on the flat tree.

I'm on PTO until Friday, but I'll take a look afterwards.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)
Summary: :lang pseudo selector is not working in shadow DOM → :lang pseudo selector doesn't propagate across shadow boundaries.

This is consistent with :dir(), though maybe we should wait for
https://github.com/whatwg/html/issues/4906 to reach some consensus before
landing this.

I proposed a patch, but behavior seems all over the place right now, see https://github.com/whatwg/html/issues/4906.

Flags: needinfo?(emilio)

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D45638 Bug 1579075 - Make :lang() work through the flat tree. emilio smaug: Resigned from review

:emilio, could you please find another reviewer or abandon the patch if it is no longer relevant?

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Severity: normal → S3
Duplicate of this bug: 1822253
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: