Expose CSSStyleSheet post-fetching
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: annevk, Unassigned)
References
Details
Attachments
(1 file)
|
585 bytes,
text/plain
|
Details |
Making <link>.sheet non-null in the task where the load event is dispatched is a better model than making it always non-null and exposing cssRules during the load event. It's also what Chrome/Safari do, modulo https://bugs.webkit.org/show_bug.cgi?id=177847 (data URLs).
Arguably this is also what the HTML Standard in combination with CSSOM require, though there is a lot of vagueness between them as well that at some point needs to be sorted.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
So, WebKit's behavior:
- Only exposes
sheeton link after load (of that stylesheet at least). - Exposes
sheetof<style>unconditionally, even if there are pending@importloads...
So Firefox behavior is consistent, at least...
| Reporter | ||
Comment 2•5 years ago
•
|
||
I think the inconsistency is not shown by that test, but is by a theoretical other where the <link> style sheet also has an @import as that blocks creation of the style sheet object, whereas for <style> it does not (that's always synchronous).
Even so, in the <style> case WebKit does not create a style sheet object for the imported style sheet until it is fetched.
You could argue that there's a consistency in how WebKit deals with asynchronous style sheet object creation and synchronous style sheet object creation and that we should maybe never have had synchronous style sheet object creation, though I guess https://github.com/WICG/construct-stylesheets/ landed in the other camp. We should get this tested as part of that too.
Comment 3•4 years ago
|
||
Bug 1673885 fixed this.
Updated•4 years ago
|
Description
•