Closed Bug 1559076 Opened 5 years ago Closed 5 years ago

Maybe implement part forwarding.

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files)

https://drafts.csswg.org/css-shadow-parts/#exportparts-attr

There was no consensus on the specifics of this feature when it was being discussed.

Type: defect → enhancement

Some of the stuff, in particular inside GeckoBindings stuff should be
refactored to be less ugly and duplicate a bit less code, but the rest of the
code should be landable as is.

Some invalidation changes are already needed because we weren't matching with
the right shadow host during invalidation (which made existing ::part() tests
fail).

Pending invalidation work:

  • Making exportparts work right on the snapshots.
  • Invalidating parts from descendant hosts.

They're not very hard but I need to think how to best implement it:

  • Maybe get rid of ShadowRoot::mParts and just walk DOM descendants in the
    Shadow DOM.

  • Maybe implement a ElementHasExportPartsAttr much like HasPartAttr and use
    that to keep the list of elements.

  • Maybe invalidate :host and ::part() together in here1

  • Maybe something else.

Opinions?

See Also: → 1597588

These were useful when implementing forwarding, and forgot to send them
earlier.

Assignee: nobody → emilio
Keywords: leave-open
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ff37a98047d6
Minor debugging improvements. r=heycam
Blocks: 1598094

This attribute is not expected to change often, so it seems fine to restyle the
whole subtree.

Bug 1598094 tracks further optimizations, should they be needed.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/192393a2ffd3
Implement shadow part forwarding (minus invalidation). r=heycam
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/16c88ca27c45
Restyle all descendants when the exportparts attribute changes. r=heycam
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/08901de5eb94
Invalidate parts in nested shadow trees correctly. r=heycam
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: