[go: nahoru, domu]

Skip to content

Commit

Permalink
[css-cascade] Crosslink 'declaration' more often. #6837
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Mar 30, 2022
1 parent 472343b commit e56d2c7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 59 deletions.
22 changes: 11 additions & 11 deletions css-cascade-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Importing Style Sheets: the ''@import'' rule</h2>
it only applies between constructs in the same stylesheet.

<p class='example'>
For example, declarations in style rules from imported stylesheets interact with the cascade
For example, [=declarations=] in style rules from imported stylesheets interact with the cascade
as if they were written literally into the stylesheet at the point of the ''@import''.

Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
Expand Down Expand Up @@ -223,14 +223,14 @@ Shorthand Properties</h2>
each “missing” <a>sub-property</a> is assigned its <a>initial value</a>.

<div class='note'>
This means that a <a>shorthand</a> property declaration always sets <em>all</em> of its <a>sub-properties</a>,
This means that a <a>shorthand</a> [=property declaration=] always sets <em>all</em> of its <a>sub-properties</a>,
even those that are not explicitly set.
Carelessly used, this might result in inadvertently resetting some <a>sub-properties</a>.
Carefully used, a <a>shorthand</a> can guarantee a “blank slate”
by resetting <a>sub-properties</a> inadvertently cascaded from other sources.

For example, writing ''background: green'' rather than ''background-color: green''
ensures that the background color overrides any earlier declarations
ensures that the background color overrides any earlier [=declarations=]
that might have set the background to an image with 'background-image'.
</div>

Expand Down Expand Up @@ -274,7 +274,7 @@ Shorthand Properties</h2>
If a <a>shorthand</a> is specified as one of the <a href="https://www.w3.org/TR/css-values/#common-keywords">CSS-wide keywords</a> [[!css-values-3]],
it sets all of its <a>sub-properties</a> to that keyword,
including any that are <a>reset-only sub-properties</a>.
(Note that these keywords cannot be combined with other values in a single declaration, not even in a shorthand.)
(Note that these keywords cannot be combined with other values in a single [=declaration=], not even in a shorthand.)

Declaring a <a>shorthand</a> property to be ''!important''
is equivalent to declaring all of its <a>sub-properties</a> to be ''!important''.
Expand Down Expand Up @@ -649,7 +649,7 @@ Examples</h3>
Filtering</h2>

In order to find the <a>declared values</a>,
implementations must first identify all declarations that apply to each element.
implementations must first identify all [=declarations=] that apply to each element.
A declaration applies to an element if:

<ul>
Expand All @@ -668,7 +668,7 @@ Filtering</h2>
and the declaration's value matches the syntax for that property.
</ul>

The values of the declarations that apply form,
The values of the [=declarations=] that apply form,
for each property on each element,
a list of <a>declared values</a>.
The next section,
Expand All @@ -692,19 +692,19 @@ Cascading</h2>
The <dfn export>cascade</dfn>
takes an unordered list of <a>declared values</a>
for a given property on a given element,
sorts them by their declaration’s precedence as determined below,
sorts them by their [=declaration’s=] precedence as determined below,
and outputs a single <a>cascaded value</a>.

<h3 id="cascade-sort">
Cascade Sorting Order</h3>

The cascade sorts declarations according to the following criteria,
The cascade sorts [=declarations=] according to the following criteria,
in descending order of precedence:

<dl>
<dt id='cascade-origin'>Origin and Importance
<dd>
The <a>origin</a> of a declaration is based on where it comes from
The <a>origin</a> of a [=declaration=] is based on where it comes from
and its <a lt="important">importance</a> is
whether or not it is declared with ''!important''
(see [[#importance|below]]).
Expand Down Expand Up @@ -805,10 +805,10 @@ Important Declarations: the ''!important'' annotation</h3>
CSS attempts to create a balance of power between author and user style sheets.
By default, rules in an author's style sheet override those in a user's style sheet,
which override those in the user-agent's default style sheet.
To balance this, a declaration can be marked [=important=],
To balance this, a [=declaration=] can be marked [=important=],
which increases its weight in the cascade and inverts the order of precedence.

A declaration is <dfn export local-lt="importance">important</dfn>
A [=declaration=] is <dfn export local-lt="importance">important</dfn>
if it has a ''!important'' annotation as defined by [[css-syntax-3]],
i.e. if the last two (non-whitespace, non-comment) tokens
in its value are the delimiter token ''!'' followed by the identifier token ''important''.
Expand Down
36 changes: 18 additions & 18 deletions css-cascade-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ Introduction</h2>

One of the fundamental design principles of CSS is <a lt="cascade">cascading</a>,
which allows several style sheets to influence the presentation of a document.
When different declarations try to set a value for the same element/property combination,
When different [=declarations=] try to set a value for the same element/property combination,
the conflicts must somehow be resolved.

The opposite problem arises when no declarations try to set a value for an element/property combination.
The opposite problem arises when no [=declarations=] try to set a value for an element/property combination.
In this case, a value is be found by way of <a>inheritance</a>
or by looking at the property's <a>initial value</a>.

The <a href="#cascade">cascading</a> and <a href="#defaulting">defaulting</a> process takes a set of declarations as input,
The <a href="#cascade">cascading</a> and <a href="#defaulting">defaulting</a> process takes a set of [=declarations=] as input,
and outputs a <a>specified value</a> for each property on each element.

The rules for finding the specified value for all properties on all elements in the document are described in this specification.
Expand Down Expand Up @@ -151,7 +151,7 @@ Importing Style Sheets: the ''@import'' rule</h2>
it only applies between constructs in the same stylesheet.

<p class='example'>
For example, declarations in style rules from imported stylesheets interact with the cascade
For example, [=declarations=] in style rules from imported stylesheets interact with the cascade
as if they were written literally into the stylesheet at the point of the ''@import''.

Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
Expand Down Expand Up @@ -353,14 +353,14 @@ Shorthand Properties</h2>
each “missing” <a>sub-property</a> is assigned its <a>initial value</a>.

<div class='note'>
This means that a <a>shorthand</a> property declaration always sets <em>all</em> of its <a>sub-properties</a>,
This means that a <a>shorthand</a> [=property declaration=] always sets <em>all</em> of its <a>sub-properties</a>,
even those that are not explicitly set.
Carelessly used, this might result in inadvertently resetting some <a>sub-properties</a>.
Carefully used, a <a>shorthand</a> can guarantee a “blank slate”
by resetting <a>sub-properties</a> inadvertently cascaded from other sources.

For example, writing ''background: green'' rather than ''background-color: green''
ensures that the background color overrides any earlier declarations
ensures that the background color overrides any earlier [=declarations=]
that might have set the background to an image with 'background-image'.
</div>

Expand Down Expand Up @@ -404,7 +404,7 @@ Shorthand Properties</h2>
If a <a>shorthand</a> is specified as one of the <a href="https://www.w3.org/TR/css-values/#common-keywords">CSS-wide keywords</a> [[!css-values-3]],
it sets all of its <a>sub-properties</a> to that keyword,
including any that are <a>reset-only sub-properties</a>.
(Note that these keywords cannot be combined with other values in a single declaration, not even in a shorthand.)
(Note that these keywords cannot be combined with other values in a single [=declaration=], not even in a shorthand.)

Declaring a <a>shorthand</a> property to be ''!important''
is equivalent to declaring all of its <a>sub-properties</a> to be ''!important''.
Expand Down Expand Up @@ -556,13 +556,13 @@ Value Processing</h2>
or are not part of the document’s [=flattened element tree=]
do not participate in CSS value processing,
and do not have [=declared=], [=cascaded=], [=specified=], [=computed=], [=used=], or [=actual=] values,
even if they potentially have style declarations assigned to them
even if they potentially have style [=declarations=] assigned to them
(for example, by a <code>style</code> attribute).

<h3 id="declared">
Declared Values</h3>

Each property declaration <a href="#filtering">applied to an element</a>
Each [=property declaration=] <a href="#filtering">applied to an element</a>
contributes a <dfn export local-lt="declared">declared value</dfn> for that property
associated with the element.
See <a href="#filtering">Filtering Declarations</a> for details.
Expand Down Expand Up @@ -884,7 +884,7 @@ Examples</h3>
Filtering</h2>

In order to find the <a>declared values</a>,
implementations must first identify all declarations that apply to each element.
implementations must first identify all [=declarations=] that apply to each element.
A declaration applies to an element if:

<ul>
Expand All @@ -904,7 +904,7 @@ Filtering</h2>
and the declaration's value matches the syntax for that property.
</ul>

The values of the declarations that apply form,
The values of the [=declarations=] that apply form,
for each property on each element,
a list of <a>declared values</a>.
The next section,
Expand All @@ -928,19 +928,19 @@ Cascading</h2>
The <dfn export>cascade</dfn>
takes an unordered list of <a>declared values</a>
for a given property on a given element,
sorts them by their declaration’s precedence as determined below,
sorts them by their [=declaration’s=] precedence as determined below,
and outputs a single <a>cascaded value</a>.

<h3 id="cascade-sort">
Cascade Sorting Order</h3>

The cascade sorts declarations according to the following criteria,
The cascade sorts [=declarations=] according to the following criteria,
in descending order of precedence:

<dl>
<dt id='cascade-origin'>Origin and Importance
<dd>
The <a>origin</a> of a declaration is based on where it comes from
The <a>origin</a> of a [=declaration=] is based on where it comes from
and its <a lt="important">importance</a> is
whether or not it is declared with ''!important''
(see [[#importance|below]]).
Expand All @@ -961,7 +961,7 @@ Cascade Sorting Order</h3>

<dt id='cascade-context'>Context
<dd>
A document language can provide for blending declarations sourced
A document language can provide for blending [=declarations=] sourced
from different <dfn local-lt="context">encapsulation contexts</dfn>,
such as the nested [=tree contexts=] of [=shadow trees=] in the [[!DOM]].

Expand Down Expand Up @@ -1063,10 +1063,10 @@ Important Declarations: the ''!important'' annotation</h3>
CSS attempts to create a balance of power between author and user style sheets.
By default, rules in an author's style sheet override those in a user's style sheet,
which override those in the user-agent's default style sheet.
To balance this, a declaration can be marked [=important=],
To balance this, a [=declaration=] can be marked [=important=],
which increases its weight in the cascade and inverts the order of precedence.

A declaration is <dfn export local-lt="importance">important</dfn>
A [=declaration=] is <dfn export local-lt="importance">important</dfn>
if it has a ''!important'' annotation as defined by [[css-syntax-3]],
i.e. if the last two (non-whitespace, non-comment) tokens
in its value are the delimiter token ''!'' followed by the identifier token ''important''.
Expand Down Expand Up @@ -1259,7 +1259,7 @@ Rolling Back Cascade Origins: the ''revert'' keyword</h4>

If the <a>cascaded value</a> of a property is
the <dfn value for=all caniuse="css-revert-value">revert</dfn> keyword,
the behavior depends on the [=cascade origin=] to which the declaration belongs:
the behavior depends on the [=cascade origin=] to which the [=declaration=] belongs:

<dl>
<dt>[=user-agent origin=]
Expand Down
Loading

0 comments on commit e56d2c7

Please sign in to comment.