[css-style-attr] Parse at-rules in declarations lists, like @page.

Fri, 11 Oct 2013 01:20:50 +0100

author
Simon Sapin <simon.sapin@exyr.org>
date
Fri, 11 Oct 2013 01:20:50 +0100
changeset 9380
b7f4434af876
parent 9379
3ebe8c1e42cf
child 9381
7d390fd1e414

[css-style-attr] Parse at-rules in declarations lists, like @page.

(No such at-rule is defined yet, this is only for error handling purpose.)

Working Group resolution:
http://lists.w3.org/Archives/Public/www-style/2013May/0783.html

css-style-attr/Overview.html file | annotate | diff | comparison | revisions
css-style-attr/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/css-style-attr/Overview.html	Fri Oct 11 01:19:13 2013 +0100
     1.2 +++ b/css-style-attr/Overview.html	Fri Oct 11 01:20:50 2013 +0100
     1.3 @@ -235,9 +235,11 @@
     1.4     <li><a href="#interpret"><span class=secno>4. </span>Cascading and
     1.5      Interpretation</a>
     1.6  
     1.7 -   <li><a href="#ack"><span class=secno>5. </span>Acknowledgments</a>
     1.8 +   <li><a href="#changes"><span class=secno>5. </span>Changes</a>
     1.9  
    1.10 -   <li><a href="#references"><span class=secno>6. </span>References </a>
    1.11 +   <li><a href="#ack"><span class=secno>6. </span>Acknowledgments</a>
    1.12 +
    1.13 +   <li><a href="#references"><span class=secno>7. </span>References </a>
    1.14      <ul class=toc>
    1.15       <li class=no-num><a href="#normative-references">Normative
    1.16        references</a>
    1.17 @@ -325,8 +327,14 @@
    1.18  
    1.19    <pre>
    1.20  declaration-list
    1.21 -  : S* declaration? [ ';' S* declaration? ]*
    1.22 +  : S* declaration-list-next
    1.23    ;
    1.24 +
    1.25 +declaration-list-next
    1.26 +    : declaration [ ';' S* declaration-list-next ]?
    1.27 +    | at-rule declaration-list-next
    1.28 +    | /* empty */
    1.29 +    ;
    1.30  </pre>
    1.31  
    1.32    <p class=note>Note that following the CSS2.1 convention, comment tokens are
    1.33 @@ -334,16 +342,30 @@
    1.34  
    1.35    <p>The interpreter must parse the style attribute's value using the same
    1.36     forward-compatible parsing rules that apply to parsing declaration block
    1.37 -   contents in a normal CSS style sheet. See <a
    1.38 +   contents in a normal CSS style sheet (see <a
    1.39     href="http://www.w3.org/TR/CSS21/syndata.html">chapter 4 of the CSS2.1
    1.40 -   specification</a> for details. <a href="#CSS21"
    1.41 -   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
    1.42 +   specification</a> <a href="#CSS21"
    1.43 +   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>), with the following
    1.44 +   addition: when the UA expects the start of a declaration or at-rule (i.e.,
    1.45 +   an IDENT token or an ATKEYWORD token) but finds an unexpected token
    1.46 +   instead, that token is considered to be the first token of a malformed
    1.47 +   declaration. I.e., the rule for malformed declarations, rather than
    1.48 +   malformed statements, is used to determine which tokens to ignore in that
    1.49 +   case.
    1.50  
    1.51    <p class=note>Note that because there is no open brace delimiting the
    1.52     declaration list in the CSS style attribute syntax, a close brace
    1.53     (<code>}</code>) in the style attribute's value does not terminate the
    1.54     style data: it is merely an invalid token.
    1.55  
    1.56 +  <div class=note>
    1.57 +   <p>Although the grammar allows it, no at-rule valid in style attributes is
    1.58 +    define at the moment. The forward-compatible parsing rules are such that
    1.59 +    a declaration following an at-rule is not ignored:
    1.60 +
    1.61 +   <pre>&lt;span style="@unsupported { splines: reticulating } color: green"></pre>
    1.62 +  </div>
    1.63 +
    1.64    <h2 id=interpret><span class=secno>4. </span>Cascading and Interpretation</h2>
    1.65  
    1.66    <p>The declarations in a style attribute apply to the element to which the
    1.67 @@ -367,7 +389,17 @@
    1.68     independently and treated as a separate style rule, the ordering of which
    1.69     should be defined by the document language, else is undefined.
    1.70  
    1.71 -  <h2 id=ack><span class=secno>5. </span>Acknowledgments</h2>
    1.72 +  <h2 id=changes><span class=secno>5. </span>Changes</h2>
    1.73 +
    1.74 +  <p>Changes since the <a
    1.75 +   href="http://www.w3.org/TR/2013/PR-css-style-attr-20131003/">2013-10-03
    1.76 +   Proposed Recommendation</a> are:
    1.77 +
    1.78 +  <ul>
    1.79 +   <li>Parse at-rules in declaration lists to allow future extension.
    1.80 +  </ul>
    1.81 +
    1.82 +  <h2 id=ack><span class=secno>6. </span>Acknowledgments</h2>
    1.83  
    1.84    <p>Thanks to feedback from <span class=vcard><span class=fn>Daniel
    1.85     Glazman</span></span>, <span class=vcard><span class=fn>Ian
    1.86 @@ -376,7 +408,7 @@
    1.87     class=family-name>Meyer</span></span></span>, <span class=vcard><span
    1.88     class=fn>Björn Höhrmann</span></span>.
    1.89  
    1.90 -  <h2 id=references><span class=secno>6. </span>References</h2>
    1.91 +  <h2 id=references><span class=secno>7. </span>References</h2>
    1.92  
    1.93    <h3 class=no-num id=normative-references>Normative references</h3>
    1.94    <!--begin-normative-->
     2.1 --- a/css-style-attr/Overview.src.html	Fri Oct 11 01:19:13 2013 +0100
     2.2 +++ b/css-style-attr/Overview.src.html	Fri Oct 11 01:20:50 2013 +0100
     2.3 @@ -211,8 +211,14 @@
     2.4  
     2.5  <pre>
     2.6  declaration-list
     2.7 -  : S* declaration? [ ';' S* declaration? ]*
     2.8 +  : S* declaration-list-next
     2.9    ;
    2.10 +
    2.11 +declaration-list-next
    2.12 +    : declaration [ ';' S* declaration-list-next ]?
    2.13 +    | at-rule declaration-list-next
    2.14 +    | /* empty */
    2.15 +    ;
    2.16  </pre>
    2.17  
    2.18  <p class="note">Note that following the CSS2.1 convention, comment tokens
    2.19 @@ -220,15 +226,28 @@
    2.20  
    2.21  <p>The interpreter must parse the style attribute's value using the
    2.22  same forward-compatible parsing rules that apply to parsing declaration block
    2.23 -contents in a normal CSS style sheet. See
    2.24 +contents in a normal CSS style sheet (see
    2.25  <a href="http://www.w3.org/TR/CSS21/syndata.html">chapter 4 of the CSS2.1
    2.26 -specification</a> for details. [[!CSS21]]
    2.27 +specification</a> [[!CSS21]]),
    2.28 +with the following addition: when the UA expects the start of a declaration or at-rule
    2.29 +(i.e., an IDENT token or an ATKEYWORD token) but finds an unexpected token instead,
    2.30 +that token is considered to be the first token of a malformed declaration.
    2.31 +I.e., the rule for malformed declarations, rather than malformed statements,
    2.32 +is used to determine which tokens to ignore in that case.
    2.33  
    2.34  <p class="note">Note that because there is no open brace delimiting the
    2.35  declaration list in the CSS style attribute syntax, a close brace
    2.36  (<code>}</code>) in the style attribute's value does not terminate the
    2.37  style data: it is merely an invalid token.</p>
    2.38  
    2.39 +<div class="note">
    2.40 +<p>Although the grammar allows it,
    2.41 +no at-rule valid in style attributes is define at the moment.
    2.42 +The forward-compatible parsing rules are such that a declaration following an at-rule
    2.43 +is not ignored:
    2.44 +<pre>&lt;span style="@unsupported { splines: reticulating } color: green"></pre>
    2.45 +</div>
    2.46 +
    2.47  <h2 id="interpret">Cascading and Interpretation</h2>
    2.48  
    2.49  <p>The declarations in a style attribute apply to the element to which
    2.50 @@ -250,6 +269,14 @@
    2.51  independently and treated as a separate style rule, the ordering of which
    2.52  should be defined by the document language, else is undefined.
    2.53  
    2.54 +<h2 id="changes">Changes</h2>
    2.55 +
    2.56 +Changes since the <a href="http://www.w3.org/TR/2013/PR-css-style-attr-20131003/">2013-10-03 Proposed Recommendation</a> are:
    2.57 +
    2.58 +<ul>
    2.59 +  <li>Parse at-rules in declaration lists to allow future extension.
    2.60 +</ul>
    2.61 +
    2.62  <h2 id="ack">Acknowledgments</h2>
    2.63  
    2.64  <p>Thanks to feedback from <span class="vcard"><span class="fn">Daniel Glazman</span></span>, <span class="vcard"><span class="fn">Ian Hickson</span></span>, <span class="vcard"><span class="fn n"><span class="given-name">Eric</span> <abbr class="additional-name">A.</abbr> <span class="family-name">Meyer</span></span></span>,

mercurial