Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing SLOT before it is executed in dom? #749

Closed
sashafirsov opened this issue Mar 27, 2018 · 6 comments
Closed

replacing SLOT before it is executed in dom? #749

sashafirsov opened this issue Mar 27, 2018 · 6 comments

Comments

@sashafirsov
Copy link

Say <show-source> web component meant to display the HTML as text which located within its body:

    <show-source>
         <style> h3{color:red} </style>
         <h3>Should be in red</h3>
    </show-source>

With async web component loading the UA of course will run css from content making all H3 red. But if the component declaration will be inline and available when UA is rendering <show-source> its code would not populate the embedded dom, replacing it with rendered text instead.

Q1. What events would permit to cut-off the inner dom before it is executed by UA?
Q2. What events would allow to interrupt the setting of innerHTML or inner dom injection making the substitution possible in run time?

Asking here as the question could become an enhancement request.

@annevk
Copy link
Collaborator

annevk commented Mar 27, 2018

What does executed mean here?

@sashafirsov
Copy link
Author

CSS rule from within content is applied in page scope.

@annevk
Copy link
Collaborator

annevk commented Mar 27, 2018

I guess you can track when the elements get inserted. At that point they'll likely be rendered at the next animation frame.

@sashafirsov
Copy link
Author

Is there some kind of flag not to render/execute content even if DOM is present?
Something like display:none but also applied to css and scripts in sub-dom.
The shadow dom is kind of like that.

@annevk
Copy link
Collaborator

annevk commented Mar 27, 2018

<template> I suppose.

@annevk
Copy link
Collaborator

annevk commented Mar 27, 2018

Anyway, I think it'd be best if you took this to Stack Overflow or an equivalent forum at this point. Hope this helped.

@annevk annevk closed this as completed Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants