Closed Bug 1512026 Opened 6 years ago Closed 5 years ago

Nested slot doesn't match ::slotted against the right tree

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla66
Tracking Status
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 --- verified
firefox66 --- verified

People

(Reporter: kendrick.caranicas, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

Steps to reproduce:

Create 2 web components. Using slots have the Parent pass a slotted node into the child  slot. The child should have styles specific to the what container the slot is within. 

Here is a link to glitch that demos this. It works properly in chrome and safari.  
https://firefox-nested-slot.glitch.me/


Actual results:

None of the specific styles are displayed on the page or in the inspector. 


Expected results:

I should see the styles for the various slotted components based on their selector chain.
I tested this issue on Mac OS X 10.14 and Windows 10 x64 with FF Nightly 65.0a1(2018-12-09) and FF 63 release and I can reproduce the issue.
Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Version: 63 Branch → Trunk
I think I know what's going on, thanks for the report. FWIW a testcase without a bunch of unnecessary JS would help a lot to debug this.

I'll write one when I get to debug this.
Assignee: nobody → emilio
Blocks: shadowdom
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Summary: slotted web components can't be targeted for style based on their selector chain. → slotted web components can't be targeted for style based on their ancestor chain.
Attached file Reduced test-case.
The patch and test should be pretty much self-descriptive.
Summary: slotted web components can't be targeted for style based on their ancestor chain. → Nested slot doesn't match ::slotted against the right tree
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7b04cdcfdcf4
Handle nested slots correctly in slotted matching and invalidation. r=heycam
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/7b04cdcfdcf4
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Is this something we should consider for Beta backport?
Flags: needinfo?(emilio)
Flags: in-testsuite+
Comment on attachment 9030224 [details]
Bug 1512026 - Handle nested slots correctly in slotted matching and invalidation.

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Not a regression

User impact if declined: Interop issue when using Shadow DOM  / Web Components.

Is this code covered by automated tests?: Yes

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: Yes

If yes, steps to reproduce: See the test-case or the URL provided by the reporter.

List of other uplifts needed: none

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): Relatively straight-forward correctness bug fix.

String changes made/needed: none
Flags: needinfo?(emilio)
Attachment #9030224 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Comment on attachment 9030224 [details]
Bug 1512026 - Handle nested slots correctly in slotted matching and invalidation.

[Triage Comment]
Fixes an interop issue when using Shadow DOM & Web Components. Approved for 65.0b6.
Attachment #9030224 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
I have managed to reproduce the issue described in comment 0 using Firefox 65.0b5.

This issue is verified fixed using Firefox 66.0a1 (BuildId:20181219220049) and Firefox 65.0b6 (provided in comment 12) on Windows 10 64bit, macOS 10.9 and Ubuntu 16.04 64bit.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: