[cssom] .style on CSSFontFaceRule and CSSPageRule should probably not be CSSStyleDeclarations as that interface is currently defined

Right now CSSStyleDeclaration seems to be a merge of the old 
CSS2Properties interface and the old CSSStyleDeclaration interface.

That causes problems for the .style of CSSFontFaceRule and CSSPageRule, 
because most of those property names don't actually apply to those 
(which means it's not clear what the behavior should be on setting), 
whereas at least CSSFontFaceRule has descriptor names (e.g. "src") that 
are not reflected in the list at all.

I haven't looked at @page in detail yet, but it's not at all clear to me 
that the set of font descriptors is well represented by even the old 
CSSStyleDeclaration interface (e.g. the whole priority thing makes no 
sense for it).  But if we posit that it is, I believe it would make more 
sense to go to a setup where the CSSStyleDeclaration interface only has 
length/item/getPropertyValue/setProperty/removeProperty/parentRule 
properties, and maybe getPropertyPriority.  We should move the rest of 
the per-property getters/setters to a separate interface that inherits 
from CSSStyleDeclaration (CSS2Properties might in fact be an OK name for 
it, but I don't care that much about the name) and come up with a 
different interface (CSSFontFaceDesciptors?) that also inherits from 
CSSStyleDeclaration and is implemented by the .style of a CSSFontFaceRule.

And as long as we're here, should CSSFontFaceRule really have a .style, 
or should it have a .descriptors?

-Boris

Received on Wednesday, 27 June 2012 21:10:49 UTC