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: Sat, 24 Aug 2013 02:01:38 +0200
Message-ID: <DUB120-W34FE9B8C6C7D8F36C7F72BA54F0@phx.gbl>
To: Sylvain Galineau <galineau@adobe.com>, Simon Pieters <simonp@opera.com>, "www-style@w3.org" <www-style@w3.org>
> If it's so obviously useful and undebatable then why isn't it already
> there? Especially if, as you noted, browsers already have the info
> internally and the cost is minimal? Something here is not adding up. When
> reality contradicts theory it is usually wiser to question the theory...

My theory is that unlike browsers that use a CSSStyleAttrDelcation, a CSSComputedStyleDeclaration & a CSSStyleRuleDeclaration interfaces, the initial authors of the CSSOM reused one single class that was specifically crafted for the latter (hence parentRule) and therefore missed the parentElement/isReadonly/... stuff because they didn't make sense in the context where the interface had been defined in first place, and nobody revisited the interface after that.

Technically, this is the whole interface hierarchy that should be split in sub-classes to match the actual browser implementation, but this is actually some non-negligeable work and I therefore asked to solved the issue within the current limits of the API instead of trying to rework it.

I wouldn't mind a deeper refactoring, I just don't ask for it. 		 	   		  
Received on Saturday, 24 August 2013 00:02:05 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:31 UTC