Skip to content

Commit a33ac34

Browse files
committed
[css-cascade] Preemptively remove 'default' so we can clean up other problems.
1 parent 9fed7ff commit a33ac34

2 files changed

Lines changed: 40 additions & 122 deletions

File tree

css-cascade/Overview.html

Lines changed: 29 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,14 @@ <h2 class="no-num no-toc" id=table-of-contents> Table of contents</h2>
181181

182182
<li><a href="#cascaded-value"><span class=secno>4.2.4. </span> The
183183
Cascaded Value</a>
184-
</ul>
185184

186-
<li><a href="#defaulting"><span class=secno>4.3. </span> Inheritance and
187-
Defaulting</a>
188-
<ul class=toc>
189-
<li><a href="#initial"><span class=secno>4.3.1. </span> Initial value:
185+
<li><a href="#initial"><span class=secno>4.2.5. </span> Initial value:
190186
the ‘<code class=css>initial</code>’ keyword</a>
191187

192-
<li><a href="#inheritance"><span class=secno>4.3.2. </span>
188+
<li><a href="#inheritance"><span class=secno>4.2.6. </span>
193189
Inheritance: the ‘<code class=css>inherit</code>’ keyword</a>
194190

195-
<li><a href="#default"><span class=secno>4.3.3. </span> Rolling back
196-
the cascade: the ‘<code class=css>default</code>’ keyword</a>
197-
198-
<li><a href="#no-value"><span class=secno>4.3.4. </span> When There Is
191+
<li><a href="#no-value"><span class=secno>4.2.7. </span> When There Is
199192
No Cascaded Value</a>
200193
</ul>
201194
</ul>
@@ -428,7 +421,7 @@ <h3 id=all-shorthand><span class=secno>3.1. </span> Resetting All
428421
<tr>
429422
<th>Value:
430423

431-
<td>initial | inherit | default
424+
<td>initial | inherit
432425

433426
<tr>
434427
<th>Initial:
@@ -474,12 +467,15 @@ <h3 id=all-shorthand><span class=secno>3.1. </span> Resetting All
474467

475468
<div class=example>
476469
<p> For example, if an author specifies ‘<code class=css>all:
477-
default</code>’ on an element it will block all inheritance and reset
478-
all properties, as if no rules appeared in the author level of the
479-
cascade.
470+
initial</code>’ on an element it will block all inheritance and reset
471+
all properties, as if no rules appeared in the author, user, or
472+
user-agent levels of the cascade.
480473

481474
<p> This can be useful for the root element of a "widget" included in a
482-
page, which does not wish to inherit the styles of the outer page.
475+
page, which does not wish to inherit the styles of the outer page. Note,
476+
however, that any "default" style applied to that element (such as, e.g.
477+
<code class=css>display: block</code>’ from the UA style sheet on
478+
block elements such as <code>&lt;div></code>) will also be blown away.
483479
</div>
484480

485481
<h2 id=cascade-and-inheritance><span class=secno>4. </span> Cascading and
@@ -773,32 +769,28 @@ <h4 id=preshint><span class=secno>4.2.3. </span> Precedence of Non-CSS
773769
maps its presentation attributes into the author level.
774770

775771
<p class=note> Presentational hints entering the cascade at the UA level
776-
can be overridden by user styles. Presentational hints entering the
777-
cascade at the author level can be overridden by the author's use of the
778-
<a href="#default-keyword"><code class=css>default</code></a>
779-
keyword. Host languages should choose the appropriate level for
780-
presentational hints with these considerations in mind.
772+
can be overridden by author or user styles. Presentational hints entering
773+
the cascade at the author level can be overridden by author styles, but
774+
not by non-<a href="#important"><code>!important</code></a> user styles.
775+
Host languages should choose the appropriate level for presentational
776+
hints with these considerations in mind.
781777

782778
<h4 id=cascaded-value><span class=secno>4.2.4. </span> The Cascaded Value</h4>
783779

784780
<p> The <dfn id=cascaded-value0>cascaded value</dfn> represents the result
785781
of the cascade. It is the value of the first declaration in the <a
786-
href="#output-of-the-cascade"><i>output of the cascade</i></a> (after any
787-
rollback steps have been performed, see below). If the <a
782+
href="#output-of-the-cascade"><i>output of the cascade</i></a>. If the <a
788783
href="#output-of-the-cascade"><i>output of the cascade</i></a> is an empty
789784
list, there is no cascaded value.
790785

791-
<h3 id=defaulting><span class=secno>4.3. </span> Inheritance and Defaulting</h3>
792-
793786
<p> In most cases, the <a href="#specified-value"><i>specified
794787
value</i></a> is the <a href="#cascaded-value0"><i>cascaded value</i></a>.
795788
However, the ‘<a href="#initial-keyword"><code
796-
class=css>initial</code></a>’, ‘<a href="#inherit-keyword"><code
797-
class=css>inherit</code></a>’, and ‘<a href="#default-keyword"><code
798-
class=css>default</code></a>’ values are handled specially when they are
789+
class=css>initial</code></a>’ and ‘<a href="#inherit-keyword"><code
790+
class=css>inherit</code></a>’ values are handled specially when they are
799791
the <a href="#cascaded-value0"><i>cascaded value</i></a> of a property.
800792

801-
<h4 id=initial><span class=secno>4.3.1. </span> Initial value: the ‘<a
793+
<h4 id=initial><span class=secno>4.2.5. </span> Initial value: the ‘<a
802794
href="#initial-keyword"><code class=css>initial</code></a>’ keyword</h4>
803795

804796
<p> Each property has an <dfn id=initial-value>initial value</dfn>, defined
@@ -808,7 +800,7 @@ <h4 id=initial><span class=secno>4.3.1. </span> Initial value: the ‘<a
808800
property's <a href="#initial-value"><i>initial value</i></a> becomes its
809801
<a href="#specified-value"><i>specified value</i></a>.
810802

811-
<h4 id=inheritance><span class=secno>4.3.2. </span> Inheritance: the ‘<a
803+
<h4 id=inheritance><span class=secno>4.2.6. </span> Inheritance: the ‘<a
812804
href="#inherit-keyword"><code class=css>inherit</code></a>’ keyword</h4>
813805

814806
<p> Some properties are <dfn id=inherited-properties
@@ -844,45 +836,7 @@ <h4 id=inheritance><span class=secno>4.3.2. </span> Inheritance: the ‘<a
844836
<p class=issue> Not sure if the latter is correct, or if it should be just
845837
the specified value (matching the 2.1 errata).
846838

847-
<h4 id=default><span class=secno>4.3.3. </span> Rolling back the cascade:
848-
the ‘<a href="#default-keyword"><code class=css>default</code></a>
849-
keyword</h4>
850-
851-
<p> CSS Cascading and Inheritance Level 3 introduces the <dfn
852-
id=default-keyword><code class=css>default</code></dfn> keyword as a
853-
<a href="http://www.w3.org/TR/css3-values/#common-keywords">CSS-wide
854-
keyword</a> accepted by all properties.
855-
856-
<p> If the <a href="#cascaded-value0"><i>cascaded value</i></a> is the
857-
<a href="#default-keyword"><code class=css>default</code></a>
858-
keyword, the behavior depends on the origin to which the declaration
859-
belongs:
860-
861-
<dl>
862-
<dt>user-agent origin
863-
864-
<dd> Equivalent to ‘<a href="#inherit-keyword"><code
865-
class=css>inherit</code></a>’ or ‘<a href="#initial-keyword"><code
866-
class=css>initial</code></a>’, depending on whether the property is
867-
<i>inherited</i> or not.
868-
869-
<dt>user origin
870-
871-
<dd> Rolls back the cascade to the user-agent level, so that the <a
872-
href="#specified-value"><i>specified value</i></a> is calculated as if no
873-
author-level or user-level rules were specified for this property.
874-
875-
<dt>author origin
876-
877-
<dd> Rolls back the cascade to the user level, so that the <a
878-
href="#specified-value"><i>specified value</i></a> is calculated as if no
879-
author-level rules were specified for this property. For the purpose of
880-
<a href="#default-keyword"><code class=css>default</code></a>’, this
881-
origin includes the Override and Animation <a
882-
href="#origin"><i>origins</i></a>.
883-
</dl>
884-
885-
<h4 id=no-value><span class=secno>4.3.4. </span> When There Is No Cascaded
839+
<h4 id=no-value><span class=secno>4.2.7. </span> When There Is No Cascaded
886840
Value</h4>
887841

888842
<p> Sometimes, the <a href="#output-of-the-cascade"><i>output of the
@@ -1225,9 +1179,6 @@ <h3 id=changes-2012><span class=secno>7.1. </span> Changes since the 15
12251179
href="http://www.w3.org/mid/4F570227.8060707@mit.edu">Boris Zbarsky's
12261180
suggestion</a>.
12271181

1228-
<li>Introduced ‘<a href="#default-keyword"><code
1229-
class=css>default</code></a>’ keyword.
1230-
12311182
<li>Introduced ‘<a href="#all"><code class=property>all</code></a>
12321183
shorthand.
12331184
</ul>
@@ -1381,9 +1332,6 @@ <h2 class=no-num id=index>Index</h2>
13811332
<li>computed value, <a href="#computed-value"
13821333
title="section 5.2."><strong>5.2.</strong></a>
13831334

1384-
<li><code class=css>default</code>’, <a href="#default-keyword"
1385-
title="section 4.3.3."><strong>4.3.3.</strong></a>
1386-
13871335
<li><code class=css>@import</code>’, <a href="#atimport"
13881336
title="section 2."><strong>2.</strong></a>
13891337

@@ -1394,25 +1342,25 @@ <h2 class=no-num id=index>Index</h2>
13941342
title="section 2."><strong>2.</strong></a>
13951343

13961344
<li><code class=css>inherit</code>’, <a href="#inherit-keyword"
1397-
title="section 4.3.2."><strong>4.3.2.</strong></a>
1345+
title="section 4.2.6."><strong>4.2.6.</strong></a>
13981346

13991347
<li>Inheritance, <a href="#inherit"
1400-
title="section 4.3.2."><strong>4.3.2.</strong></a>
1348+
title="section 4.2.6."><strong>4.2.6.</strong></a>
14011349

14021350
<li>inherited properties, <a href="#inherited-properties"
1403-
title="section 4.3.2."><strong>4.3.2.</strong></a>
1351+
title="section 4.2.6."><strong>4.2.6.</strong></a>
14041352

14051353
<li>inherited property, <a href="#inherited-properties"
1406-
title="section 4.3.2."><strong>4.3.2.</strong></a>
1354+
title="section 4.2.6."><strong>4.2.6.</strong></a>
14071355

14081356
<li>inherited value, <a href="#inherited-value"
1409-
title="section 4.3.2."><strong>4.3.2.</strong></a>
1357+
title="section 4.2.6."><strong>4.2.6.</strong></a>
14101358

14111359
<li><code class=css>initial</code>’, <a href="#initial-keyword"
1412-
title="section 4.3.1."><strong>4.3.1.</strong></a>
1360+
title="section 4.2.5."><strong>4.2.5.</strong></a>
14131361

14141362
<li>initial value, <a href="#initial-value"
1415-
title="section 4.3.1."><strong>4.3.1.</strong></a>
1363+
title="section 4.2.5."><strong>4.2.5.</strong></a>
14161364

14171365
<li>origin, <a href="#origin"
14181366
title="section 4.2.1."><strong>4.2.1.</strong></a>

css-cascade/Overview.src.html

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ <h3 id="all-shorthand">
241241
<td><dfn>all</dfn>
242242
<tr>
243243
<th>Value:
244-
<td>initial | inherit | default
244+
<td>initial | inherit
245245
<tr>
246246
<th>Initial:
247247
<td>See individual properties
@@ -271,13 +271,16 @@ <h3 id="all-shorthand">
271271

272272
<div class='example'>
273273
<p>
274-
For example, if an author specifies ''all: default'' on an element
274+
For example, if an author specifies ''all: initial'' on an element
275275
it will block all inheritance and reset all properties,
276-
as if no rules appeared in the author level of the cascade.
276+
as if no rules appeared in the author, user, or user-agent levels of the cascade.
277277

278278
<p>
279279
This can be useful for the root element of a "widget" included in a page,
280280
which does not wish to inherit the styles of the outer page.
281+
Note, however, that any "default" style applied to that element
282+
(such as, e.g. ''display: block'' from the UA style sheet on block elements such as <code>&lt;div></code>)
283+
will also be blown away.
281284
</div>
282285

283286
<h2 id="cascade-and-inheritance">
@@ -537,26 +540,23 @@ <h4 id="preshint">
537540
For example, [[SVG11]] maps its presentation attributes into the author level.
538541

539542
<p class="note">
540-
Presentational hints entering the cascade at the UA level can be overridden by user styles.
541-
Presentational hints entering the cascade at the author level can be overridden by the author's use of the ''default'' keyword.
543+
Presentational hints entering the cascade at the UA level can be overridden by author or user styles.
544+
Presentational hints entering the cascade at the author level can be overridden by author styles,
545+
but not by non-<code>!important</code> user styles.
542546
Host languages should choose the appropriate level for presentational hints with these considerations in mind.
543547

544548
<h4 id="cascaded-value">
545549
The Cascaded Value</h4>
546550

547551
<p>
548552
The <dfn>cascaded value</dfn> represents the result of the cascade.
549-
It is the value of the first declaration in the <i>output of the cascade</i>
550-
(after any rollback steps have been performed, see below).
553+
It is the value of the first declaration in the <i>output of the cascade</i>.
551554
If the <i>output of the cascade</i> is an empty list,
552555
there is no cascaded value.
553556

554-
<h3 id="defaulting">
555-
Inheritance and Defaulting</h3>
556-
557557
<p>
558558
In most cases, the <i>specified value</i> is the <i>cascaded value</i>.
559-
However, the ''initial'', ''inherit'', and ''default'' values
559+
However, the ''initial'' and ''inherit'' values
560560
are handled specially when they are the <i>cascaded value</i> of a property.
561561

562562
<h4 id="initial">
@@ -601,35 +601,6 @@ <h4 id="inheritance">
601601
<p class='issue'>
602602
Not sure if the latter is correct, or if it should be just the specified value (matching the 2.1 errata).
603603

604-
<h4 id="default">
605-
Rolling back the cascade: the ''default'' keyword</h4>
606-
607-
<p>
608-
CSS Cascading and Inheritance Level 3 introduces the <dfn id="default-keyword">''default''</dfn> keyword
609-
as a <a href="http://www.w3.org/TR/css3-values/#common-keywords">CSS-wide keyword</a>
610-
accepted by all properties.
611-
612-
<p>
613-
If the <i>cascaded value</i> is the ''default'' keyword,
614-
the behavior depends on the origin to which the declaration belongs:
615-
616-
<dl>
617-
<dt>user-agent origin
618-
<dd>
619-
Equivalent to ''inherit'' or ''initial'', depending on whether the property is <i>inherited</i> or not.
620-
621-
<dt>user origin
622-
<dd>
623-
Rolls back the cascade to the user-agent level,
624-
so that the <i>specified value</i> is calculated as if no author-level or user-level rules were specified for this property.
625-
626-
<dt>author origin
627-
<dd>
628-
Rolls back the cascade to the user level,
629-
so that the <i>specified value</i> is calculated as if no author-level rules were specified for this property.
630-
For the purpose of ''default'', this origin includes the Override and Animation <i>origins</i>.
631-
</dl>
632-
633604
<h4 id='no-value'>
634605
When There Is No Cascaded Value</h4>
635606

@@ -899,7 +870,6 @@ <h3 id="changes-2012">
899870
<li>Imported and updated <a href="#value-stages">Stages of Value Computation</a> section
900871
from old drafts of <a href="http://www.w3.org/TR/css3-values/">CSS Values and Units</a>.
901872
<li>Introduced <a href="#cascade-scope">scoping</a> per <a href="http://www.w3.org/mid/4F570227.8060707@mit.edu">Boris Zbarsky's suggestion</a>.
902-
<li>Introduced ''default'' keyword.
903873
<li>Introduced 'all' shorthand.
904874
</ul>
905875

0 commit comments

Comments
 (0)