Skip to content

Commit c0b9100

Browse files
author
Florian Rivoal
committed
Adding the "script" media feature
1 parent f66c7b3 commit c0b9100

2 files changed

Lines changed: 92 additions & 13 deletions

File tree

css4-mediaqueries/Overview.html

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
194194
<li><a href="#scan"><span class=secno>4.12. </span>scan</a>
195195

196196
<li><a href="#grid"><span class=secno>4.13. </span>grid</a>
197+
198+
<li><a href="#script"><span class=secno>4.14. </span>script</a>
197199
</ul>
198200

199201
<li><a href="#values"><span class=secno>5. </span>Values</a>
@@ -204,6 +206,10 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
204206
</ul>
205207

206208
<li><a href="#changes"><span class=secno>7. </span>Changes</a>
209+
<ul class=toc>
210+
<li><a href="#changes-2012"><span class=secno>7.1. </span>Changes Since
211+
the Media Queries Level 3</a>
212+
</ul>
207213

208214
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
209215

@@ -1032,6 +1038,34 @@ <h3 id=grid><span class=secno>4.13. </span>grid</h3>
10321038
<code>@media handheld and (grid) and (device-max-height: 7em) { &hellip; }</code></pre>
10331039
</div>
10341040

1041+
<h3 id=script><span class=secno>4.14. </span>script</h3>
1042+
1043+
<div class=media-feature><span class=label>Value:</span>
1044+
&lt;integer&gt;<br>
1045+
<span class=label>Applies to:</span>all media types<br>
1046+
<span class=label>Accepts min/maxprefixes:</span> no<br>
1047+
</div>
1048+
1049+
<p>The &lsquo;<code class=property>script</code>&rsquo; media feature is
1050+
used to query whether ECMAscript is supported on the current document. If
1051+
the user agent supports ECMAscript, and that support is active for the
1052+
current document the value must be 1. Otherwise, the value must be 0.
1053+
1054+
<p>Some user agents have the ability to turn off ECMAscript support on a
1055+
per script basis or per domain basis, allowing some, but not all, scripts
1056+
to run in a particular document. The &lsquo;<code
1057+
class=css>script</code>&rsquo; media feature does not allow fine grained
1058+
detection of which script is allowed to run. In this scenario, the value
1059+
of the &lsquo;<code class=property>script</code>&rsquo; media feature
1060+
should be 1 if scripts originating on the same domain as the document are
1061+
allowed to run, and 0 otherwise.
1062+
1063+
<p class=note>A future level of CSS may extend this media feature to allow
1064+
fine-grained detection of which script is allowed to run.
1065+
1066+
<p>Only 0 and 1 are valid values. (This includes -0.) Thus everything else
1067+
creates a malformed media query.
1068+
10351069
<h2 id=values><span class=secno>5. </span>Values</h2>
10361070

10371071
<p>This specification also introduces two new values.
@@ -1081,15 +1115,27 @@ <h3 id=resolution0><span class=secno>6.1. </span>Resolution</h3>
10811115

10821116
<h2 id=changes><span class=secno>7. </span>Changes</h2>
10831117

1118+
<h3 id=changes-2012><span class=secno>7.1. </span>Changes Since the Media
1119+
Queries Level 3</h3>
1120+
1121+
<p>The following changes were made to this specification since the <a
1122+
href="http://www.w3.org/TR/2012/PR-css3-mediaqueries-20120426/">26 April
1123+
2012 Proposed Recomendation of Media Queries Level 3</a>:
1124+
1125+
<ul>
1126+
<li>The <a href="#script">&lsquo;<code class=css>script</code>&rsquo;
1127+
media feature</a> was added.
1128+
</ul>
1129+
10841130
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
10851131

10861132
<p>This specification is the product of the W3C Working Group on Cascading
10871133
Style Sheets.
10881134

1089-
<p>Comments from Bj&ouml;rn H&ouml;hrmann, Christoph P&auml;per, Chris
1090-
Lilley, Simon Pieters, Rijk van Geijtenbeek, Sigurd Lerstad, Arve
1091-
Bersvendsen, Susan Lesch, Philipp Hoschka, Roger Gimson, Steven Pemberton,
1092-
Simon Kissane, Melinda Grant, and L. David Baron improved this
1135+
<p>Comments from Arve Bersvendsen, Bj&ouml;rn H&ouml;hrmann, Chris Lilley,
1136+
Christoph P&auml;per, L. David Baron, Melinda Grant, Nicholas C. Zakas
1137+
Philipp Hoschka, Rijk van Geijtenbeek, Roger Gimson, Sigurd Lerstad, Simon
1138+
Kissane, Simon Pieters, Steven Pemberton and Susan Lesch, improved this
10931139
specification.
10941140

10951141
<h2 class=no-num id=references>References</h2>

css4-mediaqueries/Overview.src.html

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,31 @@ <h3 id="grid">grid</h3>
907907
</div>
908908

909909

910+
<h3 id="script">script</h3>
911+
<div class="media-feature"><span class="label">Value:</span> &lt;integer&gt;<br>
912+
<span class="label">Applies to:</span>all media types<br>
913+
<span class="label">Accepts min/maxprefixes:</span> no<br
914+
</div>
915+
916+
<p>The 'script' media feature is used to query whether ECMAscript is supported
917+
on the current document. If the user agent supports ECMAscript, and that
918+
support is active for the current document the value must be 1. Otherwise, the
919+
value must be 0.</p>
920+
921+
<p>Some user agents have the ability to turn off ECMAscript support on a per
922+
script basis or per domain basis, allowing some, but not all, scripts to run in
923+
a particular document. The ''script'' media feature does not allow fine grained
924+
detection of which script is allowed to run. In this scenario, the value of the
925+
'script' media feature should be 1 if scripts originating on the same domain as
926+
the document are allowed to run, and 0 otherwise.</p>
927+
928+
<p class="note">A future level of CSS may extend this media feature to allow
929+
fine-grained detection of which script is allowed to run.</p>
930+
931+
<p>Only 0 and 1 are valid values. (This includes -0.) Thus everything else
932+
creates a malformed media query.</p>
933+
934+
910935
<h2 id="values">Values</h2>
911936

912937
<p>This specification also introduces two new values.</p>
@@ -952,27 +977,35 @@ <h3>Resolution</h3>
952977

953978

954979
<h2 id="changes">Changes</h2>
980+
<h3 id="changes-2012">Changes Since the Media Queries Level 3</h3>
981+
<p>The following changes were made to this specification since the
982+
<a href="http://www.w3.org/TR/2012/PR-css3-mediaqueries-20120426/">26 April 2012
983+
Proposed Recomendation of Media Queries Level 3</a>:
984+
<ul>
985+
<li>The <a href="#script">''script'' media feature</a> was added.
986+
</ul>
955987

956988
<h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
957989

958990
<p>This specification is the product of the W3C Working Group on
959991
Cascading Style Sheets.</p>
960992

961993
<p>Comments from
994+
Arve Bersvendsen,
962995
Bj&ouml;rn H&ouml;hrmann,
963-
Christoph P&auml;per,
964996
Chris Lilley,
965-
Simon Pieters,
966-
Rijk van Geijtenbeek,
967-
Sigurd Lerstad,
968-
Arve Bersvendsen,
969-
Susan Lesch,
997+
Christoph P&auml;per,
998+
L. David Baron,
999+
Melinda Grant,
1000+
Nicholas C. Zakas
9701001
Philipp Hoschka,
1002+
Rijk van Geijtenbeek,
9711003
Roger Gimson,
972-
Steven Pemberton,
1004+
Sigurd Lerstad,
9731005
Simon Kissane,
974-
Melinda Grant, and
975-
L. David Baron
1006+
Simon Pieters,
1007+
Steven Pemberton and
1008+
Susan Lesch,
9761009
improved this specification.</p>
9771010

9781011

0 commit comments

Comments
 (0)