Skip to content

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

Merged
tabatkins merged 4 commits into
gh-pagesfrom
factory
Aug 29, 2018
Merged

tabatkins merged 4 commits into
gh-pagesfrom
factory

Conversation

@rakina

@rakina rakina commented Aug 28, 2018 •

Copy link
Copy Markdown
Member

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

rakina commented Aug 28, 2018

Copy link
Copy Markdown
Member Author

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

@calebdwilliams

Copy link
Copy Markdown

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.

Comment thread index.bs Resolved
Comment thread index.bs Outdated
};

partial interface DocumentOrShadowRoot {
attribute StyleSheetList moreStyleSheets;

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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