{"action":"created","issue":{"url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/52","repository_url":"https://api.github.com/repos/WICG/construct-stylesheets","labels_url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/52/comments","events_url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/52/events","html_url":"https://github.com/WICG/construct-stylesheets/issues/52","id":372972753,"node_id":"MDU6SXNzdWUzNzI5NzI3NTM=","number":52,"title":"Need some wordsmithing on the \"using constructed stylesheets\" section","user":{"login":"bzbarsky","id":1457979,"node_id":"MDQ6VXNlcjE0NTc5Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1457979?v=4","gravatar_id":"","url":"https://api.github.com/users/bzbarsky","html_url":"https://github.com/bzbarsky","followers_url":"https://api.github.com/users/bzbarsky/followers","following_url":"https://api.github.com/users/bzbarsky/following{/other_user}","gists_url":"https://api.github.com/users/bzbarsky/gists{/gist_id}","starred_url":"https://api.github.com/users/bzbarsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzbarsky/subscriptions","organizations_url":"https://api.github.com/users/bzbarsky/orgs","repos_url":"https://api.github.com/users/bzbarsky/repos","events_url":"https://api.github.com/users/bzbarsky/events{/privacy}","received_events_url":"https://api.github.com/users/bzbarsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-23T12:25:32Z","updated_at":"2018-10-23T12:35:32Z","closed_at":null,"author_association":"NONE","body":"https://wicg.github.io/construct-stylesheets/index.html#using-constructed-stylesheets says:\r\n\r\n> A CSSStyleSheet can only be applied to the Document it is constructed on (e.g. the document on which the factory function is called on), and any ShadowRoot in the Document it is constructed on, by assigning an array containing the sheet to their adoptedStyleSheets. So, a stylesheet can be used in multiple DocumentOrShadowRoots within the document it is constructed on.\r\n\r\n> Non-explicitly constructed stylesheets cannot be added to adoptedStyleSheets.\r\n\r\nThere are a few problems here:\r\n\r\n1) 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 the `this` 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.\r\n\r\n2) 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.  The `Document` state from item 1 might work to identify \"constructed stylesheets\", depending on how it's defined.  \r\n\r\n3) 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 the `FrozenArray` because that's slightly rocket-science at the moment; please talk to @domenic about that."},"comment":{"url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/comments/432228112","html_url":"https://github.com/WICG/construct-stylesheets/issues/52#issuecomment-432228112","issue_url":"https://api.github.com/repos/WICG/construct-stylesheets/issues/52","id":432228112,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjIyODExMg==","user":{"login":"bzbarsky","id":1457979,"node_id":"MDQ6VXNlcjE0NTc5Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1457979?v=4","gravatar_id":"","url":"https://api.github.com/users/bzbarsky","html_url":"https://github.com/bzbarsky","followers_url":"https://api.github.com/users/bzbarsky/followers","following_url":"https://api.github.com/users/bzbarsky/following{/other_user}","gists_url":"https://api.github.com/users/bzbarsky/gists{/gist_id}","starred_url":"https://api.github.com/users/bzbarsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzbarsky/subscriptions","organizations_url":"https://api.github.com/users/bzbarsky/orgs","repos_url":"https://api.github.com/users/bzbarsky/repos","events_url":"https://api.github.com/users/bzbarsky/events{/privacy}","received_events_url":"https://api.github.com/users/bzbarsky/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T12:35:32Z","updated_at":"2018-10-23T12:35:32Z","author_association":"NONE","body":"And I guess https://github.com/WICG/construct-stylesheets/issues/50 (which I think got filed while I was typing the above) is pretty similar..."}}
{"actor":{"display_login":"bzbarsky"}}