It's largely the same code that's used for ie11 when shadow dom isn't supported. But it also includes html comments to help rebuild each component's associated DOM that allows the many nested levels to stay separated internally.
-
-
Replying to @adamdbradley @dfabu and
Do you translate the CSS during rehydration?
1 reply 0 retweets 0 likes -
Replying to @justinfagnani @dfabu and
Yes. That's also largely the same code as ie11 when a component uses shadow dom, but the css needs to be scoped to simulate SD.
1 reply 0 retweets 0 likes -
Replying to @adamdbradley @dfabu and
Right, but once you rehydrate to real shadow roots, what do you do with the CSS?
1 reply 0 retweets 0 likes -
Replying to @justinfagnani @dfabu and
It no longer applies. Right now we're not removing it in order to reduce runtime, but that's still worth profiling.
1 reply 0 retweets 0 likes -
Replying to @adamdbradley @dfabu and
Do you swap in the shadow dom targeting CSS?
1 reply 0 retweets 0 likes -
Replying to @justinfagnani @dfabu and
Not sure I'm following, but the same css, which was first scoped css, is able to be converted into SD css and applied the normal SD way (shadowRoot style when constructable isn't supported). But this is all handled by the compiler and generated client-side.
1 reply 0 retweets 1 like -
Replying to @adamdbradley @dfabu and
I'm asking about the conversion. Presumably <my-element> will have a rule like: :host { display: block; } which needs to be converted to: my-element { display: block; } Do you convert it client-side back to the original?
2 replies 0 retweets 2 likes -
Replying to @justinfagnani @adamdbradley and
Why not inline a shadow-root element in the head, let the HTML parser trigger upgrades. No need to worry about weird css transforms?
1 reply 0 retweets 3 likes -
Replying to @matthewcp @justinfagnani and
Ideal to me is <my-el> <template is=shadow-root> ... </template> light dom here </my-el> This seems super simple to implement. Very small JS in the head to do upgrades.
1 reply 0 retweets 3 likes
And in this syntax, the shadow root element implicitly attaches to the <my-el> instance as an open root at `.shadowRoot`? I'm fine with throwing closed roots on the fire for this case.
-
-
Replying to @slightlylate @justinfagnani and
Yeah no one really uses closed roots
1 reply 0 retweets 0 likes -
Replying to @matthewcp @justinfagnani and
The semantics of the upgrade are interesting. Does the shadow root apply (and get displayed) *before* the element is upgraded?
2 replies 0 retweets 1 like - 1 more reply
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.