- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Mon, 5 Dec 2011 10:37:58 -0800
- To: Brian Manthos <brianman@microsoft.com>
- Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
On Mon, Dec 5, 2011 at 9:15 AM, Brian Manthos <brianman@microsoft.com> wrote: > As per discussion with Tab -- I recommend the Editors start getting in the habit of "horizontal then vertical" when <position> is involved, because of the quirks in its grammar related to ordering. As such... > > 1a. radial-gradient(15px at right bottom, red, blue); > 1b. radial-gradient(at right bottom 15px, red, blue); > > 2a. radial-gradient(15px at right, red, blue); > 2b. radial-gradient(at right 15px, red, blue); > > 3a. radial-gradient(15px at 2px, red, blue); > 3b. radial-gradient(at 2px 15px, red, blue); > > For 1b/2b/3b, it's unclear whether 15px belongs to the <position> or not. The spec would need to clarify, using language like the 09/08 WD: > # If ... it could be interpreted as either a position or an explicit size ..., it must be interpreted as a position. I prefer not having an ambiguous situation to begin with. I was always unhappy that I had to have that line in the old grammar. > Getting back to your conclusion ... >> We can't ... Now that we've dropped the 'to', the parsing of >> <position> is ambiguous if it's allowed to be followed by <size> > > The unstated assumption is that the removal of "to" is more valuable than reordering support. I disagree with that assumption. > > Either reordering is the primary concern or removing "to" is. If reordering is primary, then keeping "to" (or another keyword if we could find agreement on one) is preferred so that full reordering is supported. If removing the "to" is primary, then we should dump reordering entirely. Our primary concern is creating a grammar that is maximally usable for authors while matching CSS style as much as possible, and also being extensible. Based on our own reasoning and the feedback from authors, the current grammar does that. > The current grammar characteristic of "you can reorder some of it for what seems like arbitrary reasons because it's not documented" has both bad properties: -1- confuse authors and -2- an overly complicated parser. > > > Further, one of the concerns with the prior grammar was that you could do... > radial-gradient(...<position>...<size>, ...) > but you could not do > radial-gradient(...<size>...<position>, ...) > > The new grammar introduces the opposite concern. I don't see that as progress. It seems like the "size goes first" faction "won" (for undocumented reasons) rather than that the original problem (reordering) was addressed. No, that was never a concern, in either the WD grammar or the Nov ED grammar. In the WD grammar, the concern was twofold: certain types of <size>s were ambiguous with <position>, so you couldn't specify them without a <position>; and having two otherwise-undifferentiated arguments with nearly identical grammars (and a planned third argument with the same) was difficult to read even if it was unambiguous from a grammar perspective. In the Nov ED grammar there was no concern, but author feedback suggested that the use of "to <size>" was confusing. I'm baffled by your claim that there is a "size goes first" faction. > I'm still curious to here the rationale for killing this reordering support, as it haven't found anywhere where that discussion was documented: > http://dev.w3.org/cvsweb/csswg/css3-images/Overview.src.html.diff?r1=1.230;r2=1.231;f=h > > The reordering *was* supported before the "rushed edit and publish" at the last TelCon. This was explained both in the telcon (the minutes for which have been published) *and* in the private email fantasai sent to you (and I pinged you about). The blog comments were inconclusive with regards to the overall decision of "commas or keywords", but there was a fairly persistent theme that the "to" keyword was confusing, and people liked having the size and shape together like the old grammar had. Thus, the simplest and most reasonable solution is to do exactly that - put the size and shape together. The shape previously was restricted to always come first, even though it wasn't strictly ambiguous from a grammar perspective, because it was easier to read that way. So, we've kept that restriction. > Again, another valuable reason for doing the grammar change in the first place was so that the grammar is extensible in the future. It's clear that the removal of "to" has already hampered reordering support in the grammar of today, and thus will likely present extensibility problems in the future. Can you elaborate on what extensibility problems you see? As far as we can tell, it still works perfectly fine for the extensions that we plan in Images 4. Unless you have a concrete example of problems, I don't think we should attempt to adjust the grammar any further. ~TJ
Received on Monday, 5 December 2011 18:38:50 UTC