Commit 47f5499
[CSS Modules] synchronously process blob URLs
After switching to Blob URL's in C:7075691, I noticed that the fetched
stylesheet is not always available immediately in a fully declarative
scenario (where both the style tag is a module and
shadowrootadoptedstylesheets references it), which wasn't the case for
dataURI's. Typically, the first n fetches fail to fetch, where n is
random.
I discovered that dataURI's were always synchronously returned from
ResourceFetcher via CreateResourceForStaticData.
To match this behavior with Blob URL's, this CL adds a new parameter to
synchronously fetch Blob URL's when initiated via
`shadowrootadoptedstylesheets`. Blob URL's remain async in all other
scenarios.
This behavior won't cause the same undesirable issues that synchronous
XHR faced because Blob URL's are typically local (and will always be
in-memory when generated via Declarative CSS Modules).
A test was added that failed ~50% of the time without this change.
This change will address the current undesirable behavior, but I'll
investigate what this would look like to make fully async with a
callback. This will take some time and will need input from the WHATWG
so for now this change will make the current design usable.
Bug: 448174611
Change-Id: If50701981f7eaa138fff7d9ca799431c3303fa721 parent 07448e7 commit 47f5499
File tree
1 file changed
+36
-0
lines changed- shadow-dom/declarative/tentative/shadowrootadoptedstylesheets
1 file changed
+36
-0
lines changedLines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments