Re: [csswg-drafts] [cssom] Need to agree on when LinkStyle.sheet gets updated in shadow trees.

The CSS Working Group just discussed `Need to agree on when LinkStyle.sheet gets updated in shadow trees.`, and agreed to the following:

* `RESOLVED:  Disconnected elements don't have stylesheets`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: Need to agree on when LinkStyle.sheet gets updated in shadow trees.<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/3096<br>
&lt;dael> emilio: cssom spec the first spec when an element has a stylesheet to html. Html doesn't spec. impl did different things. Gecko loads stylesheets in shadow trees. Blink and webkit don't/ Fine spec webkit and tying loading a sheet to connected to a document. Makes shadowroot stylesheets useless unless root is connected<br>
&lt;dael> emilio: Overall that makes sense. Example a styleelement.sheet is also used when style is not in doc.<br>
&lt;dael> astearns: Any concerns?<br>
&lt;dael> astearns: Makes sense to me<br>
&lt;dbaron> s/used/useless/<br>
&lt;dael> emilio: Fine for me if we get a resolution I'll make edits<br>
&lt;dael> astearns: Proposal: Spec webkit/blink behavior for disconnected shadown roots<br>
&lt;dael> emilio: Disconnected elements don't have stylesheets<br>
&lt;dael> astearns: This goes into html?<br>
&lt;dael> emilio: May need to. I'll discuss with html editors who should spec. it's right now nowhere<br>
&lt;dael> astearns: Prop: Disconnected elements don't have stylesheets<br>
&lt;dael> astearns: Objections?<br>
&lt;dael> Rossen_: Disconnected elements have no stylesheets. If I make an element through OM and make a style element the contents are dropped?<br>
&lt;dael> emilio: Not dropped, but they're not associated.<br>
&lt;chris> what about style elements in the disconnected element? or style attributes?<br>
&lt;dael> Rossen_: Once I merge into main tree style sheet becomes<br>
&lt;dael> emilio: Yes, it's non-null<br>
&lt;dael> Rossen_: There's a temp style sheet not accessible through OM, but it's created and retained for lifetime of subtree<br>
&lt;dael> Rossen_: My assertion is there is an actual style sheet not accessible through OM until element is merged into main tree<br>
&lt;dael> emilio: IN gecko we have no style sheet. We parse when becomes connected<br>
&lt;dael> Rossen_: So you're saying if the stylesheet has external reference you won't download until merged into tree<br>
&lt;dael> emilio: Right. THat's only thing HTML specs.<br>
&lt;dael> Rossen_: Then I'm fine with the proposal. That answers my question<br>
&lt;dael> plinss: If you're creating a custom element you cannot manipulate stylesheet through cssom until connected to document.<br>
&lt;dael> Rossen_: That's current<br>
&lt;dael> emilio: You don't want to trigger loads. Rune said he's in agreement. You can create stylesheet via inner html but can't access via OM<br>
&lt;dael> Rossen_: This is also related to our previous discussions abotu sso on disconnected trees. We'd give them stock style answers was our conclusion so you don't trigger style computation. That's why asked if we'd spec so downloads don't occur until merge with main<br>
&lt;dael> plinss: If I create web component it cannot be made ready until plug into doc<br>
&lt;dael> Rossen_: Correct<br>
&lt;dael> plinss: So I plug it in wait for style to download and parse, get a flash of unstyled and then can manipluate.<br>
&lt;dael> Rossen_: Not defending, but it is the current<br>
&lt;dael> plinss: Do we want this?<br>
&lt;dael> emilio: For small components you use inline styles and defer parsing until you insert it.<br>
&lt;dael> Rossen_: plinss perhaps is alluding to a separate issue that perhaps we need a trigger that forces download when not connected.<br>
&lt;dael> plinss: At least parse and manipulate<br>
&lt;dael> Rossen_: Yeah, this is a fair point.<br>
&lt;AmeliaBR> Remember, there is always &lt;link rel="preload" as="stylesheet" />, which you can add to the main document to trigger a download without applying styles just yet.<br>
&lt;dael> emilio: I think there are proposals in Google for document.tree to allow. Wouldn't work like current style sheets. It's a different API. But I think would address that use case<br>
&lt;dael> plinss: This is something I ran into in the last week or two. I want to set values of custom prop and I can't do it through clean APIs. We should allow authors to manipulate style sheets before connection<br>
&lt;dael> emilio: I thik google proposal address that. I don't think we want current style and link to trigger downloads<br>
&lt;dael> plinss: Understood. Not proposing we change legacy. There is a use case here.<br>
&lt;dael> emilio: File as a sep. issue?<br>
&lt;dael> plinss: Fair enough.<br>
&lt;dael> astearns: plinss do you want to investigate current proposals and file an issue if they're not enough?<br>
&lt;dael> plinss: Yes<br>
&lt;dael> astearns: Proposal:  Disconnected elements don't have stylesheets<br>
&lt;dael> astearns: Obj?<br>
&lt;dael> RESOLVED:  Disconnected elements don't have stylesheets<br>
&lt;emilio> plinss: https://github.com/w3c/webcomponents/issues/468 is what comes to mind<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3096#issuecomment-420719482 using your GitHub account

Received on Wednesday, 12 September 2018 16:50:22 UTC