Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Remove scoped style #318

Merged
merged 4 commits into from
May 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions sections/attributes.include
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,6 @@
<td>Specifies which cells the header cell applies to</td>
<td>"<code>row</code>"; "<code>col</code>"; "<code>rowgroup</code>"; "<code>colgroup</code>"</td>
</tr>
<tr>
<th><code>scoped</code></th>
<td><{style}></td>
<td>Whether the styles apply to the entire document or just the parent subtree</td>
<td><a>Boolean attribute</a></td>
</tr>
<tr>
<th><code>selected</code></th>
<td><{option}></td>
Expand Down
1 change: 0 additions & 1 deletion sections/dom.include
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,6 @@
<li><{small}></li>
<li><{span}></li>
<li><{strong}></li>
<li><{style}> (if the <code>scoped</code> attribute is present)</li>
<li><{sub}></li>
<li><{sup}></li>
<li><{svg}></li>
Expand Down
3 changes: 1 addition & 2 deletions sections/element-content-categories.include
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
<a>Text</a>
</td>
<td>
<{area}> (if it is a descendant of a <{map}> element);
<{style}> (if the <{style/scoped}> attribute is present)
<{area}> (if it is a descendant of a <{map}> element)

</td>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions sections/elements.include
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,7 @@
<td>varies*</td>
<td><a lt="global attributes">globals</a>;
<{style/media}>;
<{style/type}>;
<{style/scoped}></code></td>
<{style/type}></code></td>
<td>{{HTMLStyleElement}}</td>
</tr>

Expand Down
39 changes: 4 additions & 35 deletions sections/semantics-document-metadata.include
Original file line number Diff line number Diff line change
Expand Up @@ -1355,21 +1355,14 @@
<dl class="element">
<dt><a>Categories</a>:</dt>
<dd><a>Metadata content</a>.</dd>
<dd>If the <code>scoped</code> attribute is present: <a>flow content</a>.</dd>
<dt><a>Contexts in which this element can be used</a>:</dt>
<dd>
If the <code>scoped</code> attribute is absent: where <a>metadata content</a> is expected.
Where <a>metadata content</a> is expected.
</dd>
<dd>
If the <code>scoped</code> attribute is absent: in a <{noscript}> element that is a
In a <{noscript}> element that is a
child of a <{head}> element.
</dd>
<dd>
If the <code>scoped</code> attribute is present: where <a>flow content</a> is expected, but
before any other <a>flow content</a> other than <a>inter-element whitespace</a> and
<{style}> elements, and not as the child of an element whose content model is
<a>transparent</a>.
</dd>
<dt><a>Content model</a>:</dt>
<dd>
Depends on the value of the <code>type</code> attribute, but must match requirements described
Expand All @@ -1381,10 +1374,6 @@
<dd><a>Global attributes</a></dd>
<dd><code>media</code> — Applicable media</dd>
<dd><code>type</code> — Type of embedded resource</dd>
<dd>
<code>scoped</code> — Whether the styles apply to the entire document or just the parent
subtree
</dd>
<dd>
Also, the <{style/title}> attribute has special semantics on this element: Alternative
style sheet set name.
Expand All @@ -1399,7 +1388,6 @@
interface HTMLStyleElement : HTMLElement {
attribute DOMString media;
attribute DOMString type;
attribute boolean scoped;
};
HTMLStyleElement implements LinkStyle;
</pre>
Expand Down Expand Up @@ -1437,29 +1425,11 @@
The default, if the <code>media</code> attribute is omitted, is "<code>all</code>", meaning that
by default styles apply to all media.

The <dfn element-attr for="style"><code>scoped</code></dfn> attribute is a <a>boolean attribute</a>. 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 {{Document}}.

If the <code>scoped</code> attribute is present and the element has a parent element, then the
<{style}> element must precede any <a>flow content</a> in its parent element other than
<a>inter-element whitespace</a> and other <{style}> elements, and the parent element's
content model must not have a <a>transparent</a> component.

<p class="note">
This implies that scoped <{style}> elements cannot be children of, e.g., <{a}>
or <{ins}> elements, even when those are used as <a>flow content</a> containers.
</p>

<p class="note">
A <{style}> element <em>without</em> a <code>scoped</code> attribute is restricted to
A <{style}> element is restricted to
appearing in the <code>head</code> of the document.
</p>

A style sheet declared by a <{style}> element that has a <code>scoped</code> attribute
and has a parent node that is an element is <i>scoped</i>, with the <i>scoping root</i> being the
<{style}> element's parent element. [[!CSS-SCOPING-1]]

The <dfn element-attr for="style"><code>title</code></dfn> attribute on <{style}> elements defines
<a>alternative style sheet sets</a>. If the <{style}> element has no <code>title</code>
attribute, then it has no title; the <code>title</code> attribute of ancestors does not apply to
Expand Down Expand Up @@ -1569,8 +1539,7 @@
</p>

<div class="impl">
The {{HTMLStyleElement/media}}, {{HTMLStyleElement/type}} and
{{HTMLStyleElement/scoped}} IDL attributes must <a>reflect</a> the respective content
The {{HTMLStyleElement/media}} and {{HTMLStyleElement/type}} IDL attributes must <a>reflect</a> the respective content
attributes of the same name.
</div>

Expand Down
12 changes: 3 additions & 9 deletions sections/semantics-embedded-content.include
Original file line number Diff line number Diff line change
Expand Up @@ -9979,15 +9979,9 @@ zero or more <{track}> elements, then

<pre highlight="html">
&lt;article&gt;
&lt;style scoped&gt;
div { margin: 1em auto; position: relative; width: 400px; height: 300px; }
video { position; absolute; bottom: 0; right: 0; }
video:first-child { width: 100%; height: 100%; }
video:last-child { width: 30%; }
&lt;/style&gt;
&lt;div&gt;
&lt;video src="movie.vid#track=Video&amp;amp;track=English" autoplay controls mediagroup=movie&gt;&lt;/video&gt;
&lt;video src="movie.vid#track=sign" autoplay mediagroup=movie&gt;&lt;/video&gt;
&lt;div style="margin: 1em auto; position: relative; width: 400px; height: 300px;"&gt;
&lt;video style="position; absolute; bottom: 0; right: 0; width: 100%; height: 100%;" src="movie.vid#track=Video&amp;amp;track=English" autoplay controls mediagroup=movie&gt;&lt;/video&gt;
&lt;video style="position; absolute; bottom: 0; right: 0; width: 30%;" src="movie.vid#track=sign" autoplay mediagroup=movie&gt;&lt;/video&gt;
&lt;/div&gt;
&lt;/article&gt;
</pre>
Expand Down
5 changes: 0 additions & 5 deletions sections/semantics-tabular-data.include
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,6 @@

<pre highlight="html">
&lt;section&gt;
&lt;style scoped&gt;
table { border-collapse: collapse; border: solid thick; }
colgroup, tbody { border: solid medium; }
td { border: solid thin; height: 1.4em; width: 1.4em; text-align: center; padding: 0; }
&lt;/style&gt;
&lt;h1&gt;Today's Sudoku&lt;/h1&gt;
&lt;table&gt;
&lt;colgroup&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;
Expand Down
6 changes: 4 additions & 2 deletions sections/semantics-textlevel.include
Original file line number Diff line number Diff line change
Expand Up @@ -2864,8 +2864,8 @@ end.&lt;/code&gt;&lt;/pre&gt;
the author to explicitly style <{mark}> elements in quotes to render in italics.

<pre highlight="html">
&lt;article&gt;
&lt;style scoped&gt;
&lt;head&gt;
&lt;style&gt;
blockquote mark, q mark {
font: inherit; font-style: italic;
text-decoration: none;
Expand All @@ -2876,6 +2876,8 @@ end.&lt;/code&gt;&lt;/pre&gt;
text-decoration: underline;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;article&gt;
&lt;h1&gt;She knew&lt;/h1&gt;
&lt;p&gt;Did you notice the subtle joke in the joke on panel 4?&lt;/p&gt;
&lt;blockquote&gt;
Expand Down