You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Abstract: In addition, this specification will define CSS properties for blending and group isolation and the properties of the {{globalCompositeOperation}} attribute.
and/or the creation of a <a spec="css21">stacking context</a>.
53
+
to the [[css2#visual-model-intro|Visual formatting model]]. Some values of these properties result in the creation of a
54
+
[=containing block=],
55
+
and/or the creation of a [=stacking context=].
48
56
49
57
The 'background-blend-mode' property also builds upon the properties defined in the <a href="https://www.w3.org/TR/css3-background/#placement" title="Backgrounds and Borders">CSS Backgrounds and Borders</a> module [[!CSS3BG]].
50
58
@@ -55,16 +63,15 @@ This module also extends the
55
63
56
64
<h3 id="values">Values</h3>
57
65
58
-
This specification follows the <a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
59
-
definition conventions</a> from [[!CSS21]]. Value types not defined in
66
+
This specification follows the [[css2#property-defs|CSS property
67
+
definition conventions]]. Value types not defined in
60
68
this specification are defined in CSS Level 2 Revision 1 [[!CSS21]]. Other CSS
61
69
modules may expand the definitions of these value types: for example [[!CSS3COLOR]],
62
70
when combined with this module, expands the definition of the <color>
63
71
value type as used in this specification.
64
72
65
73
In addition to the property-specific values listed in their definitions,
66
-
all properties defined in this specification also accept the <a
all properties defined in this specification also accept the [=inherit=]
68
75
keyword as their property value. For readability it has not been repeated
69
76
explicitly.
70
77
@@ -76,11 +83,11 @@ The compositing model must follow the <a href="https://www.w3.org/TR/SVG11/rende
76
83
<h3 id="csscompositingrules_CSS">Behavior specific to HTML</h3>
77
84
<!-- <p>
78
85
If an element specifies non-default blending or <a href="https://www.w3.org/TR/css3-color/#transparency">'opacity'</a>, its <a href="https://www.w3.org/TR/css3-2d-transforms/#transform-style-property">transform-style</a>[[CSS3-TRANSFORMS]] and that of all of its children must revert to 'flat'.<br>
79
-
The application of blending other than 'normal' to an element must also establish a <a spec="css21">stacking context</a>[[!CSS21]] the same way that CSS <a href="https://www.w3.org/TR/css3-color/#transparency">'opacity'</a> does. One of the consequences is that elements with z-index must not honor the depth of elements outside of the group.<br> -->
86
+
The application of blending other than 'normal' to an element must also establish a [=stacking context=] the same way that CSS <a href="https://www.w3.org/TR/css3-color/#transparency">'opacity'</a> does. One of the consequences is that elements with z-index must not honor the depth of elements outside of the group.<br> -->
80
87
81
-
Everything in CSS that creates a <a href="https://www.w3.org/TR/CSS21/zindex.html">stacking context</a> must be considered an <a href="#isolatedgroups">‘isolated’ group</a>. HTML elements themselves should not create groups.
88
+
Everything in CSS that creates a [=stacking context=] must be considered an <a href="#isolatedgroups">‘isolated’ group</a>. HTML elements themselves should not create groups.
82
89
83
-
An element that has blending applied, must blend with all the underlying content of the <a spec="css21">stacking context</a>[[!CSS21]] that that element belongs to.
90
+
An element that has blending applied, must blend with all the underlying content of the [=stacking context=] that that element belongs to.
84
91
85
92
<h3 id="csscompositingrules_SVG">Behavior specific to SVG</h3>
86
93
@@ -123,7 +130,7 @@ The syntax of the property of <<blend-mode>> is given with:
Note: Applying a blendmode other than <a value>normal</a> to the element must establish a new <a spec="css21">stacking context</a>[[!CSS21]]. This group must then be blended and composited with the <a spec="css21">stacking context</a> that contains the element.
133
+
Note: Applying a blendmode other than <a value>normal</a> to the element must establish a new [=stacking context=]. This group must then be blended and composited with the [=stacking context=] that contains the element.
127
134
128
135
<div class="example">
129
136
<p>Given the following sample markup:</p>
@@ -246,7 +253,7 @@ Text with a blend overlay on top of an image.
246
253
In SVG, this defines whether an element is isolated or not.<br>
247
254
For CSS, setting 'isolation' to ''isolation/isolate'' will turn the element into a stacking context.
248
255
249
-
By default, elements use the ''isolation/auto'' keyword which implies that they are not isolated. However operations that cause the creation of stacking context[[!CSS21]] must cause a group to be isolated. These operations are described in <a href="#csscompositingrules_CSS">'behavior specific to HTML'</a> and <a href="#csscompositingrules_SVG">'behavior specific to SVG'</a>.
256
+
By default, elements use the ''isolation/auto'' keyword which implies that they are not isolated. However operations that cause the creation of [=stacking context=] must cause a group to be isolated. These operations are described in <a href="#csscompositingrules_CSS">'behavior specific to HTML'</a> and <a href="#csscompositingrules_SVG">'behavior specific to SVG'</a>.
250
257
251
258
<pre class='propdef'>
252
259
Name: isolation
@@ -352,7 +359,7 @@ This property takes the following value:
352
359
353
360
The syntax of the property of <<composite-mode>> is given with:
<a href="#simplealphacompositing">Simple alpha compositing</a> uses the <a href="#porterduffcompositingoperators_srcover">source-over</a> Porter Duff compositing operator. <!-- Additional compositing operators exist and may be specified with the <a href="#propdef-mix-composite">mix-composite property</a>.
733
+
<a href="#simplealphacompositing">Simple alpha compositing</a> uses the [=source-over=] Porter Duff compositing operator. <!-- Additional compositing operators exist and may be specified with the <a href="#propdef-mix-composite">mix-composite property</a>.
727
734
The additional compositing operators allow for more complex interactions between the shapes of elements being composited. The compositing operators are described in the <a href="#porterduffcompositingoperators">Porter Duff compositing operators</a>.
728
735
The operators that applies to an element or group is selected using the <a href="#propdef-mix-composite">mix-composite</a> property.-->
Source which overlaps the destination, replaces the destination. Destination is placed elsewhere.
947
+
With the <dfn>source-atop</dfn> compositing operator, the parts of the source which overlap the destination replace the destination. The destination is placed everywhere else.
941
948
942
949
<div class="figure">
943
950
<img src="examples/PD_src-atop.svg" alt="example of porter duff source atop"/>
@@ -951,7 +958,7 @@ Source which overlaps the destination, replaces the destination. Destination is
Destination which overlaps the source replaces the source. Source is placed elsewhere.
961
+
With the <dfn>destination-atop</dfn> compositing operator, the parts of the destination which overlaps the source replace the source. The source is placed everywhere else.
955
962
956
963
<div class="figure">
957
964
<img src="examples/PD_dst-atop.svg" alt="example of porter duff destination atop"/>
@@ -965,7 +972,7 @@ Destination which overlaps the source replaces the source. Source is placed else
Display the sum of the source image and destination image. It is defined in the Porter Duff paper as the ''plus'' operator [[PORTERDUFF]].
988
+
With the <dfn>lighter</dfn> compositing operator, the sum of the source image and destination image is displayed. It is defined in the Porter Duff paper as the ''plus'' operator [[PORTERDUFF]].
982
989
983
990
<pre>
984
991
Fa = 1; Fb = 1
@@ -987,13 +994,18 @@ Display the sum of the source image and destination image. It is defined in the
With the <dfn>plus-lighter</dfn> compositing operator, the following steps are performed:
1008
+
997
1009
<pre>
998
1010
Fa = 1; Fb = 1
999
1011
co = min(1, αs x Cs + αb x Cb);
@@ -1003,18 +1015,15 @@ Display the sum of the source image and destination image. It is defined in the
1003
1015
<h3 id="groupcompositing">Group compositing behavior with Porter Duff modes</h3>
1004
1016
<!--<h4 id="groupcompositingisolation">Isolated groups and Porter Duff modes</h4>-->
1005
1017
1006
-
When compositing the elements within an isolated group, the elements are composited over a transparent black initial backdrop. If the bottom element in the group uses a Porter Duff compositing operator
1007
-
which is dependent on the backdrop, such as <a href="#porterduffcompositingoperators_dst">destination</a>, <a href="#porterduffcompositingoperators_srcin">source-in</a>,
1008
-
<a href="#porterduffcompositingoperators_dstin">destination-in</a>, <a href="#porterduffcompositingoperators_dstout">destination-out</a> or <a href="#porterduffcompositingoperators_srcatop">source-atop</a>,
1009
-
then the result of the composite will be empty. Subsequent elements within the group are composited with the result of the first composite.
1018
+
When compositing the elements within an isolated group, the elements are composited over a transparent black initial backdrop. If the bottom element in the group uses a Porter Duff compositing operator which is dependent on the backdrop, such as [=destination=], [=source-in=], [=destination-in=], [=destination-out=], or [=source-atop=], then the result of the composite will be empty. Subsequent elements within the group are composited with the result of the first composite.
1010
1019
1011
1020
<!--
1012
1021
<h4 id="groupcompositingknockout">Knockout groups and Porter Duff modes</h4>
1013
1022
<p>
1014
1023
Every element within a knock-out group is composited with the initial backdrop.
1015
1024
This means, that for every element within the group, the backdrop for the compositing of that element, is the initial backdrop.
1016
1025
</p><p>
1017
-
In the example below, the elements within the group (the circle and the square) are composited using the <a href="#porterduffcompositingoperators_srcatop">source-atop</a> operator, with only the hexagon.
1026
+
In the example below, the elements within the group (the circle and the square) are composited using the [=source-atop=] operator, with only the hexagon.
1018
1027
This has the effect of "knocking out" the circle, where it is overlapped by the square.<br>
1019
1028
Additionally, because the source-atop Porter Duff operator is used, the source shape (either the square or the circle) is only placed where the backdrop exists (the backdrop being the hexagon for both compositing operations within the group).
1020
1029
<div class="example"><img src="examples/pd-knockout.png" alt="example of knockout with porter duff"/></div>
@@ -1103,7 +1112,7 @@ now substitute the result of blending for Cs:
1103
1112
A blend mode is termed separable if each component of the result color is completely determined by the corresponding components of the constituent <a>backdrop</a> and source colors — that is, if the mixing formula is applied <strong>separately</strong> to each set of corresponding components.
1104
1113
1105
1114
Each of the following blend modes will apply the blending function B(Cb, Cs) on each of the color components.
1106
-
For simplicity, all the examples in this chapter use <a href="#porterduffcompositingoperators_srcover">source-over</a> compositing.
1115
+
For simplicity, all the examples in this chapter use [=source-over=] compositing.
0 commit comments