Skip to content

Commit 1e1e534

Browse files
committed
Apply mix-blend-mode and isolation in algo steps
1 parent 1b9fc28 commit 1e1e534

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,7 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
292292
}
293293
```
294294

295-
In addition to above, styles in the [=document/view transition style sheet=] add ''isolation: isolate'' to this pseudo-element
296-
if it has both ''::view-transition-new()'' and ''::view-transition-old()'' as children.
297-
298-
Issue: This reads like a non-normative note, but it's normative. This rule should be specified at the same time as other styles, when the condition above can be determined.
299-
300-
Note: The aim of the style is to position the element to occupy the same space as its ''::view-transition-group()'' element
301-
and provide isolation for blending.
302-
303-
Issue: Isolation is only necessary to get the right cross-fade between new and old image pixels.
304-
Would it be simpler to always add it and try to optimize in the implementation?
295+
Note: The aim of the style is to position the element to occupy the same space as its ''::view-transition-group()'' element.
305296

306297
: <dfn>::view-transition-old( <<pt-name-selector>> )</dfn>
307298
:: One of these pseudo-elements exists for each element in the old DOM being animated by the view transition,
@@ -327,13 +318,6 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
327318
Note: The aim of the style is to match the element's inline size while retaining the aspect ratio.
328319
It is also placed at the block start.
329320

330-
In addition to above, styles in the [=document/view transition style sheet=] add ''mix-blend-mode: plus-lighter'' to this pseudo element
331-
if the ancestor ''::view-transition-image-pair()'' has both ''::view-transition-new()'' and ''::view-transition-old()'' as descendants.
332-
333-
Issue: This reads like a non-normative note, but it's normative. This rule should be specified at the same time as other styles, when the condition above can be determined.
334-
335-
Note: ''mix-blend-mode: plus-lighter'' ensures that the blending of identical pixels from the old and new images results in the same color value as those pixels.
336-
337321
Note: Additional styles in the [=document/view transition style sheet=] added to animate these pseudo-elements are detailed in [=setup transition pseudo-elements=] and [=update pseudo-element styles=].
338322

339323
: <dfn>::view-transition-new( <<pt-name-selector>> )</dfn>
@@ -455,6 +439,12 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
455439

456440
: <dfn>new view-box rule</dfn>
457441
:: A {{CSSStyleRule}} or null. Initially null.
442+
443+
: <dfn>image pair isolation rule</dfn>
444+
:: A {{CSSStyleRule}} or null. Initially null.
445+
446+
: <dfn>view blend mode rule</dfn>
447+
:: A {{CSSStyleRule}} or null. Initially null.
458448
</dl>
459449

460450
## Additions to {{Document}} ## {#additions-to-document}
@@ -1116,6 +1106,36 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
11161106
</pre>
11171107

11181108
Note: The above code example contains variables to be replaced.
1109+
1110+
1. Set |capturedElement|'s [=captured element/image pair isolation rule=] to a new {{CSSStyleRule}} representing the following CSS,
1111+
and append it to |document|'s [=document/view transition style sheet=]:
1112+
1113+
<!-- deliberately using <pre> so the example can contain <var> references -->
1114+
<pre highlight="css">
1115+
html::view-transition-image-pair(<var>transitionName</var>) {
1116+
isolation: isolate;
1117+
}
1118+
</pre>
1119+
1120+
Note: The above code example contains variables to be replaced.
1121+
1122+
1. Set |capturedElement|'s [=captured element/view blend mode rule=] to a new {{CSSStyleRule}} representing the following CSS,
1123+
and append it to |document|'s [=document/view transition style sheet=]:
1124+
1125+
<!-- deliberately using <pre> so the example can contain <var> references -->
1126+
<pre highlight="css">
1127+
html::view-transition-old(<var>transitionName</var>),
1128+
html::view-transition-new(<var>transitionName</var>) {
1129+
mix-blend-mode: plus-lighter;
1130+
}
1131+
</pre>
1132+
1133+
Note: The above code example contains variables to be replaced.
1134+
1135+
Note: ''mix-blend-mode: plus-lighter'' ensures that the blending of identical pixels from the old and new images results in the same color value as those pixels, and achieves a "correct" cross-fade.
1136+
1137+
Issue: Isolation and the dynamic setting of blending is only necessary to get the right cross-fade between new and old image pixels.
1138+
Would it be simpler to always add it and try to optimize in the implementation?
11191139
</div>
11201140

11211141
## [=Update pseudo-element styles=] ## {#style-transition-pseudo-elements-algorithm}

0 commit comments

Comments
 (0)