Not sure what you're buying. The CSS is still a JS string that is getting passed from the JS to DOM. Better off disabling a stylesheet?
-
-
Replying to @slightlylate @threepointone and
And I don't know what Fiber does for you here (aside from fewer janky frames overall). Total work the same.
1 reply 0 retweets 0 likes -
Replying to @slightlylate @threepointone and
Is "double parse" what happens when CSS strings are embedded in JS like Webpack does?
2 replies 0 retweets 0 likes -
Replying to @sebmarkbage @slightlylate and
If the CSS string is loaded from XHR, substr, then inserted. Does that avoid the problem or is Chrome's CSS parser unable to use the string?
1 reply 0 retweets 0 likes -
Replying to @sebmarkbage @threepointone and
You've still pulled it into the JS engine first. Again, not a huge cost, but I'm not sure why you *would* do it. Paying lots of costs.
3 replies 0 retweets 3 likes -
Replying to @slightlylate @threepointone and
I'm suspecting style.cssText and using cloneNode can be more efficient than large files w/ selectors in some scenarios. Experimental tho.
1 reply 0 retweets 1 like -
Replying to @sebmarkbage @threepointone and
cloneNode + shadow DOM's is a HUGE win. We de-dupe rules inside shadows & use separate (faster!) resolver.
1 reply 0 retweets 3 likes -
Replying to @slightlylate @threepointone and
With style sheets it is difficult to be granular, bc the overhead of network/DOM per sheet, so you end up parsing rules you don't use.
1 reply 0 retweets 1 like -
Replying to @sebmarkbage @threepointone and
...but that stylesheet construction is going to be faster than doing this through JS until you get a *very* large stylesheet.
2 replies 0 retweets 2 likes -
Replying to @slightlylate @sebmarkbage and
Also, recall that the browser can yield and break up work when parsing formats other than JS.
1 reply 0 retweets 1 like
We've got 20 years of incremental rendering experience. Browsers are pretty darned good at managing work to stay responsive.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.