-
Notifications
You must be signed in to change notification settings - Fork 25
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
Need some wordsmithing on the "using constructed stylesheets" section #52
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wicg.github.io/construct-stylesheets/index.html#using-constructed-stylesheets says:
There are a few problems here:
The definition of which document a sheet is associated with is not clear. Is it the
this
object of the factory method, or a document derived from the factory method itself (from its Realm)? Those can be different if.call
is used. Presumably it should just be thethis
object of the factory method. Ideally this would be clearly specified in the factory methods by storing a reference to the "context object"Document
on the resulting sheet. This may require adding a state item ("pinned document", "unique document", "document", there are several options for naming and semantics here) to https://drafts.csswg.org/cssom/#css-style-sheets but that shouldn't be too bad, especially since CSSOM has a reasonably active editor now.There is currently no state associated with a stylesheet that indicates whether it's an "explicitly constructed stylesheet". Presumably
@imports
from constructed stylesheets are "non-explicitly constructed stylesheets", but right not that's not really defined. TheDocument
state from item 1 might work to identify "constructed stylesheets", depending on how it's defined.The spec doesn't define what happens if you do try to assign a sheet in the wrong document. Presumably the
adoptedStyleSheets
setter should throw in this case. This might be best addressed by writing down actual steps for that setter. Those steps would also do the throwing for non-explicitly constructed stylesheets. You will need some handwaving in terms of how you're getting your hands on the actual stylesheets from theFrozenArray
because that's slightly rocket-science at the moment; please talk to @domenic about that.The text was updated successfully, but these errors were encountered: