Re: [CSS] Extending media queries

Le mercredi 18 février 2009, Brad Kemper a écrit :
> On Feb 17, 2009, at 3:57 PM, Germain Garand <germain@ebooksfrance.org>
>
> wrote:
> > Le mardi 17 février 2009, François REMY a écrit :
> >> How can I do to know if the browser that read my page support box-
> >> shadow ?
> >>
> >> With my proposal, it's simple :
> >> @media (implements: box-shadow) { ... }
> >> @media !(implements: box-shadow) and (implements: border-image)
> >> { ...}
> >
> > Remember that media queries are about describing the output device,
> > not about
> > the user agent.
>
> The user agent is typically part of the software, but the software is
> part of the device.

Of course I meant User Agent in the restricted sense of "an implementation of 
CSS" - regardless of the output device, since here the question was clearly 
about the features of the engine. I could have used 'CSS engine' to eliminate 
this ambiguity.

The output device is fully extrinsic, by definition, to the CSS engine, no 
matter if the former is software or hardware.

It is even the point of Media Queries to make CSS somewhat aware of the 
constraints of this extrinsic system. 

> Take 'color' for instance. Most monitors support 
> millions of colors these days, but it is the OS control panel (e.g. on
> Windows or Mac) that determines if the UA will report millions or 256.

a CSS engine does not report anything - but I think you got my point now.

> Besides that, features like 'width' are determined almost entirely by
> the software under user control, and can be greater than the device
> width.
>
> > But anyway, like all User Agent detection schemes, it will be abused
> > to
> > provide selective support, undermining CSS's graceful fallback on a
> > global
> > scale:
> >
> > @agent (implements: -ozm-proprietary-property) { @import ... }
> > @agent (implements: -bzo-proprietary-property) { @import ... }
> > /* sorry, you are out of luck, welcome to the wonders of unstyled
> > content */
>
> I'm sorry, but you can do exactly the same sort of thing with media
> queries as is. For instance, you can have '@media screen and (max-
> width:700) {...}' and watch as all your styling disapears when the
> window is stretched to over 700 pixels wide.
>

that query won't target a specific User Agent. 
Any user agent supporting Media Queries will behave the same, given the same 
output device.

Whereas testing for CSS features *implementation* would let content writers 
trivially single out some UAs as a whole based e.g. on CSS vendor prefixes, 
as in my example.

This is very bad.

Greetings,
Germain

Received on Wednesday, 18 February 2009 15:39:53 UTC