Closed Bug 1752392 Opened 3 years ago Closed 3 years ago

CSSStyleSheet.replace[Sync]() should not replace CSSStyleSheet.cssRules

Categories

(Core :: DOM: CSS Object Model, defect, P3)

Firefox 96
defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: gui.lebas, Assigned: emilio)

References

()

Details

(Keywords: parity-chrome, testcase)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36

Steps to reproduce:

  1. Create a new CSSStyleSheet
  2. Get a reference of its cssRules
  3. Run CSSStyleSheet.replaceSync() (or CSSStyleSheet.replace())
  4. Compare the reference of cssRules with CSSStyleSheet.cssRules

Demo: https://codepen.io/creativewave/pen/mdqJerz

Actual results:

CSSStyleSheet.cssRules is replaced by a new object when running CSSStyleSheet.replaceSync() (or CSSStyleSheet.replace()).

Expected results:

CSSStyleSheet.cssRules should be the [SameObject] than before running CSSStyleSheet.replaceSync() (or CSSStyleSheet.replace()), as defined by the CSSOM specification:

  [SameObject] readonly attribute CSSRuleList cssRules;

https://drafts.csswg.org/cssom/#ref-for-dom-cssstylesheet-replace

Chrome keeps the same object.

Has STR: --- → yes
Component: Untriaged → DOM: CSS Object Model
Product: Firefox → Core
Blocks: 1520690
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: -- → S3
Priority: -- → P3

As per spec this object should always return the same JS object.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/092814d96f1d Don't drop CSSStyleSheet.cssRules from CSSStyleSheet.replace/Sync(). r=firefox-style-system-reviewers,layout-reviewers,boris
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33834 for changes under testing/web-platform/tests

Backed out for causing mochitest failures in test_parseStyleSheetImport.html

Flags: needinfo?(emilio)
Upstream PR was closed without merging
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/842cc90cd235 Don't drop CSSStyleSheet.cssRules from CSSStyleSheet.replace/Sync(). r=firefox-style-system-reviewers,layout-reviewers,boris
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
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: