W3C home > Mailing lists > Public > www-style@w3.org > August 2013

Re: [cssom-values] Possibility of patching existing CSS strings into Values objects?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 8 Aug 2013 18:33:44 -0700
Message-ID: <CAAWBYDBq06JbhfcZQrk2Y9JZpo30_i=+vUw6PhTfp-=GsoSNBQ@mail.gmail.com>
To: François REMY <francois.remy.dev@outlook.com>
Cc: www-style list <www-style@w3.org>
On Thu, Aug 8, 2013 at 6:17 PM, François REMY
<francois.remy.dev@outlook.com> wrote:
> ± You'd do "rectElement.values.x.px = 5", etc.  This might work well, and it has
> ± the benefit of being consistent between the two APIs.  We could even push
> ± this into plain HTML eventually as well.
>
> The downside being that if doesn't propagate directly to other constructions like "getComputedStyle()", "getSpecifiedStyle()/currentStyle" or even "getOverrideStyle()/runtimeStyle".

Why wouldn't it?  Those just return CSSStyleDeclaration objects, so
they'd all get .values properties too.

> If I can bikeshed this even more, I would introduce the "om" property (for object model) on the CSSStyleDeclaration interface (for CSS properties) and on SVGElement (for SVG attributes).
>
>         rectElement.om.x.px = 5
>
>         if(getComputedStyle(rectElement).om.fontSize.pct != 1.0) {
>                 // font-size has changed since parent element
>         }
>
> Thoughts?

It's shorter, but also less clear.

~TJ
Received on Friday, 9 August 2013 01:34:30 UTC

This archive was generated by hypermail 2.3.1 : Friday, 9 August 2013 01:34:31 UTC