Re: [css-houdini-drafts] [css-typed-om-1] What does computedStyleMap() do on elements that are in documents with no browsing context?

The Working Group just discussed `What does computedStyleMap() do on elements that are in documents with no browsing context?`, and agreed to the following resolutions:

* `RESOLVED: If you attempt to get a computedStyleMap or use a computedStyleMap on an element not in the document it throws`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: What does computedStyleMap() do on elements that are in documents with no browsing context?<br>
&lt;dael> github: https://github.com/w3c/css-houdini-drafts/issues/659<br>
&lt;dael> TabAtkins: If anybody has strong opinions I"m happy to go with it. You gab a ComputedStyle map. It has changes to the underlying element. What happens if the element isn't in the document? What happens if you grab the map off of something and then moves the element to another document and you query the computed style. What's it reflecting?<br>
&lt;dael> Rossen_: For the first one, what happens on an element that is not connected to the current document but is constructed from script and you ask for a styleMap. Everyone but Edge returns initial values. We try to do more and try to compute the cascade on that sub tree in the ether.<br>
&lt;dael> Rossen_: I don't think this is great. We do see some interop issues, but not huge. We went to some effort to represent the cascade style and we'd prefer not to<br>
&lt;dael> TabAtkins: If you try to get a style map off of something in the document I'm happy to say it throws. If you have a computedStyleMap and the lement is removed any attemt ot get or set throws.<br>
&lt;dael> TabAtkins: That's easier for everybody.<br>
&lt;dael> Rossen_: I support that. Makes it a lot more predicatble.<br>
&lt;dael> TabAtkins: Let's resolve on that.<br>
&lt;dael> Rossen_: Proposal: computedStyleMap is a live object that returns all expected values when attached to main markup and throws otherwise<br>
&lt;dael> TabAtkins: If you attempt to get a computedStyleMap or use a computedStyleMap on an element not in the document it throws<br>
&lt;dael> Rossen_: Obj?<br>
&lt;dael> RESOLVED: If you attempt to get a computedStyleMap or use a computedStyleMap on an element not in the document it throws<br>
&lt;dael> TabAtkins: Sub issue if you grab a computed style map while in doc a and it moves to document b do you get a value?<br>
&lt;dael> TabAtkins: I think the style map just reflects the value in the new document.<br>
&lt;dael> TabAtkins: Issue is what is the document providence of the objects returned. Different documents have different globals. Would computedStyleMap from old doc still work? Or return typedOM values from old or new doc?<br>
&lt;dael> TabAtkins: Those problems make me lean throw here as well.<br>
&lt;dael> Rossen_: Not sure. This is eq. to grabbing a style sheet from one doc and intesting to a new doc. You would expect everything will return values...<br>
&lt;dael> TabAtkins: That's fine because it's immutable perm. strings. This is using an old object. If you say is this style map part of doc a it's [missed]<br>
&lt;dael> Rossen_: Because it's mutable it's a problem.<br>
&lt;dael> TabAtkins: Yes.<br>
&lt;dael> TabAtkins: I'm fine with putting in a doc check.<br>
&lt;dael> Rossen_: That or we can...we can keep referential integrity and re-calc everything. So you still have the live object but a new topogaphy on it.<br>
&lt;dael> TabAtkins: The obvious way to define what global the produced elements are from is the global of the method you call to create. So get on computerStyleMap so your unit values are from the old document. That falls out and might be okay, but it's a weird mix of values from different docs.<br>
&lt;dael> TabAtkins: You're still producing style values from the old.<br>
&lt;dael> Rossen_: I'm fine more restrictive for now and if compelling use cases arrise and extend life time we'll deal then.<br>
&lt;dael> TabAtkins: Yeah. And solution is to call getComputedStyleMap on the new. So throw now and relax later if we need to?<br>
&lt;dael> Rossen_: Yeah.<br>
&lt;dael> TabAtkins: Check for previous resolution can also check if it's in the same document as the map cares about.<br>
&lt;dael> Rossen_: Other opinions or objections?<br>
&lt;dael> resolved: style maps of elements moved between documents throw<br>
&lt;dael> Rossen_: So if element moved or created in the ether or moved and you try and use it it throws. Only time where you can take the element out, put it back in the same document, that'll work?<br>
&lt;dael> TabAtkins: Yes unless you call middle of append steps. Yes. Moving elements within doc has no negative effect.<br>
&lt;dael> Rossen_: That's what I wanted to point out.<br>
</details>


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

Received on Wednesday, 28 March 2018 16:55:36 UTC