-
Notifications
You must be signed in to change notification settings - Fork 705
/
Copy pathpatch
54 lines (50 loc) · 2.31 KB
/
patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/css-values-3/Overview.bs b/css-values-3/Overview.bs
index 9609617..3a6fdf9 100644
--- a/css-values-3/Overview.bs
+++ b/css-values-3/Overview.bs
@@ -1438,12 +1438,12 @@ Mathematical Expressions: ''calc()''</h3>
<<frequency>>,
<<angle>>,
<<time>>,
+ <<percentage>>,
<<number>>, or
<<integer>>
values are allowed.
- Components of a ''calc()'' expression can be literal values,
- ''attr()'' or ''calc()'' expressions,
- or <<percentage>> values that resolve to one of the preceding types.
+ Components of a ''calc()'' expression can be literal values or
+ ''attr()'' or ''calc()'' expressions.
<div class="example">
<pre>
@@ -1534,6 +1534,7 @@ Type Checking</h4>
<<frequency>>,
<<angle>>,
<<time>>,
+ <<percentage>>,
<<number>>, or
<<integer>>.
The <a>resolved type</a> must be valid for where the expression is placed;
@@ -1545,8 +1546,13 @@ Type Checking</h4>
An ''attr()'' expression's type is given by its <<type-or-unit>> argument.
If percentages are accepted in the context in which the expression is placed,
- a <<percentage-token>> has the type of the value that percentages are relative to;
- otherwise, a math expression containing percentages is invalid.
+ a <<percentage-token>> has the type of the value that percentages are relative to.
+ For example, in the 'width' property, percentages have the <<length>> type,
+ and in 'opacity' they have the <<number>> type.
+ A percentage only has the <<percentage>> type if in that context
+ <<percentage>> values are not used-value compatible with any other type.
+ If percentages are not normally allowed in place of the ''calc()'',
+ then a ''calc()'' expression containing percentages is invalid in that context.
Operators form sub-expressions, which gain types based on their arguments.
To make expressions simpler,
@@ -2044,6 +2050,9 @@ Changes</h2>
<li>Added definition of <<ident>> notation to definition of <a>identifiers</a>.
<li>Added <<length-percentage>> as a shorthand for <<length>> | <<percentage>>,
along with equivalent productions for angles, numbers, times, and frequencies.
+ <li>Allowed <<percentage>>s inside ''calc()'' to resolve as their own type,
+ if they occur in some (as yet theoretical) context
+ where they are not compatible with any other type.
<li>Various clarifications and editorial improvements.
</ul>