Navigation Menu

Skip to content

Commit

Permalink
[c] (1) Nail down <style scoped> content model rules. If anyone has a…
Browse files Browse the repository at this point in the history
… better idea of how to do this, let me know.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14016

git-svn-id: http://svn.whatwg.org/webapps@6642 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 5, 2011
1 parent 1604052 commit 67c54f1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
18 changes: 14 additions & 4 deletions complete.html
Expand Up @@ -14886,7 +14886,7 @@ <h4 id=the-style-element><span class=secno>4.2.6 </span>The <dfn><code>style</co
<dt>Contexts in which this element can be used:</dt>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is absent: where <a href=#metadata-content>metadata content</a> is expected.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is absent: in a <code><a href=#the-noscript-element>noscript</a></code> element that is a child of a <code><a href=#the-head-element>head</a></code> element.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present: where <a href=#flow-content>flow content</a> is expected, but before any other <a href=#flow-content>flow content</a> other than other <code><a href=#the-style-element>style</a></code> elements and <a href=#inter-element-whitespace>inter-element whitespace</a>.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present: where <a href=#flow-content>flow content</a> is expected, but before any other <a href=#flow-content>flow content</a> other than <a href=#inter-element-whitespace>inter-element whitespace</a>, and not as the child of an element whose content model is <a href=#transparent>transparent</a>.</dd>
<dt>Content model:</dt>
<dd>Depends on the value of the <code title=attr-style-type><a href=#attr-style-type>type</a></code> attribute, but must match requirements described in prose below.</dd>
<dt>Content attributes:</dt>
Expand Down Expand Up @@ -14954,9 +14954,19 @@ <h4 id=the-style-element><span class=secno>4.2.6 </span>The <dfn><code>style</co
attribute is a <a href=#boolean-attribute>boolean attribute</a>. If present, it
indicates that the styles are intended just for the subtree rooted
at the <code><a href=#the-style-element>style</a></code> element's parent element, as opposed to
the whole <code><a href=#document>Document</a></code>. If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present, the
<code><a href=#the-style-element>style</a></code> element must be the first element of <a href=#flow-content>flow
content</a> in its parent element, if any.</p>
the whole <code><a href=#document>Document</a></code>.</p>

<p>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is
present and the element has a parent element, then the
<code><a href=#the-style-element>style</a></code> element must be the first node of <a href=#flow-content>flow
content</a> in its parent element other than <a href=#inter-element-whitespace>inter-element
whitespace</a>, and the parent element's content model must not
have a <a href=#transparent>transparent</a> component.</p>

<p class=note>This implies that only one scoped <code><a href=#the-style-element>style</a></code>
element is allowed at a time, and that such elements cannot be
children of, e.g., <code><a href=#the-a-element>a</a></code> or <code><a href=#the-ins-element>ins</a></code> elements, even
when those are used as <a href=#flow-content>flow content</a> containers.</p>

<div class=impl>

Expand Down
18 changes: 14 additions & 4 deletions index
Expand Up @@ -14886,7 +14886,7 @@ people expect to have work and what is necessary.
<dt>Contexts in which this element can be used:</dt>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is absent: where <a href=#metadata-content>metadata content</a> is expected.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is absent: in a <code><a href=#the-noscript-element>noscript</a></code> element that is a child of a <code><a href=#the-head-element>head</a></code> element.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present: where <a href=#flow-content>flow content</a> is expected, but before any other <a href=#flow-content>flow content</a> other than other <code><a href=#the-style-element>style</a></code> elements and <a href=#inter-element-whitespace>inter-element whitespace</a>.</dd>
<dd>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present: where <a href=#flow-content>flow content</a> is expected, but before any other <a href=#flow-content>flow content</a> other than <a href=#inter-element-whitespace>inter-element whitespace</a>, and not as the child of an element whose content model is <a href=#transparent>transparent</a>.</dd>
<dt>Content model:</dt>
<dd>Depends on the value of the <code title=attr-style-type><a href=#attr-style-type>type</a></code> attribute, but must match requirements described in prose below.</dd>
<dt>Content attributes:</dt>
Expand Down Expand Up @@ -14954,9 +14954,19 @@ people expect to have work and what is necessary.
attribute is a <a href=#boolean-attribute>boolean attribute</a>. If present, it
indicates that the styles are intended just for the subtree rooted
at the <code><a href=#the-style-element>style</a></code> element's parent element, as opposed to
the whole <code><a href=#document>Document</a></code>. If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is present, the
<code><a href=#the-style-element>style</a></code> element must be the first element of <a href=#flow-content>flow
content</a> in its parent element, if any.</p>
the whole <code><a href=#document>Document</a></code>.</p>

<p>If the <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is
present and the element has a parent element, then the
<code><a href=#the-style-element>style</a></code> element must be the first node of <a href=#flow-content>flow
content</a> in its parent element other than <a href=#inter-element-whitespace>inter-element
whitespace</a>, and the parent element's content model must not
have a <a href=#transparent>transparent</a> component.</p>

<p class=note>This implies that only one scoped <code><a href=#the-style-element>style</a></code>
element is allowed at a time, and that such elements cannot be
children of, e.g., <code><a href=#the-a-element>a</a></code> or <code><a href=#the-ins-element>ins</a></code> elements, even
when those are used as <a href=#flow-content>flow content</a> containers.</p>

<div class=impl>

Expand Down
19 changes: 14 additions & 5 deletions source
Expand Up @@ -15758,7 +15758,7 @@ people expect to have work and what is necessary.
<dt>Contexts in which this element can be used:</dt>
<dd>If the <code title="attr-style-scoped">scoped</code> attribute is absent: where <span>metadata content</span> is expected.</dd>
<dd>If the <code title="attr-style-scoped">scoped</code> attribute is absent: in a <code>noscript</code> element that is a child of a <code>head</code> element.</dd>
<dd>If the <code title="attr-style-scoped">scoped</code> attribute is present: where <span>flow content</span> is expected, but before any other <span>flow content</span> other than other <code>style</code> elements and <span>inter-element whitespace</span>.</dd>
<dd>If the <code title="attr-style-scoped">scoped</code> attribute is present: where <span>flow content</span> is expected, but before any other <span>flow content</span> other than <span>inter-element whitespace</span>, and not as the child of an element whose content model is <span>transparent</span>.</dd>
<dt>Content model:</dt>
<dd>Depends on the value of the <code title="attr-style-type">type</code> attribute, but must match requirements described in prose below.</dd>
<dt>Content attributes:</dt>
Expand Down Expand Up @@ -15834,10 +15834,19 @@ people expect to have work and what is necessary.
attribute is a <span>boolean attribute</span>. If present, it
indicates that the styles are intended just for the subtree rooted
at the <code>style</code> element's parent element, as opposed to
the whole <code>Document</code>. If the <code
title="attr-style-scoped">scoped</code> attribute is present, the
<code>style</code> element must be the first element of <span>flow
content</span> in its parent element, if any.</p>
the whole <code>Document</code>.</p>

<p>If the <code title="attr-style-scoped">scoped</code> attribute is
present and the element has a parent element, then the
<code>style</code> element must be the first node of <span>flow
content</span> in its parent element other than <span>inter-element
whitespace</span>, and the parent element's content model must not
have a <span>transparent</span> component.</p>

<p class="note">This implies that only one scoped <code>style</code>
element is allowed at a time, and that such elements cannot be
children of, e.g., <code>a</code> or <code>ins</code> elements, even
when those are used as <span>flow content</span> containers.</p>

<div class="impl">

Expand Down

0 comments on commit 67c54f1

Please sign in to comment.