Skip to content

Commit 87d3e77

Browse files
committed
[css-cascade] Synchronize L3 and L4 and update changes lists.
1 parent f7ff6f5 commit 87d3e77

2 files changed

Lines changed: 157 additions & 75 deletions

File tree

css-cascade-3/Overview.bs

Lines changed: 78 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ Introduction</h2>
3939
The rules for finding the specified value for all properties on all elements in the document are described in this specification.
4040
The rules for finding the specified values in the page context and its margin boxes are described in [[CSS3PAGE]].
4141

42+
<h3 id="placement">
43+
Module Interactions</h3>
44+
45+
<em>This section is normative.</em>
46+
47+
This module replaces and extends
48+
the rules for assigning property values, cascading, and inheritance defined in [[!CSS21]] chapter 6.
49+
50+
Other CSS modules may expand the definitions of some of the syntax and features defined here.
51+
For example, the Media Queries Level 4 specification,
52+
when combined with this module, expands the definition of
53+
the <<media-query>> value type as used in this specification.
4254

4355
<!--
4456
███████ ████ ██ ██ ████████ ███████ ████████ ████████
@@ -85,14 +97,14 @@ Importing Style Sheets: the ''@import'' rule</h2>
8597
states the conditions under which it applies.
8698

8799
If a <<string>> is provided,
88-
it must be interpreted as a url with the same value.
100+
it must be interpreted as a <<url>> with the same value.
89101

90102
<div class="example">
91103
The following lines are equivalent in meaning
92104
and illustrate both ''@import'' syntaxes
93105
(one with ''url()'' and one with a bare string):
94106

95-
<pre>
107+
<pre class='lang-css'>
96108
@import "mystyle.css";
97109
@import url("mystyle.css");
98110
</pre>
@@ -113,7 +125,7 @@ Importing Style Sheets: the ''@import'' rule</h2>
113125
<div class=example>
114126
The following rules illustrate how ''@import'' rules can be made media-dependent:
115127

116-
<pre>
128+
<pre class='lang-css'>
117129
@import url("fineprint.css") print;
118130
@import url("bluish.css") projection, tv;
119131
@import url("narrow.css") handheld and (max-width: 400px);
@@ -130,7 +142,7 @@ Importing Style Sheets: the ''@import'' rule</h2>
130142
it is perfectly appropriate for a UA to fetch a style sheet only once,
131143
even though it's linked or imported multiple times.
132144

133-
The <a>origin</a> of an imported style sheet is the same as the <a>origin</a> of the style sheet that imported it.
145+
The <a>origin</a> of an imported style sheet is the <a>origin</a> of the style sheet that imported it.
134146

135147
The <a>environment encoding</a> of an imported style sheet is the encoding of the style sheet that imported it. [[CSS3SYN]]
136148

@@ -188,19 +200,20 @@ Shorthand Properties</h2>
188200
is a <a>shorthand</a> property for setting <a property>font-style</a>, <a property>font-variant</a>, <a property>font-weight</a>, 'font-size', 'line-height', and <a property>font-family</a> all at once.
189201
The multiple declarations of this example:
190202

191-
<pre>
192-
h1 {
193-
font-weight: bold;
194-
font-size: 12pt;
195-
line-height: 14pt;
196-
font-family: Helvetica;
197-
font-variant: normal;
198-
font-style: normal;
199-
}</pre>
203+
<pre class='lang-css'>
204+
h1 {
205+
font-weight: bold;
206+
font-size: 12pt;
207+
line-height: 14pt;
208+
font-family: Helvetica;
209+
font-variant: normal;
210+
font-style: normal;
211+
}
212+
</pre>
200213

201214
can therefore be rewritten as
202215

203-
<pre>h1 { font: bold 12pt/14pt Helvetica }</pre>
216+
<pre class='lang-css'>h1 { font: bold 12pt/14pt Helvetica }</pre>
204217

205218
As more 'font' <a>sub-properties</a> are introduced into CSS,
206219
the shorthand declaration resets those to their initial values as well.
@@ -236,7 +249,8 @@ Resetting All Properties: the 'all' property</h3>
236249
Value: initial | inherit | unset
237250
</pre>
238251

239-
The 'all' property is a <a>shorthand</a> that resets <em>all</em> CSS properties
252+
The 'all' property is a <a>shorthand</a>
253+
that resets <em>all</em> CSS properties
240254
except 'direction' and 'unicode-bidi'.
241255
It only accepts the <a href="https://www.w3.org/TR/css3-values/#common-keywords">CSS-wide keywords</a>.
242256
It does not reset <a>custom properties</a> [[css-variables-1]].
@@ -670,7 +684,7 @@ Cascading</h2>
670684
</ul>
671685
</dl>
672686

673-
The <dfn>output of the cascade</dfn>
687+
The <dfn export>output of the cascade</dfn>
674688
is a (potentially empty) sorted list of <a>declared values</a> for each property on each element.
675689

676690

@@ -703,17 +717,17 @@ Cascading Origins</h3>
703717
A user agent's default style sheet should present the elements of the document language
704718
in ways that satisfy general presentation expectations for the document language
705719
(e.g., for visual browsers, the EM element in HTML is presented using an italic font).
706-
See e.g. the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints">HTML user agent style sheet</a>. [[HTML5]]
720+
See e.g. the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints">HTML user agent style sheet</a>. [[HTML]]
707721
</dl>
708722

709723
Extensions to CSS define the following additional <a>origins</a>:
710724

711725
<dl>
712-
<dt id='cascade-origin-animation'>Animation
726+
<dt><dfn export id='cascade-origin-animation'>Animation Origin</dfn>
713727
<dd>
714728
CSS Animations [[CSS3-ANIMATIONS]] generate “virtual” rules representing their effects when running.
715729

716-
<dt id='cascade-origin-transition'>Transition
730+
<dt><dfn export id='cascade-origin-transition'>Transition Origin</dfn>
717731
<dd>
718732
Like CSS Animations, CSS Transitions [[CSS3-TRANSITIONS]] generate “virtual” rules representing their effects when running.
719733
</dl>
@@ -733,7 +747,7 @@ Important Declarations: the ''!important'' annotation</h3>
733747
in its value are the delimiter token ''!'' followed by the identifier token ''important''.
734748

735749
<div class='example'>
736-
<pre>[hidden] { display: none !important; }</pre>
750+
<pre class='lang-css'>[hidden] { display: none !important; }</pre>
737751
</div>
738752

739753
An <a>important</a> declaration takes precedence over a normal declaration.
@@ -761,7 +775,7 @@ Important Declarations: the ''!important'' annotation</h3>
761775
Also, the third author rule will lose to the second author rule since the second declaration is ''!important''.
762776
This shows that ''!important'' declarations have a function also within author style sheets.
763777

764-
<pre>
778+
<pre class='lang-css'>
765779
/* From the user's style sheet */
766780
p { text-indent: 1em !important }
767781
p { font-style: italic !important }
@@ -876,14 +890,13 @@ Explicit Defaulting</h3>
876890
Resetting a Property: the ''initial'' keyword</h4>
877891

878892
If the <a>cascaded value</a> is the <dfn for=all>''initial''</dfn> keyword,
879-
the property's <a>initial value</a> becomes its <a>specified value</a>.
893+
the property's <a>specified value</a> is its <a>initial value</a>.
880894

881895
<h4 id="inherit">
882896
Explicit Inheritance: the ''inherit'' keyword</h4>
883897

884898
If the <a>cascaded value</a> of a property is the <dfn for=all>''inherit''</dfn> keyword,
885-
the <a>inherited value</a> becomes the property's <a lt="specified value">specified</a> and <a>computed values</a>.
886-
899+
the property's <a lt="specified value">specified</a> and <a>computed values</a> are the <a>inherited value</a>.
887900
<h4 id="inherit-initial">
888901
Erasing All Declarations: the ''unset'' keyword</h4>
889902

@@ -911,20 +924,51 @@ Changes</h2>
911924
<h3 id="changes-2016">
912925
Changes Since the 19 May 2016 Candidate Recommendation</h3>
913926

914-
The following changes were made to this specification since the
927+
The following non-trivial changes were made to this specification since the
915928
<a href="https://www.w3.org/TR/2016/CR-css-cascade-3-20160519/">19 May 2016 Candidate Recommendation</a>:
916929

917-
* Clarified that <a>custom properties</a> are not reset by the 'all' shorthand.
918-
(<a href="https://github.com/w3c/csswg-drafts/issues/2518">2518</a>)
930+
<ul>
931+
<li id="change-2016-custom-all">
932+
Clarified that <a>custom properties</a> are not reset by the 'all' shorthand.
933+
(<a href="https://github.com/w3c/csswg-drafts/issues/2518">2518</a>)
934+
<blockquote>
935+
<p>The 'all' property is a <a>shorthand</a> that resets <em>all</em> CSS properties
936+
except 'direction' and 'unicode-bidi'.
937+
&hellip;
938+
<ins>It does not reset <a>custom properties</a> [[css-variables-1]].</ins>
939+
</blockquote>
919940

920-
* Defined more precisely that imported stylesheets are interpreted separately from the importing stylesheet,
921-
in terms of ordering of rules, etc.
941+
<li id="change-2016-import">
942+
Called out two exceptions in which importing a style sheet
943+
is different from merely inserting its contents.
944+
<blockquote>
945+
<p>If an ''@import'' rule refers to a valid stylesheet,
946+
user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule<ins>,
947+
with two exceptions:</ins></p>
948+
949+
<ins><ul>
950+
<li>If a feature
951+
(such as the ''@namespace'' rule)
952+
<em>explicitly</em> defines that it only applies to a particular stylesheet,
953+
and not any imported ones,
954+
then it doesn't apply to the imported stylesheet.
955+
956+
<li>If a feature relies on the relative ordering of two or more constructs in a stylesheet
957+
(such as the requirement that ''@charset'' must not have any other content preceding it),
958+
it only applies between constructs in the same stylesheet.
959+
</ul></ins>
960+
</blockquote>
922961

923-
* Removed any mention of scoped stylesheets,
924-
as the feature was removed from HTML.
962+
<li id="change-2016-scope">
963+
Removed any mention of scoped stylesheets,
964+
as the feature was removed from HTML.
965+
(<a href="https://github.com/w3c/csswg-drafts/issues/637">Issue 637</a>)
925966

926-
* Removed any mention of the “override” origin,
927-
originally defined by <a href="https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/">DOM Level 2 Style</a>.
967+
<li id="change-2016-override">
968+
Removed any mention of the obsolete “override” origin,
969+
originally defined by <a href="https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/">DOM Level 2 Style</a>
970+
and later abandoned.
971+
</ul>
928972

929973
A <a href="https://drafts.csswg.org/css-cascade-3/issues-cr-2016">Disposition of Comments</a> is available.
930974

@@ -967,7 +1011,7 @@ Changes Since the 3 October 2013 Candidate Recommendation</h3>
9671011

9681012

9691013
<h3 id="changes-2">
970-
Additions to Level 2</h3>
1014+
Additions Since Level 2</h3>
9711015

9721016
The following features have been added since
9731017
<a href="http://www.w3.org/TR/CSS2/cascade.html">Level 2</a>:

0 commit comments

Comments
 (0)