Skip to content

Commit 0d216a7

Browse files
committed
[css3-values] Make attr() invalid if it uses an undeclared namespace prefix.
1 parent f8055d4 commit 0d216a7

2 files changed

Lines changed: 52 additions & 49 deletions

File tree

css3-values/Overview.html

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
"http://www.w3.org/TR/html4/strict.dtd">
33

44
<html lang=en>
5-
<head><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
6-
5+
<head profile="http://dublincore.org/documents/2008/08/04/dc-html/ ">
6+
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
77
<title>CSS Values and Units Module Level 3</title>
88

9+
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
10+
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
11+
rel=dcterms.rights>
12+
<meta content="CSS Values and Units Module Level 3" name=dcterms.title>
13+
<meta content=text name=dcterms.type>
14+
<meta content=2012-10-16 name=dcterms.issued>
15+
<meta content="http://dev.w3.org/csswg/css3-values/" name=dcterms.creator>
16+
<meta content=W3C name=dcterms.publisher>
17+
<meta content="http://www.w3.org/TR/2012/ED-css3-values-20121016/"
18+
name=dcterms.identifier>
919
<style type="text/css">
1020
code, small { white-space: nowrap }
1121
.say { color: gray; }
@@ -19,7 +29,7 @@
1929
</style>
2030
<link href="../default.css" rel=stylesheet type="text/css">
2131
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
22-
type="text/css">
32+
type="text/css">
2333

2434
<body>
2535
<div class=head> <!--begin-logo-->
@@ -28,13 +38,14 @@
2838

2939
<h1>CSS Values and Units Module Level 3</h1>
3040

31-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 27 August 2012</h2>
41+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 16 October
42+
2012</h2>
3243

3344
<dl>
3445
<dt>This version:
3546

3647
<dd><a
37-
href="http://www.w3.org/TR/2012/ED-css3-values-20120827/">http://www.w3.org/TR/2012/ED-css3-values-20120827/</a>
48+
href="http://www.w3.org/TR/2012/ED-css3-values-20121016/">http://www.w3.org/TR/2012/ED-css3-values-20121016/</a>
3849

3950
<dt>Latest version:
4051

@@ -45,7 +56,6 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 27 August 2012</h2>
4556

4657
<dd><a
4758
href="http://dev.w3.org/csswg/css3-values/">http://dev.w3.org/csswg/css3-values/</a>
48-
4959

5060
<dt>Previous version:
5161

@@ -56,7 +66,6 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 27 August 2012</h2>
5666

5767
<dd><a
5868
href="http://www.w3.org/Style/CSS/Tracker/products/33">http://www.w3.org/Style/CSS/Tracker/products/33</a>
59-
6069

6170
<dt>Feedback:
6271

@@ -230,7 +239,6 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
230239
</span> Viewport-percentage lengths: the ‘<code
231240
class=css>vw</code>’, ‘<code class=css>vh</code>’, ‘<code
232241
class=css>vmin</code>’, ‘<code class=css>vmax</code>’ units</a>
233-
234242
</ul>
235243

236244
<li><a href="#absolute-lengths"><span class=secno>5.2. </span> Absolute
@@ -281,7 +289,6 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
281289
Expressions: ‘<code class=css>calc()</code></a>
282290
<ul class=toc>
283291
<li><a href="#calc-syntax"><span class=secno>8.1.1. </span> Syntax</a>
284-
285292

286293
<li><a href="#calc-type-checking"><span class=secno>8.1.2. </span>
287294
Type Checking</a>
@@ -314,7 +321,6 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
314321
<li class=no-num><a href="#conventions"> Document conventions</a>
315322

316323
<li class=no-num><a href="#conformance-classes"> Conformance classes</a>
317-
318324

319325
<li class=no-num><a href="#partial"> Partial implementations</a>
320326

@@ -351,7 +357,6 @@ <h2 id=introduction><span class=secno>1. </span>Introduction</h2>
351357
used) that can be used by many properties are described in this
352358
specification, while more specific data types (e.g.,
353359
<var>&lt;spacing-limit></var>) are described in the corresponding modules.
354-
355360

356361
<h3 id=placement><span class=secno>1.1. </span> Module Interactions</h3>
357362

@@ -611,11 +616,11 @@ <h3 id=keywords><span class=secno>3.1. </span> Pre-defined Keywords</h3>
611616

612617
<div class=example>
613618
<p>For example, here is the value definition for the ‘<code
614-
class=property>border-collapse</code>’ property:</p>
619+
class=property>border-collapse</code>’ property:
615620

616621
<pre>Value: collapse | separate</pre>
617622

618-
<p>And here is an example of its use:</p>
623+
<p>And here is an example of its use:
619624

620625
<pre>table { border-collapse: separate }</pre>
621626
</div>
@@ -669,7 +674,7 @@ <h3 id=strings><span class=secno>3.2. </span> Quoted Strings: the ‘<a
669674
For instance, the following two selectors are exactly the same:
670675

671676
<div class=example>
672-
<p style="display:none">Example(s):</p>
677+
<p style="display:none">Example(s):
673678

674679
<pre>
675680
<!-- -->a[title="a not s\
@@ -720,8 +725,8 @@ <h3 id=urls><span class=secno>3.3. </span> Resource Locators: the ‘<a
720725
class=css>url(close%29parens)</code>’) as described in <a href="#URI"
721726
rel=biblioentry>[URI]<!--{{URI}}--></a>. Alternatively a URL containing
722727
such characters may be represented as a quoted <a
723-
href="#strings">string</a> within the ‘<a href="#url"><code
724-
class=css>url()</code></a>notation.
728+
href="#strings">string</a> within the ‘<code class=css>url()</code>
729+
notation.
725730

726731
<p>In order to create modular style sheets that are not dependent on the
727732
absolute location of a resource, authors should use relative URIs.
@@ -741,7 +746,7 @@ <h3 id=urls><span class=secno>3.3. </span> Resource Locators: the ‘<a
741746

742747
<pre>body { background: url("tile.png") }</pre>
743748

744-
<p>is located in a style sheet designated by the URL:</p>
749+
<p>is located in a style sheet designated by the URL:
745750

746751
<pre>http://www.example.org/style/basic.css</pre>
747752

@@ -768,7 +773,6 @@ <h2 id=numeric-types><span class=secno>4. </span> Numeric Data Types</h2>
768773
and the required rounding and clamping rules,
769774
are given in <a href="#required-ranges">Appendix A</a>.
770775
-->
771-
772776

773777
<h3 id=integers><span class=secno>4.1. </span> Integers: the ‘<a
774778
href="#integer-value"><code class=css>&lt;integer></code></a>’ type</h3>
@@ -940,7 +944,7 @@ <h4 id=font-relative-lengths><span class=secno>5.1.1. </span> Font-relative
940944
is used.
941945

942946
<div class=example>
943-
<p>The rule:</p>
947+
<p>The rule:
944948

945949
<pre>h1 { line-height: 1.2em }</pre>
946950

@@ -952,7 +956,7 @@ <h4 id=font-relative-lengths><span class=secno>5.1.1. </span> Font-relative
952956

953957
<p>means that the font size of <code>h1</code> elements will be 20%
954958
greater than the computed font size inherited by <code>h1</code>
955-
elements.</p>
959+
elements.
956960
</div>
957961

958962
<dt><dfn id=ex-unit title=ex>ex unit</dfn>
@@ -987,7 +991,7 @@ <h4 id=font-relative-lengths><span class=secno>5.1.1. </span> Font-relative
987991
<p>When specified on the ‘<code class=property>font-size</code>
988992
property of the root element, the ‘<a href="#rem-unit"><code
989993
class=css>rem</code></a>’ units refer to the property's <em>initial
990-
value</em>.</p>
994+
value</em>.
991995
</dl>
992996

993997
<h4 id=viewport-relative-lengths><span class=secno>5.1.2. </span>
@@ -1147,7 +1151,6 @@ <h3 id=absolute-lengths><span class=secno>5.2. </span> Absolute lengths:
11471151

11481152
<p class=caption>Showing that more device pixels (dots) are needed to
11491153
cover a 1px by 1px area on a high-resolution device than on a low-res one
1150-
11511154
</div>
11521155

11531156
<h2 id=other-units><span class=secno>6. </span> Other Units</h2>
@@ -1387,7 +1390,7 @@ <h3 id=calc-notation><span class=secno>8.1. </span> Mathematical
13871390
<div class=example>
13881391
<p>The following sets the ‘<code class=property>font-size</code>’ so
13891392
that exactly 40em fits within the viewport, ensuring that roughly the
1390-
same amount of text always fills the screen no matter the screen size.</p>
1393+
same amount of text always fills the screen no matter the screen size.
13911394

13921395
<pre>
13931396
:root {
@@ -1396,7 +1399,7 @@ <h3 id=calc-notation><span class=secno>8.1. </span> Mathematical
13961399

13971400
<p>If the rest of the design is specified using the ‘<a
13981401
href="#rem-unit"><code class=css>rem</code></a>’ unit, the entire
1399-
layout will scale to match the viewport width.</p>
1402+
layout will scale to match the viewport width.
14001403
</div>
14011404

14021405
<div class=example>
@@ -1561,7 +1564,6 @@ <h4 id=calc-computed-value><span class=secno>8.1.3. </span> Computed Value</h4>
15611564
This has notes on how we should handle things when calc() is extended to
15621565
handle unit mult/div. Related to this is <unit>mod<unit>, which can return
15631566
0 and thus introduce computed-time division-by-zero. -->
1564-
15651567

15661568
<p> Given the complexities of width and height calculations on table cells
15671569
and table elements, math expressions involving percentages for widths and
@@ -1596,7 +1598,6 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
15961598
<div class=example>
15971599
<p>The following example makes <code>&lt;em></code> elements italic in
15981600
general, but makes them normal if they're inside something that's italic:
1599-
16001601

16011602
<pre>em { font-style: toggle(italic, normal); }</pre>
16021603
</div>
@@ -1738,6 +1739,9 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
17381739
<li> the attr() expression's type is valid where the attr() expression is
17391740
placed,
17401741

1742+
<li> if the attribute name is given with a namespace prefix, the prefix is
1743+
defined
1744+
17411745
<li> the <var>&lt;fallback></var> is valid where the attr() expression is
17421746
placed,
17431747

@@ -1793,14 +1797,13 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
17931797

17941798
<dd> The attribute value will be parsed as the contents of a CSS <a
17951799
href="#string-value"><var>&lt;string></var></a>. It is interpreted as a
1796-
quoted string within the ‘<a href="#url"><code
1797-
class=css>url()</code></a>’ notation. The default is ‘<code
1798-
class=css>about:invalid</code>’, which is a URI defined (<a
1799-
href="#about-invalid">in Appendix A</a>) to point to a non-existent
1800-
document with a generic error condition. Relative URLs must be made
1801-
absolute according to the rules of the document language as applied to
1802-
URLs originating from the element; they are not relative to the style
1803-
sheet.
1800+
quoted string within the ‘<code class=css>url()</code>’ notation. The
1801+
default is ‘<code class=css>about:invalid</code>’, which is a URI
1802+
defined (<a href="#about-invalid">in Appendix A</a>) to point to a
1803+
non-existent document with a generic error condition. Relative URLs must
1804+
be made absolute according to the rules of the document language as
1805+
applied to URLs originating from the element; they are not relative to
1806+
the style sheet.
18041807

18051808
<dt><a href="#integer"><code class=css>integer</code></a>
18061809

@@ -1895,7 +1898,7 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
18951898

18961899
<div class=example>
18971900
<p>This example shows the use of attr() to visually illustrate data in an
1898-
XML file:</p>
1901+
XML file:
18991902

19001903
<pre>
19011904
&lt;stock>
@@ -1936,7 +1939,7 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
19361939
<div class="illegal example">
19371940
<p>All of the following examples are invalid and would cause a parse-time
19381941
error, and thus cause the relevant declaration—in this case all of
1939-
them—to be ignored:</p>
1942+
them—to be ignored:
19401943

19411944
<pre>
19421945
content: attr(title color); /* 'content' doesn't accept colors */
@@ -2035,7 +2038,6 @@ <h3 id=about-invalid><span class=secno>9.1. </span> Registration for the
20352038

20362039
<p> The official record of this registration can be found at <a
20372040
href="http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xml">http://www.iana.org/assignments/about-uri-tokens/about-uri-tokens.xml</a>.
2038-
20392041

20402042
<table class="data define">
20412043
<tbody>
@@ -2093,7 +2095,7 @@ <h3 class=no-num id=conventions> Document conventions</h3>
20932095
<code>class="example"</code>, like this:
20942096

20952097
<div class=example>
2096-
<p>This is an example of an informative example.</p>
2098+
<p>This is an example of an informative example.
20972099
</div>
20982100

20992101
<p>Informative notes begin with the word “Note” and are set apart from
@@ -2264,7 +2266,6 @@ <h2 class=no-num id=changes>Changes</h2>
22642266
class=css>attr()</code></a>’.
22652267

22662268
<li>Added ‘<a href="#vmax-unit"><code class=css>vmax</code></a>’ unit.
2267-
22682269
</ul>
22692270

22702271
<p>A <a
@@ -2288,7 +2289,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
22882289
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
22892290
2011. W3C Recommendation. URL: <a
22902291
href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
2291-
</dd>
2292+
</dd>
22922293
<!---->
22932294

22942295
<dt id=CSS3-IMAGES>[CSS3-IMAGES]
@@ -2298,7 +2299,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
22982299
Values and Replaced Content Module Level 3.</cite></a> 17 April 2012. W3C
22992300
Candidate Recommendation. (Work in progress.) URL: <a
23002301
href="http://www.w3.org/TR/2012/CR-css3-images-20120417/">http://www.w3.org/TR/2012/CR-css3-images-20120417/</a>
2301-
</dd>
2302+
</dd>
23022303
<!---->
23032304

23042305
<dt id=CSS3BG>[CSS3BG]
@@ -2308,7 +2309,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23082309
Backgrounds and Borders Module Level 3.</cite></a> 24 July 2012. W3C
23092310
Candidate Recommendation. (Work in progress.) URL: <a
23102311
href="http://www.w3.org/TR/2012/CR-css3-background-20120724/">http://www.w3.org/TR/2012/CR-css3-background-20120724/</a>
2311-
</dd>
2312+
</dd>
23122313
<!---->
23132314

23142315
<dt id=CSS3COLOR>[CSS3COLOR]
@@ -2317,7 +2318,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23172318
href="http://www.w3.org/TR/2011/REC-css3-color-20110607"><cite>CSS Color
23182319
Module Level 3.</cite></a> 7 June 2011. W3C Recommendation. URL: <a
23192320
href="http://www.w3.org/TR/2011/REC-css3-color-20110607">http://www.w3.org/TR/2011/REC-css3-color-20110607</a>
2320-
</dd>
2321+
</dd>
23212322
<!---->
23222323

23232324
<dt id=CSS3NAMESPACE>[CSS3NAMESPACE]
@@ -2327,7 +2328,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23272328
Namespaces Module.</cite></a> 29 September 2011. W3C Recommendation. URL:
23282329
<a
23292330
href="http://www.w3.org/TR/2011/REC-css3-namespace-20110929/">http://www.w3.org/TR/2011/REC-css3-namespace-20110929/</a>
2330-
</dd>
2331+
</dd>
23312332
<!---->
23322333

23332334
<dt id=RFC2119>[RFC2119]
@@ -2336,7 +2337,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23362337
words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
23372338
RFC 2119. URL: <a
23382339
href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
2339-
</dd>
2340+
</dd>
23402341
<!---->
23412342

23422343
<dt id=URI>[URI]
@@ -2346,7 +2347,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23462347
Identifiers (URI): generic syntax.</cite></a> January 2005. Internet RFC
23472348
3986. URL: <a
23482349
href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a>
2349-
</dd>
2350+
</dd>
23502351
<!---->
23512352
</dl>
23522353
<!--end-normative-->
@@ -2366,7 +2367,7 @@ <h3 class=no-num id=other-references>Other references</h3>
23662367
module: Cascading and inheritance.</cite></a> 15 December 2005. W3C
23672368
Working Draft. (Work in progress.) URL: <a
23682369
href="http://www.w3.org/TR/2005/WD-css3-cascade-20051215">http://www.w3.org/TR/2005/WD-css3-cascade-20051215</a>
2369-
</dd>
2370+
</dd>
23702371
<!---->
23712372

23722373
<dt id=MEDIAQ>[MEDIAQ]
@@ -2375,7 +2376,7 @@ <h3 class=no-num id=other-references>Other references</h3>
23752376
href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/"><cite>Media
23762377
Queries.</cite></a> 19 June 2012. W3C Recommendation. URL: <a
23772378
href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/">http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/</a>
2378-
</dd>
2379+
</dd>
23792380
<!---->
23802381
</dl>
23812382
<!--end-informative-->
@@ -2502,7 +2503,6 @@ <h2 class=no-num id=index>Index</h2>
25022503
title="&lt;time>"><strong>6.2.</strong></a>
25032504

25042505
<li>toggle(), <a href="#toggle" title="toggle()"><strong>8.2.</strong></a>
2505-
25062506

25072507
<li>turn, <a href="#turn" title=turn><strong>6.1.</strong></a>
25082508

css3-values/Overview.src.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,9 @@ <h3 id="attr-notation">
12681268
<li>
12691269
the attr() expression's type is valid where the attr() expression is placed,
12701270

1271+
<li>
1272+
if the attribute name is given with a namespace prefix, the prefix is defined
1273+
12711274
<li>
12721275
the <var>&lt;fallback></var> is valid where the attr() expression is placed,
12731276

0 commit comments

Comments
 (0)