Re: [CSS2.1] syntax: url() and unexpected end of (line / style sheet)

* Zachary Weinberg wrote:
>1) "User agents must close all constructs (nonexhaustive list) at the
>end of the style sheet."  Because URI is a single token rather than a
>grammar production, it is not clear whether it counts as a "construct"
>for this rule.

No, a token cannot be open in this sense (they may be open in the sense
that the next character may also be part of the token, but they cannot
end prematurely, either the text you have matches the production, or it
is not that token). So you parse it like other tokens, in your example

>  <style>#foo { background-image: url("picture.png</style>

close the string, close the ), and have an unknown functional notation.
Or perhaps a known one, that is indeed something that should be defined.

>2) "User agents must close strings upon reaching the end of a line, but
>then drop the construct in which the string was found."  A URI token is
>not a string, even if it uses the quoted form.  Should this rule apply
>anyway, and if so, which forms should it apply to? Consider eg.
>
>  <style>#foo { background-image: url(data:image/png;base64,
>iVBORw0KGgoAAAANSUhEUgAAAAQAAAAEAQAAAACBiqPTAAAADklEQVQI12NI
>YJgAhAkAB4gB4Ry+pcoAAAAASUVORK5CYII=) }</style>

In the quoted form the string is a string and the rule applies. In this
form the thing as a whole does not match the URI production, so this is
not a URI token. So the same as above.

I can't answer your Tangential question 1, but I do note it is usually
best to split independent questions into independent threads (and en-
able automatic line wrapping after ~72 columns in your mail reader).

>Tangential question 2: Is there any |value|, either in CSS2.1 or any
>proposed CSS3 module, whose syntax contains square brackets?  Without
>one I cannot think of a way to test end-of-style-sheet processing for
>open square brackets.

Square bracket blocks are part of "any" in CSS 2.1, which is part of
"value".
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 14 May 2008 16:54:11 UTC