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

± >> 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. [it's a waste of memory]

Using custom properties to the same use case would use the same amount of memory, FWIW, and certainly more processing power due to inheritance and stuff. I'm to use a variable for backwards polyfilling purposes, it's very likely I'll add * { property: var(property); var-property: var(undefined); } in my stylesheet...

± 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') returns "bar".

I'm not 100% sure about that one. I know for sure that if you do <el style="foo: bar"> in IE, that works, and also that you can access the value at the CSSDeclaration level if it's in a stylesheet, but I don’t think the cascade enter in action at any point for those expandos. We may want to double-check that.

It could be possible to instruct the browser to keep some properties even if he does not understand them, as an opt-in:

    @polyfill background-3d-distance { 
        cascade: true; 
        inherit: false; 
        initial: 0px 

That would however only work at a style-sheet level (if you have multiple stylesheets, you need to specify this in each one of them, before any declaration).


Received on Sunday, 14 July 2013 03:07:11 UTC