Re: [cssom] serialization order of components of shorthand properties

On Tue, Jul 17, 2012 at 12:50 PM, L. David Baron <dbaron@dbaron.org> wrote:

> On Tuesday 2012-07-17 12:42 -0600, Glenn Adams wrote:
> > On Tue, Jul 17, 2012 at 11:47 AM, L. David Baron <dbaron@dbaron.org>
> wrote:
> >
> > > It would be great to get an updating reflecting the last paragraph
> > > of http://lists.w3.org/Archives/Public/www-style/2012May/1208.html
> > > sooner rather than later, before it does harm by causing
> > > implementations to change interoperable behavior.
> > >
> > > In particular, this affects the second bullet of
> > > http://dev.w3.org/csswg/cssom/#serializing-css-values , which
> > > currently says:
> > >   # Where multiple CSS component values can appear in any order
> > >   # without changing the meaning of the value (typically represented
> > >   # by a double bar || in the value syntax), use the order as given
> > >   # in the syntax.
> >
> >
> > So, David, what is your position on the following?
> >
> > (1) should a canonical order be defined for serializing components of
> > shorthand properties when returning values for those properties from
> > CSSStyleDeclaration.getPropertyValue(propertyName)? as you point out
> DOM-2
> > Style APIs did not define such an order, however the current CSSOM [1] ED
> > does define an order (in terms of the syntactic order of the specific
> > property's definition).
>
> It should be defined.
>
> > [1]
> >
> http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom/Overview.html#serializing-css-values
> >
> > (2) if the answer to (1) is yes, then which syntactic definition should
> > apply in the face of (historical) discrepancies? e.g., the order of
> > components of 'background' shorthand vary between CSS2.1 [2] and CSS3
> > Backgrounds and Borders [3].
>
> That's only an issue if cssom suggests using the "Value" line, which
> is what I'm saying that it should not do.
>
> This is because it shouldn't be defined in a way that's incompatible
> with existing implementations.  This means that before we make a
> definition of the canonical serialization order for each property,
> we should research what existing implementations do, so that we
> don't encourage implementations to change in cases where they're
> currently all interoperable.
>
> That's why I think the property templates should define a "Canonical
> order" line, and cssom should not suggest inferring one from the
> "Value" line.


OK, the above all sounds reasonable. However, from a practical perspective,
we would need to do one of the following:

(1) go back and add such "Canonical Order" lines to the CSS2.1 spec (via
errata);
(2) define a new spec which does only this, i.e., define Canonical Ordering
for each property; or
(3) include such normative definitions in CSSOM itself;

Which would you suggest?

Received on Tuesday, 17 July 2012 19:09:42 UTC