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

Update constructor definition, add factory method #31

Closed
wants to merge 2 commits into from

Conversation

TakayoshiKochi
Copy link
Member

From the discussion threads, the constructor now creates an empty
CSSStyleSheet without loading/parsing. Instead, we add a factory
method to return a promise that resolves a new CSSStyleSheet object
that contains parsed style sheet from given text.

Resolves #2, #13.

Takayoshi Kochi and others added 2 commits July 6, 2018 15:09
From the discussion threads, the constructor now creates an empty
CSSStyleSheet without loading/parsing.  Instead, we add a factory
method to return a promise that resolves a new CSSStyleSheet object
that contains parsed style sheet from given text.
@TakayoshiKochi
Copy link
Member Author

I'm new to editing bikeshed myself, will get it reviewed by Tab or someone later, but Rakina, could
you check this is what we expected?

<a>create a MediaList object</a> from the string
and assign it as <var>sheet’s</var> media.
Otherwise, assign the value of the attribute as <var>sheet’s</var> media.
3. If the {{CSSStyleSheetInit/alternate}} attribute of <var>options</var> is true,
Otherwise, copy and assign the value of the attribute as <var>sheet’s</var> media.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "assign a copy of the value of the attribute"?

@rakina
Copy link
Member

rakina commented Aug 28, 2018

A newer pull request (#33) is out now, with createEmptyCSSStyleSheet. Moving it to there.

@rakina rakina closed this Aug 28, 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

Successfully merging this pull request may close these issues.

Consider adding StyleSheet.createFromString() which returns Promise<StyleSheet>
2 participants