@@ -2854,16 +2854,44 @@ followed by the specified <<color-space>> in all-lowercase,
2854
2854
followed by ", ",
2855
2855
followed by the first specified color,
2856
2856
followed by a space,
2857
- followed by the specified (un-normalized) first percentage (unless both percentages are 50%),
2857
+ followed by the serialization of the first percentage (see below)
2858
2858
followed by ", ",
2859
2859
followed by the second specified color,
2860
- followed by the specified (un-normalized) second percentage
2861
- (unless the two specified percentages add to 100%),
2860
+ followed by the serialization of the second percentage (see below),
2862
2861
followed by ")".
2863
2862
2864
- Following the principle of shortest serialization,
2865
- the second percentage is typically omitted,
2866
- even if explicitly specified.
2863
+ The serialization of the <strong> first</strong> percentage of a declared value of a ''color-mix()'' function is defined as:
2864
+
2865
+ - If BOTH the first percentage |p1| and second percentage |p2| are specified:
2866
+ - if both |p1| equals 50% and |p2| equals 50%, nothing is serialized. <!-- (a) -->
2867
+ - else, |p1| is serialized as is. <!-- (b) -->
2868
+ - else if ONLY the first percentage |p1| is specified:
2869
+ - if |p1| is equal to 50%, nothing is serialized. <!-- (c) -->
2870
+ - else, |p1| is serialized as is. <!-- (d) -->
2871
+ - else if ONLY the second percentage |p2| is specified:
2872
+ - if |p2| equals 50%, nothing is serialized. <!-- (e) -->
2873
+ - if |p2| is not ''calc()'' , the value of 100% - |p2| is serialized. <!-- (f)-->
2874
+ - else, nothing is serialized. <!-- (g) -->
2875
+ - else if NEITHER is specified:
2876
+ - nothing is serialized. <!-- (h) -->
2877
+
2878
+ The serialization of the <strong> second</strong> percentage of a declared value of a ''color-mix()'' function is defined as:
2879
+
2880
+ - If BOTH the first percentage p1 and second percentages p2 are specified:
2881
+ - if neither p1 nor p2 is calc(), and p1 + p2 equals 100%, nothing is serialized. <!-- (i) -->
2882
+ - else, p2 is serialized as is. <!-- (j) -->
2883
+ - else if ONLY the first percentage p1 is specified:
2884
+ - nothing is serialized. <!-- (k) -->
2885
+ - else if ONLY the second percentage p2 is specified:
2886
+ - if p2 equals 50%, nothing is serialized. <!-- (l) -->
2887
+ - if p2 is not calc(), nothing is serialized. <!-- (m) -->
2888
+ - else, p2 is serialized as is. <!-- (n) -->
2889
+ - else if NEITHER is specified:
2890
+ - nothing is serialized. <!-- (o) -->
2891
+
2892
+ Note: ''calc()'' values are consider to be unknown,
2893
+ so are <strong> never</strong> equal 50%,
2894
+ and never sum with something else to equal 100%.
2867
2895
2868
2896
<div class="example" id="ex-serial-specified-mix">
2869
2897
For example, the serialized declared value of
0 commit comments