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•6 months ago
|
Comment 1•6 months 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•6 months 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•6 months ago
|
Assignee | ||
Comment 3•6 months ago
|
||
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 4•6 months ago
|
||
Assignee | ||
Comment 5•6 months ago
|
||
The styling works, it's just the OM that doesn't properly update.
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Updated•6 months ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9d7006e56f0 Fix up cssRules when calling replace() repeatedly. r=nordzilla
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43479 for changes under testing/web-platform/tests
Comment 8•6 months ago
|
||
bugherder |
Updated•6 months ago
|
Upstream PR merged by moz-wptsync-bot
Comment 10•6 months 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•6 months 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•6 months 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•6 months ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/7fbd067f5a53
Updated•6 months ago
|
Updated•5 months ago
|
Comment 14•5 months 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
•