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

On Wed, 27 Jun 2012 17:10:20 -0400, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

> 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?

Was any progress ever made with this?

I agree it seems wrong to me to jam the descriptors for @font-face into a
CSSStyleDeclaration, not in the least because the values behave differently
to CSS properties - different syntax, different set of allowed values -
especially important for descriptors that share names with CSS properties.

Separating out the CSS properties into a new interface makes sense to me.  I
don't like the idea of making a CSSFontFaceStyleDeclaration inherit from
CSSStyleDeclaration unless the CSS properties are separated out too - it
just looks confusing and wrong to merge everything together.

As for @page, how can its CSSStyleDeclaration object represent the nested
at-rules at all?  Is the order of declarations and at-rules important?  i.e.
does the CSSOM have to preserve the order or can it get away with just
keeping the at-rules in a separate list from the property declarations?  If
the latter, then it could continue to use CSSStyleDeclaration for the CSS
properties and gain a new "readonly attribute CSSRuleList cssRules" as well
and creating a new rule type CSSPageMarginRule type to represent all the
margin rules?


-- 
Stewart Brodie
Team Leader - ANT Galio Browser
ANT Software Limited

Received on Tuesday, 21 August 2012 13:47:47 UTC