nsIStyleSheetService gets cached version on first loadAndRegisterSheet()
Categories
(Thunderbird :: General, defect)
Tracking
(Not tracked)
People
(Reporter: tustamido, Unassigned)
Details
Tested both in TB 78 and TB 88. Despite nsIStyleSheetService being a Gecko thing, this bug doesn't apply to Firefox.
Steps to reproduce:
-
Save a CSS file anywhere with any rule that you can notice when the code is applied. For example:
* {color: blue} -
Get the file URI, like
file:///C:/test.css. -
Run the following code in Error Console, replacing the URI by the one you get in previous step:
Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService).loadAndRegisterSheet(Services.io.newURI('file:///C:/test.css'), 2); -
You'll see the style applied. Now remove it:
Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService).unregisterSheet(Services.io.newURI('file:///C:/Users/test.css'), 2); -
Edit the file, like replacing
bluebyred. Then save it. -
Register the stylesheet again (step 3).
Text in TB should become red, but instead it turns blue again. If you unregister the sheet again and re-register, now you'll get the updated version.
So TB needs to apply the stylesheet twice to update it.
Steps 3 and 4 have differents file URIs (file:///C:/test.css and file:///C:/Users/test.css), but this was just a typing error while creating this bug. Of course you should use the same URL in both steps, matching the location of the test file.
Updated•4 years ago
|
Just updating that this issue is still present in TB 102.
It was fixed, TB 128 is not longer affected.
Description
•