-
Notifications
You must be signed in to change notification settings - Fork 378
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
ShadowRoot.styleSheets should return an empty StyleSheetList if the shadow root is not connected #526
Comments
I will file an issue to HTML Standard too. |
This was intentional per discussion on #56. |
Ops. I did not realize that we had a discussion. It looks I had actually closed the issue without thinking crefully. :( It looks this is an intentional change. However, I think we should revert this whatwg/html#1199 The reason is : I am not sure how other UAs are doing. But it would make sense to skip this process, as an optimization, I think. If my understanding is wrong, please correct me. |
The behavior here is that stylesheets would continue to not load while it's detached from a tree. And load it once it's inserted into either a shadow tree or a document tree. This is consistent with how a view-less document work as depicted in #56 (comment). I would be strongly opposed to changing the behavior here. Please initiate a call for consensus if you'd like to change the behavior. |
I am confused... It sounds that I and you have the same opinion.
Yeah, that is exactly what I am proposing here. |
Oh. I understand.
Could you tell us what's the benefit of this behavior?
|
Right, this is because a window-less document would still load stylesheets. Since |
Thanks. Now I think I understand your opinion exactly. Note that I am not saying that window-less document should not load style sheets. It's in a shadow-including document, I think. So it should load stylesheets. I think we are in the same boat regarding this, |
I don't understand what "engine friendly" even means. Given browser engines have the capability to load stylesheets per document, I see no reason they can't do the same per shadow root basis. As for WebKit's behavior, we don't currently support |
I'm pretty sure we resolved this by saying This needs to be spec'ed in https://drafts.csswg.org/cssom/#extensions-to-the-document-or-shadow-root-interface |
This is basically whatwg/html#4547 |
It looks that the current spec has an unintentional bug in
ShadowRoot.styleSheets
. To return a meaningful StyleSheetList, UA has to parse (the contents of) style elements even if the shadow root is not in a shadow-including document.That is inconsistent with the current Web, I think. Processing a style element should be delayed until the style element is connected to a document.
The spec should clarify that it is okay to return an empty StyleSheetList if the shadow root is not in a shadow-including document.
The text was updated successfully, but these errors were encountered: