Re: [css-background] Order of properties in background shorthand

> > I will try to explain the IE6 issue with an example.
> >
> > Assuming that we have a CSS3 UA and it generates the background
> > shorthand property in getComputedStyle in the following order
> > red border-box url(dummy://test.png) 50% 50% / cover.
> >
> > And assuming that the server feeds this generated result from CSS3
> > Browser to a CSS2.1 compatible browser like IE6. IE6 fails to parse 
> > even those properties which it supports in background shorthand.
> > In the above case, IE6 parses only background-color correctly as it
> > comes before newly introduced properties. IE6 stops parsing whenever 
> > it encounters an unsupported property-value like border-box in the 
> > above case.
> >
> > At the same time, if we restrict the order of background shorthand
> > properties generated by a CSS3 UA in such a way that CSS2.1 properties
> > comes before the newly introduced properties in CSS3, then IE6 parses 
> > all the CSS2.1 properties correctly and discards the new properties 
> > which are at the end.
> >
> > So if we change the above order to "red url(dummy://test.png) 50% 50% 
> > / cover border-box", IE6 parses bg-color, bg-image and bg-position
> > correctly and discards the rest. So with this new order, IE6 can 
> > parse atleast all the properties it supports.
> >
> > Please let me know whether that make sense.
> 
> So you're saying that you're serializing property values in one
> browser, sending them to the server, and later using them to style
> other pages in another browser?
> 
> That seems pretty odd, if so.  Can you clarify?
> 
> If IE6 actually does treat that declaration as valid, and just ignores
> everything from the first thing it doesn't recognize, that's *really*
> incorrect behavior.  No compliant browser does that - the specs very
> clearly state that you should throw away the whole declaration,
> *precisely* because of this kind of bad behavior.
> 
> Anyway, the correct solution, if you are indeed doing the weird thing
> there, is to parse it yourself and serve only the parts that IE6
> actually understands.

FWIW, there's also a Mozilla issue about this:

https://bugzilla.mozilla.org/show_bug.cgi?id=743392

This was requested because somebody was asking for the "right" order to be displayed in Firebug:

http://code.google.com/p/fbug/issues/detail?id=4180

So what I get out of this discussion is that the order, in which a browser returns the properties of a shorthand property via getComputedStyle(), is not dictated. Is that correct?
If so, why isn't the spec at least putting the order of the pre-CSS3 properties back as it was to avoid confusion?

Sebastian
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Received on Friday, 1 June 2012 06:34:04 UTC