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

Add create[Empty]CSSStyleSheet and bring back moreStyleSheets #33

Merged
merged 4 commits into from
Aug 29, 2018

Conversation

rakina
Copy link
Member

@rakina rakina commented Aug 28, 2018

Discussions led to changing the constructor to a factory method and splitting into two functions, one returning a Promise to not block with text parsing, and another to return a CSSStyleSheet that is empty/doesn't have any text. The methods are located in Document so that association of the constructed stylesheet with the Document is clear, and thus we can have clear URL (#10, #15) of the stylesheet and enforce usage in only one Document (#23).

We're also bringing back moreStyleSheets due to interest in WICG/webcomponents#759

Resolves #2, #13.


Preview | Diff

@rakina
Copy link
Member Author

rakina commented Aug 28, 2018

Oh, and this might be a good time to rename moreStyleSheets. Maybe constructedStyleSheets?

@calebdwilliams
Copy link

If moreStyleSheets is a property on a document or document fragment (element?) that allows for the inclusion of otherwise external stylesheets, I would say adoptedStyleSheets would be more accurate especially if something like CSS JS imports becomes a thing.

index.bs Show resolved Hide resolved
index.bs Outdated
@@ -28,10 +30,17 @@ dictionary CSSStyleSheetInit {
boolean alternate = false;
boolean disabled = false;
};

partial interface DocumentOrShadowRoot {
attribute StyleSheetList moreStyleSheets;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to bikeshed this name, it's so bad. ^_^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, any suggestions? adoptedStyleSheets from @calebdwilliams sounds good, I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine to me.

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

Successfully merging this pull request may close these issues.

3 participants