Open fantasai opened 6 years ago
Proposed edits:
diff --git a/css-images-3/Overview.bs b/css-images-3/Overview.bs
index 701eb90..aef55a8 100644
--- a/css-images-3/Overview.bs
+++ b/css-images-3/Overview.bs
@@ -1681,8 +1681,38 @@ Interpolating cross-fade() {#interpolating-image-combinations}
--------------------------------------------------------------
The three components of ''cross-fade()'' are interpolated independently.
+ However, if the two arguments match,
+ but are in opposite orders,
+ then first invert the percentage and
+ reverse the order of the images of the second ''cross-fade()''
+ before interpolating.
Note this may result in nested ''cross-fade()'' notations.
+ <div class="example">
+ The following table shows some examples of image interpolation.
+
+ <table class="data">
+ <thead>
+ <tr>
+ <th>Start Image
+ <th>End Image
+ <th>50% Interpolation
+ <tbody>
+ <tr>
+ <td>''cross-fade(20% A, B)''
+ <td>''cross-fade(40% A, B)''
+ <td>''cross-fade(30% A, B)''
+ <tr>
+ <td>''cross-fade(20% A, B)''
+ <td>''cross-fade(60% B, A)''
+ <td>''cross-fade(30% A, B)''
+ <tr>
+ <td>''cross-fade(20% A, B)''
+ <td>''cross-fade(20% A, C)''
+ <td>''cross-fade(20% A, cross-fade(50% B, C)''
+ </table>
+ </div>
+
Should probably flip start argument rather than end argument, actually.
The Working Group just discussed Images Level 3
, and agreed to the following:
RESOLVED: cross-fade() takes one or more args, each has an optional %
RESOLVED: At computed value time, simplify directly nested cross-fade()s into a single cross-fade()
RESOLVED: At computed value time we collapse same <image> values in cross-fade()s and adding their percentages
See official minutes
Could you please also clarify where is the cross-fade()
function currently defined? I see a reference to it in css-image-3, but it seems to link to the definition in css-image-4. Is it intended or did I miss something?
Yeah, it's defined in level 4.
Currently we spec that the arguments to
cross-fade()
are interpolated independently. However, this doesn't handle the case ofcross-fade(A, B)
tocross-fade(B, A)
very nicely: it ends up creating a tree of cross-fades where one isn't necessary.This is particularly a concern when the cross-fades are triggered by transitions which are reversed partway.