CSSStyleSheet.replace() only keeps old cssRules incorrectly
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Tracking
()
People
(Reporter: SkepticaLee, Assigned: emilio)
Details
Attachments
(3 files)
8.50 KB,
image/png
|
Details | |
871 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0
Steps to reproduce:
- Create a new style sheet with new StyleSheet
- Add content with stylesheet.replace (content)
- Replace content with new content when the replace Promise is returned - .then (v => stylesheet.replace (new content))
A working example of this is at https://jsfiddle.net/skepticalee/bvwqk9a5/92/.
Actual results:
The CSSRules shown after steps 2 and 3 are identical,
Expected results:
The CSSRules should have been updated by the new content. At the above jsfiddle, the first two lines should show different CSS, and the last line should show the latest CSS. The example shows that the method replaceSync () works, but that even removing all the rules from the stylesheet does not allow replace () to function (see screenshot).
The jsfiddle works as expected in Edge (try it out yourselves).
Updated•1 year ago
|
Managed to reproduce this issue on:
- Firefox 119.0.1;
- Firefox 120.0;
- Nightly 121.0a1;
Tested and reproduced on:
- macOS 12;
- Windows 10;
- Ubuntu 22;
Setting as NEW.
Comment 2•1 year ago
|
||
The severity field is not set for this bug.
:TYLin, could you have a look please?
For more information, please visit BugBot documentation.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Comment 5•1 year ago
|
||
The styling works, it's just the OM that doesn't properly update.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 8•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Comment 10•1 year ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox121
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 11•1 year ago
|
||
Comment on attachment 9366497 [details]
Bug 1864815 - Fix up cssRules when calling replace() repeatedly. r=#style,#layout,nordzilla
Beta/Release Uplift Approval Request
- User impact if declined: comment 0
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): One liner fix + test.
- String changes made/needed: none
- Is Android affected?: Yes
Comment 12•1 year ago
|
||
Comment on attachment 9366497 [details]
Bug 1864815 - Fix up cssRules when calling replace() repeatedly. r=#style,#layout,nordzilla
Approved for 121.0b8.
Comment 13•1 year ago
|
||
uplift |
Updated•1 year ago
|
Updated•1 year ago
|
Reproducible on a 2023-11-30 Nightly build on Windows 10.
Verified as fixed on Firefox 121.0b8 and Nightly 122.0a1 on Windows 10, macOS 12, Ubuntu 22.
Description
•