Re: [css-houdini-drafts] [css-typed-om] Prevent CSS Typed OM updates via `attributeStyleMap` from updating DOM `style` attributes (#997)

The CSS Working Group just discussed `Concern about attributeStyleMap updating the style attribute`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: Concern about attributeStyleMap updating the style attribute<br>
&lt;TabAtkins> github: https://github.com/w3c/css-houdini-drafts/issues/997<br>
&lt;fantasai> TabAtkins: I'm not sure if this is an actual concern to worry about<br>
&lt;fantasai> TabAtkins: wanted impl advice<br>
&lt;fantasai> TabAtkins: when doing high-frequency updates, like during TypedOM<br>
&lt;fantasai> TabAtkins: use single transform object, setting over and over again<br>
&lt;fantasai> TabAtkins: but are seeing the style attr get updated in real time as well<br>
&lt;fantasai> TabAtkins: so reserialization happening constantly as well<br>
&lt;fantasai> TabAtkins: we saw as a perf concern<br>
&lt;fantasai> TabAtkins: So is this actually causing trouble?<br>
&lt;fantasai> TabAtkins: person seems to believe causing perf issues, I'm not sure myself<br>
&lt;fantasai> TabAtkins: but if we are eagerly reserializing to style attr, not great. Negates a major advantage of TypedOM<br>
&lt;fantasai> TabAtkins: Apparently we don't ???<br>
&lt;fantasai> TabAtkins: but if you look in inspector, do see it being constantly updated<br>
&lt;fantasai> TabAtkins: But either way..<br>
&lt;jensimmons> present-<br>
&lt;fantasai> emilio: Mutation observer thing, it should fire mutation observer callbacks exceptin some cases<br>
&lt;fantasai> emilio: afaict, internally we don't serialize until asked for<br>
&lt;fantasai> emilio: if that's devtools, then we reserialize all the time<br>
&lt;fantasai> TabAtkins: if that's true across browsers, then I can close as no change, browsers are smart enough to handle appropriately don't worry about it<br>
&lt;fantasai> fremy: meaning?<br>
&lt;fantasai> TabAtkins: browsers aren't eagerly serializing<br>
&lt;fantasai> iank_: file a bug against Chrome? we should investigate this<br>
&lt;fantasai> TabAtkins: apparently Chrome doesn't fire mutation events<br>
&lt;fantasai> TabAtkins: that's a bug in chrome<br>
&lt;fantasai> fremy: Because we still want to update the style attr, every single time<br>
&lt;fantasai> fremy: can we put something in the spec that says when?<br>
&lt;fantasai> AmeliaBR: it's on demand<br>
&lt;fantasai> TabAtkins: when someone asks for it, or is observing the style attr<br>
&lt;fantasai> fremy: so flag it?<br>
&lt;fantasai> fremy: ok<br>
&lt;Rossen___> q?<br>
&lt;fantasai> TabAtkins: sounds like the resolution should be, browsers should be smart enough to lazily serialize style attr when necessary<br>
&lt;Zakim> fantasai, you wanted to suggest a note in the spec<br>
&lt;fantasai> TabAtkins: I can put a note in the spec<br>
&lt;fantasai> AmeliaBR: One thing to consider, should this be a general thing for DOM attributes reflected?<br>
&lt;fantasai> AmeliaBR: working with CSSOM or other things to be consistent?<br>
&lt;fantasai> TabAtkins: yeah.....<br>
&lt;smfr> q+<br>
&lt;fantasai> TabAtkins: existing string OM, not doing any restringifying, but sure there are some reflected attrs<br>
&lt;fantasai> TabAtkins: in HTML... I'll check if HTML has wording on that<br>
&lt;fantasai> ACTION: TabAtkins investigate restringification of reflected attrs across OMs<br>
&lt;fantasai> fremy: Not always the user that gets the style attr<br>
&lt;fantasai> fremy: e.g. ??<br>
&lt;fantasai> fremy: Should never happen. Shouldn't change the DOM when recomputing CSS<br>
&lt;TabAtkins> s/??/if you have a selector that depends on the style attribute's contents/<br>
&lt;fantasai> TabAtkins: DOM has it internally tracked, doesn't need to update everything to keep consistent except on demand<br>
&lt;fantasai> emilio: style attr keep not a string, but a CSS declaration and an attached string<br>
&lt;fantasai> emilio: when request string, we serialize it<br>
&lt;fantasai> emilio: Someon requests DOM attr, will get the correct value<br>
&lt;TabAtkins> ack smfr<br>
&lt;fantasai> smfr: Normally we don't specify internal details<br>
&lt;fantasai> smfr: Would just be a QoI issue about when serialization happens<br>
&lt;fantasai> smfr: Spec shouldn't say anything, should just specify web-exposed behavior<br>
&lt;fantasai> TabAtkins: agree<br>
&lt;fantasai> TabAtkins: I will close no change, review HTML to see if they have any particular wording<br>
&lt;fantasai> AmeliaBR: only other thing is to make sure wording is clear wrt event hooks<br>
&lt;fantasai> AmeliaBR: should trigger mutation observers even if not serialized until asked for<br>
&lt;fantasai> ACTION TabAtkins write a test for mutation observer for style attr changes via TYpedOM<br>
&lt;fantasai> ACTION: TabAtkins write a test for mutation observer for style attr changes via TYpedOM<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/997#issuecomment-667233997 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 31 July 2020 17:09:29 UTC