-
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
Shadow DOM, <style>, and document.styleSheets #56
Comments
In The test creates a (For here, let's assume "in a Document" in the discussion above means the shadow host is Clarification needed when style sheets are added to ShadowRoot,
2 makes sense in that the timing is |
I'm no sure (2) makes more sense than (1). I'd consider |
I don't have strong preference for either options. (2) could be consistent with document.styleSheets case in that the array reflects |
in the Live DOM Viewer. It'll log 0, 1. Given that I think we should go with 1. |
We have no objection for going with 1. @hayatoito could you close this? |
Only if it is connected, or only if it is browsing-context connected? |
I think if we can get away with only browsing-context connected I'd be okay with that. That's certainly the only case where there is a viewport and styling actually makes sense. |
I prefer "only browsing-context connected" because it is consistent with the conclusion of #530. |
Hmm that might not be right though, see whatwg/html#1495 (comment) In other words I think the browsing context requirement is more about fetching than it is about style application. |
Yeah, the question is whether the style application is actually required by the web or not. Seems likely, but worth investigating I suppose. |
I see. It looks we have two options.
1 is a strict condition, and 2 is more relaxed condition than 1. If we forget a shadow tree, the current Web platform is using 2, right? As far as I see in HTML Standard, it looks it does not consider a browsing-context. "in a document"-ness only matters. |
Yeah, http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2739 is the test noted in the HTML Standard source that indicates a browsing context isn't needed. |
In that browsing context less document, are browsers expected to load external CSS files specified by |
So it's rather messy actually. While No browser appears to load I used variations on this code in Live DOM Viewer:
|
If That makes me think that the status quo of letting styles apply but failing to load That is, make |
I think that is what we have in the HTML Standard now. However, note that in Chrome and Safari |
Yeah, that sounds like just a bug in WebKit/Blink. |
Closing this as I think we're good as far as |
Title: [Shadow]: Style element should specify when to create and add style sheet in shadow DOM (bugzilla: 26850)
Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850#c0
William Chen wrote on 2014-09-18 18:32:10 +0000.
The spec currently specifies the ShadowRoot styleSheets property as:
"On getting, the attribute must return a StyleSheetList sequence containing the shadow root style sheets."
The spec for the style element only specifies creating sheets for elements "in a Document":
https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block
The spec for "create a CSS style sheet" only adds sheets to the document:
http://dev.w3.org/csswg/cssom/#create-a-css-style-sheet
As it's currently specified, .styleSheets always returns an empty list.
comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850#c1
Simon Pieters wrote on 2014-09-19 11:15:21 +0000.
HTML and/or CSSOM can probably be changed if needed.
comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850#c2
Ian 'Hixie' Hickson wrote on 2014-09-26 18:27:21 +0000.
Yeah. Tell us what needs changing.
comment: 3
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850#c3
Kenji Baheux wrote on 2014-12-04 07:45:01 +0000.
Hayato: let me increase the priority since we probably need to resolve this one to move forward on 27418
comment: 4
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26850#c4
Hayato Ito wrote on 2014-12-04 07:50:42 +0000.
I think this is yet another instance of 'In a Document' issue.
See https://www.w3.org/Bugs/Public/show_bug.cgi?id=26365.
The text was updated successfully, but these errors were encountered: