[css3-mediaqueries] device-* media features are actively harmful

Maybe feedback time for Media Queries is over, but here goes.

The device-* media features in CSS3 Media Queries are actively harmful 
for authors and leak information that has no need to be exposed via CSS.

In a situation I recently encountered, a page developer had written 
special rules for mobile devices.  However, they had written one of them 
testing against max-device-width rather than just max-width.  The 
outcome of this was that the page looked fine in a desktop browser when 
squashing the viewport down to 240px, but had display issues when viewed 
on a mobile device of that width.  This issue took quite a while to 
track down after it was first submitted as a bug on the mobile's browser 
itself by the developer.

I don't think this will be an atypical case if and when media features 
are more widely used.   Copy-and-paste will be used and authors won't 
test adequately, ultimately resulting in quirks for mobile users that 
developers on the lower end of the authoring ladder won't find obvious. 
  (The end result could well be that mobile browsers start reporting 
device-width and width as being the same to work round bad authoring 

Henri Sivonen has also raised the point that pages can use the 
difference between device-width and max-device width to display annoying 
messages to users saying "maximise this window please".  Pages really 
have no business knowing the size of the user's display.

As a result, it would be good if the spec was changed to either remove 
device-*, or define when as equivalent to their non-device-* 
counterparts for backwards-compat.

Andi Sidwell

Received on Wednesday, 26 August 2009 18:53:38 UTC