Re: [cssom] Identifying types and shorthand and unsupported properties



On 7/12/13 9:17 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

<snip>
>> As a polyfill author I want to know about unsupported properties. Tab
>> made the argument that you could use custom var- properties for that,
>> but that would require the CSS author to provide (unnecessary)
>> duplicate definition. I wouldn't want this exposed as a regular
>> property, rather accessible through a separate list from
>> CSSStyleDeclaration. (We will always be "fixing" stuff for older
>> browsers)
>
>This just isn't going to happen, sorry.  For one thing, it's
>inefficient - browsers store properties in a tightly packed binary
>format, where as much as possible they don't remember the exact text
>you put in, but rather map the names and values into small integers or
>even individual bits.

It's already happened in IE for many, many years. Unknown properties are
added to the style object as an expando. So if you have:

#something {
 foo: bar;
}

…then document.getElementById('something').style.foo returns "bar". It's
definitely super handy to polyfill or prototype something. As far as I know
the costs incurred on a page that doesn't use it are too low to matter.
And when used I doubt it's anywhere near as bad as the way devs do it today
using jQuery to select elements and set custom properties on them. It's
also
simpler to use and implement than Variables.

The namespace issue is of course valid; as soon as browsers start
using your name your extension value gets dropped on the floor. Or
worse, your value remains valid and you'll have a surprise. This doesn't
seem a big issues though; the browser has full control and could force
all such properties into a specific namespace or sub-property.

Agree there is enough overlap with Variables at this point that I wouldn't
go there until we know why that wouldn't work. But so much JS code selects
elements to set a property on them the scenario is generally valid; and
 even though it's very hand it does feel weird to use static CSS to set
properties that are only useful to JS code.

>

Received on Saturday, 13 July 2013 18:40:20 UTC