Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed OM (houdini) #163

Closed
jsnkuhn opened this issue Sep 28, 2022 · 3 comments
Closed

Typed OM (houdini) #163

jsnkuhn opened this issue Sep 28, 2022 · 3 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@jsnkuhn
Copy link

jsnkuhn commented Sep 28, 2022

Description

from spec:

Converting CSSOM value strings into meaningfully typed JavaScript representations and back can incur a significant performance overhead. This specification exposes CSS values as typed JavaScript objects, to make manipulating them both easier and more performant.

an explainer article from chrome: https://developer.chrome.com/blog/cssom/

Rationale

Most painAPI demos (like those at houdini.how) accept only unitless values for custom properties. This is because unitless pixel values are what is needed for the JS worklet code. Not accepting normal CSS units like em/rem/% gets around having to parsing strings and convert values into unitless pixel values. This is currenly a pain to do.

TypedOM gives us JS objects instead of stings for CSS values that are much eaiser to work with. Makes it easier to seperate a value from its unit and covert from for example em to px.

I believe this requires registered custom properties so it works together with the Properties and Values API (i.e. @Property)

Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1278697

Specification

https://drafts.css-houdini.org/css-typed-om/

Tests

https://wpt.fyi/results/css/css-typed-om?label=experimental&label=master&aligned&view=subtest

@jsnkuhn jsnkuhn added the focus-area-proposal Focus Area Proposal label Sep 28, 2022
@gsnedders gsnedders added this to the Interop 2023 milestone Sep 29, 2022
@foolip foolip moved this to Proposed in Interop 2023 Oct 7, 2022
@foolip foolip removed this from the Interop 2023 milestone Oct 7, 2022
@andruud
Copy link

andruud commented Oct 31, 2022

We should exclude the parts related to list-valued properties. That concept needs work, since reality is more complicated than "property is either list-valued or not".

@foolip
Copy link
Member

foolip commented Nov 11, 2022

In the MDN short survey on CSS & HTML, "CSS Typed Object Model (computedStyleMap() API)" was selected by ~9% of survey takers, putting it in the bottom third of the 20 options. (There is some uncertainty as with any survey data.)

@nairnandu
Copy link
Contributor

Thank you for proposing Typed OM for inclusion in Interop 2023.

We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. This should not be taken as a comment on the technology as a whole, and resubmitting a proposal for this feature as part of a future round of Interop would be welcome.

For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

5 participants