Closed Bug 1487135 Opened 2 years ago Closed 2 years ago

Don't allocate an AuthorStyles for the ShadowRoot of <svg:use>

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bzbarsky, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

It looks like we always allocate an AuthorStyles in the ShadowRoot constructor.  In the case of <svg:use>, we don't do anything with stylesheets in the shadow tree, so the AuthorStyles there is unused.

In fact, maybe we should consider allocating AuthorStyles lazily in general, for all the cases when shadow trees don't have styles inside them.
Flags: needinfo?(emilio)
So that we don't waste a bunch of memory with stuff like <svg:use>. I
plan to shrink AuthorStyles further, but this should help regardless, and isn't
very complex.
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Comment on attachment 9005065 [details]
Make the allocation of AuthorStyles for ShadowRoot lazy.

Xidorn Quan [:xidorn] UTC+10 has approved the revision.
Attachment #9005065 - Flags: review+
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/94b793d95409
Make the allocation of AuthorStyles for ShadowRoot lazy. r=xidorn,firefox-style-system-reviewers
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/752786e0dd01
followup: Add a missing check. r=me
https://hg.mozilla.org/mozilla-central/rev/94b793d95409
https://hg.mozilla.org/mozilla-central/rev/752786e0dd01
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.