Do you have any reading material on this? Or does it just refers to shadow dom being fast and encapsulated?
-
-
Replying to @wardpeet @sebmarkbage and
I don't know of articles on it;
@ElliottZ might3 replies 0 retweets 0 likes -
Replying to @slightlylate @wardpeet and
Inline style (.style.foo = ...) or setting .cssText is probably the slowest way to apply style. Classes and ids would be the fastest.
1 reply 4 retweets 24 likes -
Replying to @ElliottZ @slightlylate and
Not quite the same thing. Using .style.setProperty(...) is more relevant and much faster in most browsers (IE being an exception)
1 reply 0 retweets 0 likes -
Replying to @DavidKPiano @ElliottZ and
I'm sitting here looking at the setProperty code and I can't understand how that's possibly true; invokes parsing: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/StylePropertySet.cpp?type=cs&l=321 …
1 reply 1 retweet 2 likes -
Replying to @slightlylate @DavidKPiano and
Might get fewer property invalidations, but you trade that for more passes through the bindings; not a trade I'd naively make (need to test)
1 reply 0 retweets 0 likes -
Replying to @slightlylate @ElliottZ and
Here's the numbers (let me know if I can improve this test): https://esbench.com/bench/5908f78199634800a0347e94 …pic.twitter.com/vq4sjYvgFw
1 reply 0 retweets 3 likes -
Replying to @DavidKPiano @ElliottZ and
This is measuring throughput of the bindings, looks like. Maybe parsing perf. But not style resolution.
1 reply 0 retweets 0 likes -
Replying to @slightlylate @ElliottZ and
What's the best way of testing style resolution then?
1 reply 0 retweets 0 likes -
Replying to @DavidKPiano @ElliottZ and
put an offsetWidth read call inside your hot loop and make sure values alternate.
1 reply 0 retweets 0 likes
Also, recommend taking @ElliottZ's advice and look at .classList addition/removal too.
-
-
Replying to @slightlylate @ElliottZ and
Oh, interesting!pic.twitter.com/0UU1Jqcb0u
1 reply 1 retweet 5 likes - 5 more replies
New conversation -
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.