RESOLVED FIXED 235930
Blank page when removing CSS @import
https://bugs.webkit.org/show_bug.cgi?id=235930
Summary Blank page when removing CSS @import
Oriol Brufau
Reported 2022-01-31 17:04:28 PST
Run the script from bug 235434: ```html You should see this text!!! <script> const style = document.createElement("style"); document.head.append(style); style.sheet.insertRule('@import url("nonexist.css")'); style.sheet.cssRules[0]; style.sheet.deleteRule(0); </script> ``` Actual: completely blank page Expected: page with "You should see this text!!!" Reason: the import rule is removed before it finishes loading, and the hasPendingSheet() flag is not cleared.
Attachments
Patch (5.74 KB, patch)
2022-01-31 17:11 PST, Oriol Brufau
no flags
Patch (5.78 KB, patch)
2022-02-01 04:29 PST, Oriol Brufau
no flags
Oriol Brufau
Comment 1 2022-01-31 17:11:18 PST
EWS Watchlist
Comment 2 2022-01-31 17:14:14 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Antti Koivisto
Comment 3 2022-01-31 23:45:16 PST
Comment on attachment 450478 [details] Patch looks like the debug bot is hitting assert under StyleRuleImport::cancelLoad
Antti Koivisto
Comment 4 2022-01-31 23:46:10 PST
in imported/w3c/web-platform-tests/css/cssom/cssimportrule-parent.html sonf inspector/css/stylesheet-events-imports.html
Oriol Brufau
Comment 5 2022-02-01 04:29:35 PST
Oriol Brufau
Comment 6 2022-02-01 04:31:39 PST
Should work now. It's just that cancelLoad() shouldn't do anything if it had already loaded.
Antti Koivisto
Comment 7 2022-02-01 04:33:51 PST
Comment on attachment 450515 [details] Patch Good find, thanks!
Radar WebKit Bug Importer
Comment 8 2022-02-01 04:52:45 PST
EWS
Comment 9 2022-02-01 08:42:56 PST
Committed r288879 (246631@main): <https://commits.webkit.org/246631@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450515 [details].
Note You need to log in before you can comment on or make changes to this bug.