Skip to content

Commit 053ee65

Browse files
author
Simon Pieters
committed
[cssom] Provide hooks so that HTML can make <link media> and <link title> update the media and title on the style sheet.
1 parent 77985a2 commit 053ee65

2 files changed

Lines changed: 72 additions & 55 deletions

File tree

cssom/Overview.html

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<!DOCTYPE html><html lang="en-US"><head>
22
<meta charset="utf-8">
33
<title>CSS Object Model (CSSOM)</title>
4-
<style>
5-
dl.switch { padding-left:2em }
6-
dl.switch > dt { text-indent:-1.5em }
7-
dl.switch > dt:before { content:'\21AA'; padding:0 0.5em 0 0; display:inline-block; width:1em; text-align:right; line-height:0.5em }
8-
.atrisk::before { position:absolute; margin-left:-5em; margin-top:-2px; padding:4px; border:1px solid; content:'At risk';
9-
font-size:smaller; background:white; color:gray; border-radius:1em; text-align:center }
10-
.propdef { font:inherit; line-height:2.3 }
11-
.toc, .toc ol { list-style-type:none }
12-
</style>
134
<link href="../default.css" rel="stylesheet">
145
<link href="https://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet">
156
</head>
@@ -503,53 +494,53 @@ <h4 id="serializing-media-feature-values"><span class="secno">4.2.1 </span>Seria
503494

504495
<table class="complex data">
505496
<thead>
506-
<tr>
507-
<th>Media Feature
508-
<th>Serialization
497+
<tr>
498+
<th>Media Feature
499+
<th>Serialization
509500
<tbody>
510-
<tr>
511-
<td>'width'
512-
<td>...
513-
<tr>
514-
<td>'height'
515-
<td>...
516-
<tr>
517-
<td>'device-width'
518-
<td>...
519-
<tr>
520-
<td>'device-height'
521-
<td>...
522-
<tr>
523-
<td>'orientation'
524-
<td>
525-
<p>If the value is 'portrait': "<code title="">portrait</code>".</p>
526-
<p>If the value is 'landscape': "<code title="">landscape</code>".</p>
527-
<tr>
528-
<td>'aspect-ratio'
529-
<td>...
530-
<tr>
531-
<td>'device-aspect-ratio'
532-
<td>...
533-
<tr>
534-
<td>'color'
535-
<td>...
536-
<tr>
537-
<td>'color-index'
538-
<td>...
539-
<tr>
540-
<td>'monochrome'
541-
<td>...
542-
<tr>
543-
<td>'resolution'
544-
<td>...
545-
<tr>
546-
<td>'scan'
547-
<td>
548-
<p>If the value is 'progressive': "<code title="">progressive</code>".</p>
549-
<p>If the value is 'interlace': "<code title="">interlace</code>".</p>
550-
<tr>
551-
<td>'grid'
552-
<td>...
501+
<tr>
502+
<td>'width'
503+
<td>...
504+
<tr>
505+
<td>'height'
506+
<td>...
507+
<tr>
508+
<td>'device-width'
509+
<td>...
510+
<tr>
511+
<td>'device-height'
512+
<td>...
513+
<tr>
514+
<td>'orientation'
515+
<td>
516+
<p>If the value is 'portrait': "<code title="">portrait</code>".</p>
517+
<p>If the value is 'landscape': "<code title="">landscape</code>".</p>
518+
<tr>
519+
<td>'aspect-ratio'
520+
<td>...
521+
<tr>
522+
<td>'device-aspect-ratio'
523+
<td>...
524+
<tr>
525+
<td>'color'
526+
<td>...
527+
<tr>
528+
<td>'color-index'
529+
<td>...
530+
<tr>
531+
<td>'monochrome'
532+
<td>...
533+
<tr>
534+
<td>'resolution'
535+
<td>...
536+
<tr>
537+
<td>'scan'
538+
<td>
539+
<p>If the value is 'progressive': "<code title="">progressive</code>".</p>
540+
<p>If the value is 'interlace': "<code title="">interlace</code>".</p>
541+
<tr>
542+
<td>'grid'
543+
<td>...
553544
</table>
554545

555546
<p>Other specifications can extend this table and vendor-prefixed media
@@ -838,6 +829,14 @@ <h3 id="css-style-sheets"><span class="secno">6.1 </span>CSS Style Sheets</h3>
838829

839830
<p>If this property is specified to a string, the <a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a> must be set to the return value of invoking
840831
<a href="#create-a-medialist-object">create a <code>MediaList</code> object</a> steps for that string.</p>
832+
833+
<p>If this property is specified to an attribute of the <a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a>, the
834+
<a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a> must be set to the return value of invoking <a href="#create-a-medialist-object">create a <code>MediaList</code> object</a> steps
835+
for the value of that attribute. Whenever the attribute is set, changed or removed, the <a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a>'s
836+
<code title="dom-MediaList-mediaText"><a href="#dom-medialist-mediatext">mediaText</a></code> attribute must be set to the new value of the attribute, or to null if the attribute is absent.
837+
838+
<p class="note">Changing the <a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a>'s <code title="dom-MediaList-mediaText"><a href="#dom-medialist-mediatext">mediaText</a></code> attribute does not
839+
change the corresponding attribute on the <a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a>.
841840
</dd>
842841

843842
<dt><dfn id="concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</dfn></dt>
@@ -857,6 +856,11 @@ <h3 id="css-style-sheets"><span class="secno">6.1 </span>CSS Style Sheets</h3>
857856
body { background: brown; }
858857
&lt;/style&gt;</pre>
859858
</div>
859+
860+
<p>If this property is specified to an attribute of the <a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a>, the
861+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> must be set to the value of that attribute. Whenever the attribute is set, changed or removed, the
862+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> must be set to the new value of the attribute, or to the empty string if the attribute is absent.
863+
860864
</dd>
861865

862866
<dt><dfn id="concept-css-style-sheet-alternate-flag" title="concept-css-style-sheet-alternate-flag">alternate flag</dfn></dt>

cssom/Overview.src.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,14 @@ <h3>CSS Style Sheets</h3>
750750

751751
<p>If this property is specified to a string, the <span title=concept-css-style-sheet-media>media</span> must be set to the return value of invoking
752752
<span>create a <code>MediaList</code> object</span> steps for that string.</p>
753+
754+
<p>If this property is specified to an attribute of the <span title=concept-css-style-sheet-owner-node>owner node</span>, the
755+
<span title=concept-css-style-sheet-media>media</span> must be set to the return value of invoking <span>create a <code>MediaList</code> object</span> steps
756+
for the value of that attribute. Whenever the attribute is set, changed or removed, the <span title=concept-css-style-sheet-media>media</span>'s
757+
<code title=dom-MediaList-mediaText>mediaText</code> attribute must be set to the new value of the attribute, or to null if the attribute is absent.
758+
759+
<p class=note>Changing the <span title=concept-css-style-sheet-media>media</span>'s <code title=dom-MediaList-mediaText>mediaText</code> attribute does not
760+
change the corresponding attribute on the <span title=concept-css-style-sheet-owner-node>owner node</span>.
753761
</dd>
754762

755763
<dt><dfn title=concept-css-style-sheet-title>title</dfn></dt>
@@ -769,6 +777,11 @@ <h3>CSS Style Sheets</h3>
769777
body { background: brown; }
770778
&lt;/style></pre>
771779
</div>
780+
781+
<p>If this property is specified to an attribute of the <span title=concept-css-style-sheet-owner-node>owner node</span>, the
782+
<span title=concept-css-style-sheet-title>title</span> must be set to the value of that attribute. Whenever the attribute is set, changed or removed, the
783+
<span title=concept-css-style-sheet-title>title</span> must be set to the new value of the attribute, or to the empty string if the attribute is absent.
784+
772785
</dd>
773786

774787
<dt><dfn title=concept-css-style-sheet-alternate-flag>alternate flag</dfn></dt>

0 commit comments

Comments
 (0)