W3C home > Mailing lists > Public > www-style@w3.org > February 2000

Re: is this legal css?

From: Matthew Brealey <thelawnet@yahoo.com>
Date: Wed, 9 Feb 2000 05:29:48 -0800 (PST)
Message-ID: <20000209132948.24974.qmail@web901.mail.yahoo.com>
To: www-style <www-style@w3.org>
> Is this legal CSS2?:
> 
> @media print 
> {
> 	@page         
> 	{ 
> 		margin: 10% 
> 	}
> }
> 
> 
> If so, can someone point to the relevant part of the recc, since I can't
> divine it out of the grammar.

Here's the media production definition:

<blockquote cite="http://www.w3.org/TR/REC-CSS2/grammar.html">
media
  : MEDIA_SYM S* medium [ ',' S* medium ]* '{' S* ruleset* '}' S*
  ;
</blockquote>

Between the {} all there is is S* and ruleset.

Ruleset (
ruleset
  : selector [ ',' S* selector ]*
    '{' S* declaration [ ';' S* declaration ]* '}' S*
  ;
) 
does not include page (as evinced by
stylesheet
  : [ CHARSET_SYM S* STRING S* ';' ]?
    [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
    [ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]*
  ;
).

OTOH, there's this non-normative example in the sample style sheet:

<blockquote cite="http://www.w3.org/TR/REC-CSS2/sample.html">
@media print {
  @page         { margin: 10% }
  H1, H2, H3,
  H4, H5, H6    { page-break-after: avoid; page-break-inside: avoid }
  BLOCKQUOTE, 
  PRE           { page-break-inside: avoid }
  UL, OL, DL    { page-break-before: avoid }
</blockquote> 

This is prima facie invalid, but I actually think it is the grammar that
is in error (perhaps not in error but at least misdefined), since the
following is currently prohibited:
@media projection {
  @page {margin: x}
}
@media print {
  @page {margin: y}
}
, which is clearly absurd.
Therefore in CSS 3, media must be changed to:
media
  : MEDIA_SYM S* medium [ ',' S* medium ]* '{' S* [page|ruleset]* '}' S*
  ;


=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
Received on Wednesday, 9 February 2000 08:29:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:03 GMT