Skip to content

Commit 6fce0ff

Browse files
committed
[css-values] Correct regressions from https://hg.csswg.org/drafts/rev/7bb70a0516c3 , clean up prose, and remove incorrect example.
1 parent 6ee2043 commit 6fce0ff

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

css-values/Overview.bs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -661,16 +661,18 @@ Percentages: the <<percentage>> type</h3>
661661
It corresponds to the <<percentage-token>> production
662662
in the <a href="https://www.w3.org/TR/css-syntax/">CSS Syntax Module</a> [[!CSS3SYN]].
663663

664-
Percentage values are often relative to another value,
664+
Percentage values are always relative to another measurement,
665665
for example a length.
666-
Each property that allows percentages also defines the value to which the percentage refers.
667-
The value may be that of another property for the same element,
668-
a property for an ancestor element,
669-
or a value of the formatting context
666+
Each property that allows percentages also defines the measurement to which the percentage refers.
667+
This measurement can be a value of another property for the same element,
668+
that of a property for an ancestor element,
669+
or a measurement of the formatting context
670670
(e.g., the width of a <a>containing block</a>).
671-
While such "relative" percentages are often indicated in prose,
672-
they can also be indicated with an explicit grammar term,
673-
one for each basic <a>dimension</a> type:
671+
672+
In cases where a <<percentage>> can represent the same quantity
673+
as a <a>dimension</a> or <a>number</a> in the same <a>component value</a> position,
674+
and can therefore be combined with them in a ''calc()'' expression,
675+
the following convenience notations may be used in the property grammar:
674676

675677
: <dfn>&lt;length-percentage></dfn>
676678
:: Equivalent to <code class=prod>[ <<length>> | <<percentage>> ]</code>,
@@ -689,21 +691,19 @@ Percentages: the <<percentage>> type</h3>
689691
where the <<percentage>> will resolve to a <<number>>.
690692

691693
<div class="example">
692-
For example, in the 'width' property <<percentage>> values are relative to the width of the containing block.
693-
If the containing block is ''1000px'' wide,
694+
For example, in the 'width' property <<percentage>> values are relative to the width of the containing block,
695+
and therefore represent a length,
696+
just as <<length>> values do:
697+
if the containing block is ''1000px'' wide,
694698
then ''width: 500px;'' and ''width: 50%'' have the exact same behavior.
695699
This means that ''width: calc(500px + 50%);'' is allowed--
696-
it has the same behavior as ''width: calc(500px + 500px)'',
700+
in this context it has the same behavior as ''width: calc(500px + 500px)'',
697701
which is an easy length+length calculation.
698702

699703
On the other hand, the second and third arguments of the ''hsl()'' function are bare <<percentage>>s,
700-
not relative to any other value.
704+
not relative to any other numerical syntax.
701705
They cannot be combined with anything in ''calc()''
702706
(except themselves, in useless expressions like ''calc(10% + 20%)'').
703-
704-
An exceptional case is 'background-position'--
705-
there, <<percentage>>s and <<length>>s actually cause different behavior/interpretations.
706-
However, there is prose defining how to interpret a ''calc()'' mixing the two in that context.
707707
</div>
708708

709709
<h3 id='dimensions'>

0 commit comments

Comments
 (0)