ACTION-226: And glazou Write a proposal

And glazou Write a proposal

State:
closed
Person:
David Baron
Due on:
May 5, 2010
Created on:
April 28, 2010
Associated Product:
Media Queries
Related emails:
No related emails

Related notes:

From http://www.w3.org/2010/04/28-CSS-irc.txt :
16:43:50 <fantasai> Topic: Empty Media Queries
16:44:01 <glazou> http://lists.w3.org/Archives/Public/www-style/2010Apr/0391.html
16:44:39 <fantasai> Sylvain: The one thing was the definitions are in two different places
16:44:56 <fantasai> Sylvain: I understand if we don't want to move backwards to fix that
16:45:32 <fantasai> ChrisL: In the DOM, if you remove an attribute or if it has it's default value, you can tell the difference. Is that the same as here?
16:46:00 <fantasai> Sylvain: The implementations of @media are inconsistent, and it is more inconsistent when you consider the markup side
16:46:40 <fantasai> Sylvain: Right now we have the OM defined somewhere else, not fully defined
16:46:51 <fantasai> Sylvain: And then we have the spec for the static definition of media queries
16:47:04 <fantasai> Sylvain: And because we have different specs, we won't have a full set of testcases
16:47:14 <fantasai> ChrisL: Sounds like you're arguing to merge the two specs
16:47:24 <fantasai> Sylvain: ... interop
16:47:40 <fantasai> ChrisL: There is a problem with testing things between the specs
16:47:57 <fantasai> Sylvain: I think it's worth it, but I'd like to hear what others think. Because right now there is no interop
16:48:00 <ChrisL> ... and thus these two should be combined
16:48:05 <fantasai> Sylvain: The results at the edges are pretty strange
16:48:31 <fantasai> dbaron: We discussed in the past what empty media queries should mean
16:48:55 <fantasai> dbaron: We concluded that empty media queries are equivalent to all, but other specs might not allow empty media queries.
16:49:17 <fantasai> dbaron: So you can't write @media { } and expect that to apply to all media
16:49:23 <ChrisL> why does that spec dissalow an empty media query?
16:49:35 <fantasai> because it wasn't allowed in 2.1
16:50:19 <fantasai> dbaron: The spec has changed over time, and maybe some statements that would clarify have moved around or been lost
16:51:04 <fantasai> Sylvain: For compat with legacy, you have media='' equivalent to all, and then @media { } is invalid, and then deleting mediums from the OM gives you 'not all'
16:51:43 <fantasai> Sylvain: I think I understand what I'm supposed to do for a static style sheet, but I'm not so sure about the OM
16:52:07 <fantasai> glazou: Does that mean we need an extra constraint on the OM saying that the empty media list is invalid for the OM?
16:52:40 <fantasai> Sylvain: I don't think we'll get a perfect model for compat, but, even if the attribute, OM, and style sheet behave differently at least it should be defined somewhere
16:53:03 <fantasai> ChrisL: Why can't @media { } mean all?
16:53:31 <fantasai> dbaron: I think it's perfectly reasonable, but every time we discuss this issue we come to a different conclusion
16:53:53 <fantasai> dbaron: We resolved last August that it should be invalid. I went and implemented that.
16:54:06 <ChrisL> this is why we need to get specs to rec instead of being in permanent churn
16:54:08 <fantasai> dbaron: It's gotten to the point that when the group discusses something and resolves it, I don't consider it permanent
16:54:48 <fantasai> Sylvain: I'm not asking for consistency among OM, attr, and CSS, I just want it clearly defined
16:55:27 <fantasai> glazou: If I have an @media string, and from the OM I want to remove the one media attached to it and replace it with anothe
16:55:55 <ChrisL> i agree with daniel. the intermediate state is all
16:55:58 <fantasai> glazou: It makes sense for the intermediate state to mean all
16:56:21 <ChrisL> that isn't a contradiction. its ok to have something reachable by dom that is not reachable by syntax
16:56:26 <fantasai> glazou: I see the parsing and the OM being independent
16:56:50 <fantasai> dbaron: From an implementation perspective, there's a tricky issue here. Because the way the media query spec defines invalidity
16:57:13 <fantasai> dbaron: An invalid query doesn't invalidate the list of queries, it only invalidates that particular query
16:57:20 <fantasai> dbaron: And invalid queries are treated as false
16:57:58 <fantasai> dbaron: You would need to record that there was some invalid thing that's false, so that when you remove the valid attributes you get false, not all
16:58:37 <fantasai> glazou: If we say that an empty media list attached to the OM is equivalent to 'all' ...
16:58:51 <fantasai> dbaron: The tricky thing is what is an empty media list
16:59:20 <fantasai> dbaron: If you have an invalid media query as part of the media list, you have to keep track of that.
16:59:40 <fantasai> dbaron: We implemented that the media query was not empty, and that's a permanent state: you can't remove everything through the OM
17:00:03 <fantasai> dbaron thinks maybe he needs to write something up with examples
17:00:18 <fantasai> glazou: Does this mean the error-handling rules of media queries make it impossible to handle a few cases
17:00:36 <ChrisL> it sounds like the rules throw up an error state for no good reason
17:00:41 <fantasai> glazou: It seems we may need to revisit the error-handling rules
17:01:12 <fantasai> Sylvain: all is a sensical default for empty media lists
17:01:23 <fantasai> peter: What happens if you then serialize the OM?
17:01:30 <fantasai> Sylvain: Then you serialize as 'all'
17:01:46 <fantasai> Sylvain: It's an edge case, but the spec should say something about it
17:02:00 <fantasai> Sylvain: It would be nice to have it all in the sme place and have a suite of testcases
17:02:28 <fantasai> dbaron: I think there's a relatively straightforward solution wrt error handling, and that's to replace any invalid queries with 'not all'.
17:02:40 <dbaron> print, screen and (nonexistent-query), projection
17:02:42 <dbaron> turns into
17:02:45 <dbaron> print, not all, projection
17:02:51 <dbaron> so that if somebody then does
17:02:59 <dbaron> media.remove("print")
17:03:02 <dbaron> media.remove("projection")
17:03:04 <dbaron> you have 'not all'
17:03:11 <dbaron> rather than an empty query that evaluates to 'all'
17:03:37 <fantasai> Bert: Why wouldn't you just ignore it?
17:04:09 <fantasai> fantasai and glazou try to explain
17:04:20 <fantasai> ACTION: dbaron and glazou Write a proposal
17:04:21 <trackbot> Created ACTION-226 - And glazou Write a proposal [on David Baron - due 2010-05-05].

David Baron, 29 Jun 2010, 20:43:10

The spec has been edited a long time ago, and this is no longer relevant.

Florian Rivoal, 7 May 2012, 15:47:49

Display change log.


Alan Stearns <stearns@adobe.com>, Rossen Atanassov <ratan@microsoft.com>, Chairs, Chris Lilley <chris@w3.org>, Fuqiao Xue <xfq@w3.org>, Staff Contacts
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 226.html,v 1.1 2020/01/17 10:34:19 carcone Exp $