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

RE: [css-om] CSSStyleDeclaration.parentElement

From: François REMY <francois.remy.dev@outlook.com>
Date: Thu, 22 Aug 2013 19:57:34 +0200
Message-ID: <DUB120-W414E05624BC22C0C47CA8AA54D0@phx.gbl>
To: Simon Pieters <simonp@opera.com>, "www-style@w3.org" <www-style@w3.org>
>>> So this property would point to the element for element.style
>>> but be null for cssrule.style et al?
>> Yes. So that either parentElement or parentRule have a non-null value.
>>> I'm having a bit of difficulty reasoning around your use case since it's
>>> about polyfilling. For instance, getting flow-from implemented in
>>> browsers
>>> would remove the need for parentElement in your case.

The use case of a polyfill is /by definition/ suppressed by a browser implementation. That doesn't make it worthless by any amount, especially when we talk about a feature that benefits all css polyfills, not just one in particular.

>> (1) there will always be a need to polyfill something on the web
>> platform, and more generally to expose new functions to the style
>> elements.
> Yeah. But it's not a very compelling use case that is being presented, in
> my opinion.

I respect your opinion, but I have an hard time understanding that enabling to provide a javascript implementation of css properties may seem an uncompelling use case to any web developer.

>> (2) the whole point of the css object model is... to expose the css
>> object model. why exposing parentRule but not parentElement? it doesn't
>> really make sense to me.
>> (3) beside polyfilling use-cases, what could you use the "parentRule"
>> property for? did that prevent this property from existing?
> I don't know what the use case is for parentRule. There's also
> http://dev.w3.org/csswg/cssom/#dom-stylesheet-ownernode . But that's by
> itself is not a good reason to add something else like it. New features
> need to justify themselves on their own merit.

The merit of an Object Model feature is to expose the object model. What you can do this object model is exactly what the browser can do. If browsers need some information, there's no reason to believe this information could not be useful to someone else. 

I'm not asking browser vendors to ship some new features, just to expose some information they already have access to.

> * other developers working around the lack of this feature.

Other developers didn't make CSS Polyfill until now because the CSS Object Model is lacking in too many ways. To the contrary, extensions to JavaScript or HTML primitives are numerous. My belief is that this is going to change in the future, and I believe that specs being worked out now would better integrate the needs of polyfilling, especially when fulfilling those needs comes almost for free.

For now all the use cases I've seen extend to CSSStyleDeclaration to rempart prefixed properties to unprefixed ones, possibly with slight syntax updates. That doesn't require a reference to the element (though some would have benefited of it instead of making approximations). 		 	   		  
Received on Thursday, 22 August 2013 17:58:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC