Is there a way to append a single <style> that is shared between all instances instead than creating a <style> for every instance?
-
-
...instead of* creating a <style> for every instance?
1 reply 0 retweets 0 likes -
Replying to @thysultan @heydonworks
Yep! This was the note a out using cloneNode().
1 reply 0 retweets 1 like -
*about
1 reply 0 retweets 0 likes -
But again, the new <style> approach is cheaper than it looks because browsers are smart.
1 reply 0 retweets 0 likes -
Replying to @slightlylate @heydonworks
Though in this case wouldn't the DOM ops make perf favor a non-shadow impl O(N), vs shadow O(2N), assuming both need to use `all: initial`?
1 reply 0 retweets 0 likes -
correction, vs shadow O(N+1)
1 reply 0 retweets 0 likes -
*non-shadow O(N+1)
1 reply 0 retweets 0 likes -
Replying to @thysultan @heydonworks
There is overhead for the SD, but the difference is often made up for by the faster scoped style resolver: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h?sq=package:chromium&dr=CSs …
2 replies 0 retweets 0 likes -
What SD gives you that you can't get any other way is style resolution that operates over the rules you actually need to consider.
1 reply 0 retweets 0 likes
At scale, this helps you go faster in 2 ways: 1.) fewer global rules to consider in light-DOM style resolution 2.) scoped resolution faster
-
-
It's one of those places where faking your scoping some other way can't ever be as good as the real thing.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.