Re: [csswg-drafts] [scroll-animations-1] JS API for view-timeline-inset (#7748)

The CSS Working Group just discussed `JS API for view-timeline-inset`, and agreed to the following:

* `RESOLVED: Insets accept either a string containing CSS, or a sequence of TypedOM values.`
* `RESOLVED: Accept fantasai's proposal for resolution 2`
* `RESOLVED: Defer adding inset properties to the timeline object`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: JS API for view-timeline-inset<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7748#issuecomment-1306097703<br>
&lt;TabAtkins> flackr: Proposal was to allow insets in the ViewTimelineOptions object as either a string or a pair of CSSNumericValues<br>
&lt;TabAtkins> flackr: But I recalled on other issues there were parsing concerns for things other than idents<br>
&lt;TabAtkins> flackr: So i pinged Tab on this issue<br>
&lt;TabAtkins> flackr: So yes we should add this attr, but should it support strings?<br>
&lt;fantasai> scribe+<br>
&lt;fantasai> TabAtkins: While we aren't 100% consistent, we try to avoid doing CSS parsing on small instances of CSS values<br>
&lt;fantasai> ... in APIs like this<br>
&lt;fantasai> ... because in the rare cases where you need to do an escape, it needs to be double-escaped<br>
&lt;fantasai> ... The general rule for identifiers is that we don't parse stirngs [missed]<br>
&lt;fantasai> ... You can express any string as an ident if it's properly escaped<br>
&lt;fantasai> ... [something else]<br>
&lt;fantasai> ... So I proposed not allowing string-based values here, and just sticking with the TypedOM objects<br>
&lt;fantasai> ... They're easy to work with<br>
&lt;fantasai> flackr: should still allow string for auto<br>
&lt;fantasai> TabAtkins: especially because we need to allow identifiers, we'd need to do string parsing in identifiers<br>
&lt;fantasai> ... if you wanted a name with a weird thing, would need to double-escape<br>
&lt;fantasai> ... would have string just be the literal value of the string<br>
&lt;fantasai> ... which means we can't mix keywords with other values in strings<br>
&lt;Rossen_> ack fantasai<br>
&lt;TabAtkins> fantasai: I think the arg for wanting to allow string-based is that you can pipe getComputedStyle() right back into it<br>
&lt;TabAtkins> fantasai: and just easier to write as a literal "2px" rather than CSS.px(2)<br>
&lt;TabAtkins> fantasai: re ident escaping concerns, there's no custom idents in this API so escapes are never necessary anyway<br>
&lt;Rossen_> q?<br>
&lt;flackr> q+<br>
&lt;TabAtkins> flackr: I'm a little curious - if we want to use typedom objects going forward, is there easy ways to get that?<br>
&lt;fantasai> TabAtkins: There's a TypedOM for computed style<br>
&lt;fantasai> ... not all values have that defined, but for simple things it should work<br>
&lt;fantasai> ... for more complex ones, will just get a string<br>
&lt;TabAtkins> flackr: so maybe that alleviates some simple concerns<br>
&lt;TabAtkins> fantasai: Well what's the computed style of -inset? It's one or two values, so what will we get out of typed om computed style?<br>
&lt;TabAtkins> flackr: this is a new property, we can define it to be what we want for the input<br>
&lt;TabAtkins> fantasai: So what would that be?<br>
&lt;TabAtkins> flackr: A sequence of numeric or identifer values<br>
&lt;Rossen_> ack flackr<br>
&lt;dbaron> https://developer.mozilla.org/en-US/docs/Web/API/CSS_Typed_OM_API#browser_compatibility<br>
&lt;TabAtkins> flackr: So I propose we onlya ccept the typedom representation, and specify the computed typed om for the property to give the same values, to support passthru<br>
&lt;TabAtkins> dbaron: is the API not gonna work right if the impl wants to do this without typed om?<br>
&lt;TabAtkins> dbaron: I ask because typedom is implemented right now in chromium but not gecko or webkit<br>
&lt;TabAtkins> flackr: sounds like it would be an issue<br>
&lt;iank_> I believe webkit has an implemtnation just not shipped yet<br>
&lt;TabAtkins> fantasai: What's the downside of stringbased?<br>
&lt;TabAtkins> fantasai: If we have both you can use whichever is easiest<br>
&lt;ydaniv_> +1 for both<br>
&lt;TabAtkins> TabAtkins: my only concern is impl complexity, and slightly being more consistent about parsing css vs taking strings literally, but i can go either way<br>
&lt;fantasai> Proposed to accept both string and TypedOM 2-value sequence inset within ViewTimeline Options<br>
&lt;TabAtkins> PROPOSED RESOLUTION: Offsets accept either a string or a sequence of typedom values<br>
&lt;fantasai> s/Offsets/Insets/<br>
&lt;TabAtkins> chrishtr: Do we need to specify how the string is parsed?<br>
&lt;TabAtkins> flackr: Matches the CSS property<br>
&lt;TabAtkins> RESOLVED: Insets accept either a string containing CSS, or a sequence of TypedOM values.<br>
&lt;fantasai> Proposed that existing ViewTimeline.startOffset and .endOffset attributes incorporate inset calculations (so that they continue to accurately represent the start/end scroll offsets of the ViewTimeline within the scroll container).<br>
&lt;flackr> +1<br>
&lt;ydaniv_> +1<br>
&lt;bramus> +1<br>
&lt;TabAtkins> RESOLVED: Accept fantasai's proposal for resolution 2<br>
&lt;Rossen_> s/Accept fantasai's proposal for resolution 2/Existing ViewTimeline.startOffset and .endOffset attributes incorporate inset calculations/<br>
&lt;TabAtkins> fantasai: final, do we expose the viewtimelineoptions on the timeline itself? doesn't seem to be use-cases. But we *could* add an inset or startInset/endInset to the timeline if we wanted to.<br>
&lt;flackr> +1 to deferring for now<br>
&lt;fantasai> s/viewtimelineoptions/inset values/<br>
&lt;flackr> (this is resolution 3 from https://github.com/w3c/csswg-drafts/issues/7748#issuecomment-1306097703 )<br>
&lt;TabAtkins> fantasai: not sure if it needs to be done or not, so unless someone thinks it's important we recommend resolving not to do it for now<br>
&lt;TabAtkins> RESOLVED: Defer adding inset properties to the timeline object<br>
</details>


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


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

Received on Wednesday, 23 November 2022 17:26:12 UTC