Closed Bug 1611236 Opened 4 years ago Closed 4 years ago

Optimize SetAdoptedStyleSheets For Append Case

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

References

Details

Attachments

(1 file)

There are optimizations that can be made in the case of setting the adoptedStyleSheets attribute to a new array that only has appended sheets compared to the previous array.

This change may be affected by https://github.com/WICG/construct-stylesheets/issues/45#issuecomment-577674453, if adoptedStyleSheets is changed to a CSSStyleSheetList and individual methods to insert/append/remove sheets are added.

  • Generalize enumeration over unique sheets to take any array of sheets.
  • Add check if the new adoptedStyleSheets only appends sheets.
  • Handle append case for new adoptedStyleSheets.
  • Add WPT test case for duplicate sheets in the ShadowRoot.
  • Add WPT test cases for appending sheets.
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/77e151138107
Optimize adoptedStyleSheets append case r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/22051 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: