Re: [css-houdini-drafts] Proposal: Custom functions for modifying CSS values (#857)

> Maybe extend "parameter" to also include dependencies on other declared properties, since that is already supported in the Paint and Layout APIs (although that does introduce circularity issues that need to be addressed).

No, Paint/Layout have the same *styles* regardless of what properties they depend on, you just invoke separate *painters*/*layouters* for each element.  Custom functions would output different styles, tho.

THAT SAID, assuming that custom functions are resolved at variable-resolution time, so they only affect computed values, the entire problem is moot; computed values aren't *nearly* as shareable as specified values. So there's no problem in having them resolve differently based on the element, any more than there's a problem with `em` lengths resolving to different `px` lengths in computed style.

I just checked with @bfgeek on the details of Blink's style system, and he confirms this: while specified styles are heavily shared, computed styles are generally only shared when they're "initial"; as soon as you set a property's value to something else, the element will clone off a new computed style object just for itself. So a custom function won't have a noticeable impact here.

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

Received on Monday, 29 April 2019 19:51:15 UTC