RE: [css-om] CSSStyleDeclaration.parentElement

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

Webkit:

  https://github.com/WebKit/webkit/blob/7b607cc39c67ddb2856e4618b42327f2982d3d15/Source/WebCore/css/CSSComputedStyleDeclaration.h#L68


Gecko:

  http://hg.mozilla.org/mozilla-central/file/edf8075b0333/layout/style/nsDOMCSSAttrDeclaration.h#l84


The only question that remains is what do you do for Pseudo-Elements. I quite remember there were discussions for exposing pseudo-elements has something really simple having a few "style" properties but it seems marked as At-Risk in the current spec (http://dev.w3.org/csswg/cssom/#the-pseudoelement-interface).

By the way, if I can make some suggestion, we should probably expose both "parentNode"/"parentElement" properties on a pseudo-element, as well as a "tagName"/"nodeName" whose value would be "::before" or "::after". Otherwise, you've no idea which pseudo-element you work with if you get a reference to one. 		 	   		  

Received on Friday, 23 August 2013 17:52:24 UTC