This document is intended to be used as a guideline for the testing activities related to the Compositing and Blending spec [[!compositing-1]]. Its main goal is to provide an overview of the general testing areas and an informative description of possible test cases.
This document is not meant to replace the spec in determining the normative and non-normative assertions to be tested, but rather complement it.
In order to increase the quality of the test contributions, this document offers a set of test cases description for conducting testing (see ).
					In terms of actual tests produced for the CSS Compositing and Blending, the main goal
					is to ensure that most tests are automatable (i.e. they're either
					reftests or use testharness.js). Even where manual tests
					are absolutely necessary they should be written so that they can be
					easily automated – as there are on-going efforts to make
					WebDriver [[webdriver]] automated tests a first class citizen in W3C
					testing. This means that even if a manual test requires user
					interaction, the validation or PASS/FAIL conditions should still be
					clear enough as to allow automatic validation if said interaction is
					later automated.
				
Since CSS blending has only three new CSS properties, the approach is to deep dive into every aspect of the spec as much as possible. Tests will be created for the testing areas listed in and having as guidance the test cases description from .
These testing areas cover things explicitly defined in the normative sections of the Blending and Compositing spec. Please note that while detailed, this list is not necessarily exhaustive and some normative behaviors may not be contained in it. When in doubt, consult the Blending and Compositing spec or ask a question on the mailing list.
Below is the list of explicit testing areas:
mix-blend-modeisolationbackground-blend-modeThese are testing areas either normatively defined in other specs that explicitly refer to the Blending and Compositing spec (e.g. [[!css3-transforms]]) or simply not explicitly defined, but implied by various aspects of the spec (e.g. processing model, CSS 2.1 compliance, etc.). Please note that while detailed, this list is not necessarily exhaustive and some normative behaviors may not be contained in it. When in doubt, consult the Blending and Compositing spec or ask a question on the mailing list.
Below is the list of implicit testing areas:
<video><canvas><table>transformstransitions animations mix-blend-modeThe following diagram describes a list of notations to be used later on in the document as well as the general document structure the test cases will follow. The test cases should not be limited to this structure. This should be a wireframe and people are encouraged to come up with complex test cases as well.
						 
					
The intended structure of the document is the following:
<body>
  <div id="[P]">
    <div id="[IN-S]"></div>
    <div id="[IN-P]">
      <div id="[B]">
        <div id="[CB]"></div>
      </div>
    </div>
  </div>
</body>
						
					 Unless otherwise stated, test cases assume the following properties for the elements: 
						
background-color of the bodybackground-color set to a fully opaque color for all the other elements The CSS associated to the elements used in the tests shouldn't use properties that creates a stacking context, except the ones specified in the test case descriptions.
Every test case has a description of the elements used. The notation from the image is used in the test case description too (e.g. for parent element the notation is [P]). Each test case uses only a subset of the elements while the other elements should just be removed.
mix-blend-mode other than normal creates a stacking contextRefers to the following assertion in the spec: Applying a blendmode other than ‘normal’ to the element must establish a new stacking context [CSS21].
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Simple <div> | 1 element required: [B] [B] - element with mix-blend-modeother than normal | The element [B] creates a stacking context | 
mix-blend-mode blends with the content within the current stacking contextRefers to the following assertion in the spec: An element that has blending applied, must blend with all the underlying content of the stacking context [CSS21] that that element belongs to.
 
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blending simple elements | 2 elements required: [P] and  [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal | The color of the parent element [P] mixes with the color of the child element [B]. | 
| Blending <video> | 2 elements required: [B] and [IN-S] [B] - <video>element withmix-blend-modeother than normal[IN-S] - sibling(of the element [B]) visually overlaping the <video>element[IN-S] has some text inside | The content of the videoelement [B] mixes with the colors of the sibling element and the text from [IN-S]. | 
| Blending with a sibling | 3 elements required: [P], [B] and [IN-S] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[IN-S] - sibling of the element [B] The [IN-S] element visually overlaps the [B] element | The colors of the parent element [P] and the sibling element [IN-S] mixes with the color of the blended element [B]. | 
| Blending with two levels of ascendants | 3 elements required: [P], [B] and [IN-P] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[IN-P] - Intermediate child element between the parent [P] and the child [B] | The colors of the parent element [P] and the child element [IN-P] mixes with the color of the blended element [B]. | 
mix-blend-mode doesn't blend with anything outside the current stacking contextRefers to the following assertion in the spec:  An element that has blending applied, must blend with all the underlying content of the stacking context [CSS21] that that element belongs to.
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blending child overflows the parent | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normalThe blending element [B] has content that lies outside the parent element. Set the background-colorof thebodyto a value other than default | The color of the parent element mixes with the color of the child element. The area of the child element outside of the parent element doesn't mix with the color of the body | 
| Parent with transparent pixels | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)The element has some text inside and default value for background-color[B] - element with mix-blend-modeother than normalThe background-colorof thebodyhas a value other than default | The color of the text from the parent element [P] mixes with the color of the child element [B]. No blending between the color of the bodyand the color of the blending element [B]. | 
| Parent with border-radius | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[P] has border-radiusspecified (e.g.50%).[B] - element with mix-blend-modeother than normal[B] has content that lies outside the parent element, over a rounded corner. The background-colorof thebodyhas a value other than default. | The color of the parent element mixes with the color of the child element. The area of the child element which draws over the rounded corner doesn't mix with the color of the body | 
mix-blend-mode other than normal must cause a group to be isolatedRefers to the following assertion in the spec: operations that cause the creation of stacking context [CSS21] must cause a group to be isolated.
 
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Child of the blended element has opacity | 3 elements required: [P], [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[CB] - child of the element [B] with opacityless than one. | The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. No blending between [B] and [CB] | 
| Overflowed child of the blended element | 3 elements required: [P], [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[CB] - child of the element [B] with content that lies outside the parent element [B]. | The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. No blending between [B] and [CB]. There is only one color for the entire element [CB] | 
| Blended element with transparent pixels | 3 elements required: [P], [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal and transparentbackground-color[CB] - child of the element [B] | The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. No blending between [B] and [CB]. | 
mix-blend-mode must work properly with css transforms| Test name | Elements and styles | Expected result | 
|---|---|---|
| Parent with 3D transform | 2 elements required: [P] and  [B] [P] - parent element with 3D transform[B] - element with mix-blend-modeother than normal | The color of the parent element [P] mixes with the color of the child element [B] The element (and the content) of the element [P] is properly transformed | 
| Blended element with 3D transform | 2 elements required: [P], [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal and3D transform[CB] - child of the element [B] | The color of the parent element [P] mixes with the color of the child element [B] The element (and the content) of the element [P] is properly transformed | 
| Both parent and blended element with 3D transform | 2 elements required: [P] and  [B] [P] - parent element with 3D transform[B] - element with mix-blend-modeother than normal and3D transform | The color of the parent element [P] mixes with the color of the child element [B] The elements (and the content) of the elements [P] and [B] are properly transformed | 
| Blended element with transform and preserve-3d | 3 elements required: [P], [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal and transform withtransform-style:preserve-3d[CB] - child of the element [B]. It has 3D transform property | The child element [CB] will NOT preserve its 3D position. mix-blend-modeoverride the behavior oftransform-style:preserve-3d:
								creates a flattened representation of the descendant elementsThe color of the group created by the child elements([B] and [CB]) will blend with the color of the parent element [P] | 
| Blended element with transform and perspective | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal and transform withperspectiveset to positive length | The colors of the parent and the child are mixed ([P] and [B]) The element (and the content) of the element [B] is properly transformed | 
| Sibling with 3D transform between the parent and the blended element | 3 elements required: [P], [B] and [IN-S] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[IN-S] - Sibling(of the element [B]) with 3D transformbetween the parent [P] and the child [B] | The colors of the parent element [P] and the transformed sibling element [IN-S] mixes with the color of the blended element [B]. The element (and the content) of the element [IN-S] is properly transformed | 
| Parent with 3D transform and transition | 2 elements required: [P] and  [B] [P] - parent element with 3D transformand transition[B] - element with mix-blend-modeother than normal | The color of the parent element [P] mixes with the color of the child element [B] The element (and the content) of the element [P] is properly transformed | 
| Sibling with 3D transform(and transition) between the parent and the blended element | 3 elements required: [P], [B] and [IN-S] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal[IN-S] - sibling(of the element [B]) with 3D transformand transition between the parent [P] and the child [B] | The colors of the parent element [P] and the transformed sibling element [IN-S] mixes with the color of the blended element [B]. The element (and the content) of the element [IN-S] is properly transformed | 
mix-blend-mode must work properly with elements with overflow property| Parent element with overflow:scroll | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[P] has overflow:scroll[B] - element with mix-blend-modeother than normal tat overflows the parents [P] dimensions so that it creates scrolling for the parent | The color of the parent element [P] mixes with the color of the child element [B]. The scrolling mechanism is not affected. | 
| Blended element with overflow:scroll | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal,overflow:scrolland a child element that creates overflow for [B] | The color of the parent element [P] mixes with the color of the child element [B] The scrolling mechanism is not affected. | 
| Parent element with overflow:scrolland blended withposition:fixed | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[P] has overflow:scroll[B] - element with mix-blend-modeother than normal,position:fixedand should overflow the parents [P] dimensions so that it creates scrolling for the parent | The color of the parent element [P] mixes with the color of the child element [B] The blending happens when scrolling the content of the parent element [P] too. The scrolling mechanism is not affected. | 
| Parent with overflow:hiddenandborder-radius | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[P] has overflow:hiddenandborder-radiusspecified (e.g.50%)[B] - element with mix-blend-modeother than normal with content that lies outside the parent element, over a rounded cornerSet the background-colorof thebodyto a value other than default. | The color of the parent element mixes with the color of the child element. The area of the child element which draws over the rounded corner is properly cut | 
| Blended element with overflow:hiddenandborder-radius | 3 elements required: [P] and [B] and [CB] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal,overflow:hiddenandborder-radiusspecified (e.g.50%).[CB] - child of the element [B], with content that lies outside the parent element, over a rounded corner. | The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. No blending between [B] and [CB]. [CB] is properly clipped so no overflow is visible. | 
| Intermediate child with overflow:hiddenandborder-radiusbetween the parent and the blended element | 3 elements required: [P], [B] and [IN-P] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal that overflows the parents [IN-P] dimensions
									[IN-P] - child(of the element [P]) withoverflow:hiddenandborder-radiusspecified (e.g.50%) | The colors of the parent element [P] and the child element [IN-P] mixes with the color of the blended element [B]. [B] is is properly clipped so no overflow is visible | 
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blended element with border-image | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andborder-imagespecified as a png file | The color of the parent element [P] mixes with the color of the child element. The color of the border-imagemixes with the color of the parent element [P]. | 
| Blending with <canvas> | 2 elements required: [B] and [IN-S] [B] - <canvas>element withmix-blend-modeother than normal[IN-S] - Sibling of the <canvas>element with some textThe [IN-S] element overlaps the <canvas>element | The content of the <canvas>element mixes with the color of the sibling element and the text [IN-S]. | 
| Blended <canvas> | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - Child <canvas>element withmix-blend-modeother than normal | The color of the <canvas>element [B] mixes with the color of the parent element [P] . | 
| Blended <video> | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - <video>element withmix-blend-modeother than normal | The color of the <video>element mixes with the color of the parent element [P] . | 
| Blending with <iframe> | 2 elements required: [B] and [IN-S] [B] - <iframe>element withmix-blend-modeother than normal[IN-S] - sibling(of the element [B]) with some text The [IN-S] element visually overlaps the <iframe>element | The color of the <iframe>element mixes with the color of the sibling element and the text [IN-S]. | 
| Blended <iframe> | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - <iframe>element withmix-blend-modeother than normal | The color of the <iframe>element [B] mixes with the color of the parent element [P]. | 
| Blended element with maskproperty | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andmaskproperty specified to an SVG image (e.g. circle) | The colors of the parent and the masked child are mixed ([P] and [B]) | 
| Blended element with clip-pathproperty | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andclip-pathproperty specified to a basic shape (e.g. ellipse) | The colors of the parent and the clipped child are mixed ([P] and [B]) | 
| Blended element with filterproperty | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andfilterproperty value other than none | The filter is applied and the result is mixed with the parent element | 
| Blended element with transition | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andtransition-propertyforopacity | The transition is applied and the result is mixed with the parent element | 
| Blended element with animation | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - element with mix-blend-modeother than normal andanimationspecified | The animation is applied to the child element and the result is mixed with the parent element | 
| Image element | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - <img>element (.jpeg or .gif image) withmix-blend-modeother than normal | The color of the <img>is mixed with the color of the<div>. | 
| SVG element | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - SVG element with mix-blend-modeother than normal | The color of the SVG is mixed with the color of the <div>. | 
| Paragraph element | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - paragraph element with mix-blend-modeother than normal | The color of the text from the paragraph element is mixed with the color of the <div> | 
| Paragraph element and background-image | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)and background-image[B] - Child pelement with some text andmix-blend-modeother than normal | The color of the text from the pelement is mixed with the background image of the<div>. | 
| Set blending from JavaScript | 2 elements required: [P] and [B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[B] - Child <div>element with nomix-blend-modespecifiedFrom JavaScript, set the mix-blend-modeproperty for the child<div>to a value other than normal | The colors of the <div>elements are mixed. | 
mix-blend-mode
				mix-blend-mode with simple SVG graphical elementsRefers to the following assertion in the spec : mix-blend-mode applies to svg, g, use, image, path, rect, circle, ellipse, line, polyline, polygon, text, tspan, and marker.
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Circle with SVG background | Set a background color for the SVG. Create 16 circleelements and fill them with a solid color.Apply each mix-blend-modeon them. | The color of the circleis mixed with the color of the background. | 
| Ellipse with SVG background | Set a background color for the SVG. Create an ellipseelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the ellipseis mixed with the color of the background. | 
| Image with SVG background | Set a background color for the SVG. Create an imageelement and apply amix-blend-modeother thannormal. | The imageis mixed with the color of the background. | 
| Line with SVG background | Set a background color for the SVG. Create a lineelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the lineis mixed with the color of the background. | 
| Path with SVG background | Set a background color for the SVG. Create a pathelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the pathis mixed with the color of the background. | 
| Polygon with SVG background | Set a background color for the SVG. Create a polygonelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the polygonis mixed with the color of the background. | 
| Polyline with SVG background | Set a background color for the SVG. Create a polylineelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the polylineis mixed with the color of the background. | 
| Rect with SVG background | Set a background color for the SVG. Create a rectelement and fill it with a solid color.Apply a mix-blend-modeon it other thannormal. | The color of the rectis mixed with the color of the background. | 
| Text with SVG background | Set a background color for the SVG. Create a textelement and apply amix-blend-modeother thannormal. | The text is mixed with the color of the background. | 
| Text having tspan with SVG background | Set a background color for the SVG. Create a textelement and atspaninside it.Apply a mix-blend-modeother thannormalon thetspan. | The text is mixed with the color of the background. | 
| Gradient with SVG background | Set a background color for the SVG. Create a rectelement and fill it with agradient.Apply a mix-blend-modeon it other than normal. | The gradient is mixed with the color of the background. | 
| Pattern with SVG background | Set a background color for the SVG. Create a rectelement and fill it with apattern.Apply a mix-blend-modeon it other than normal. | The pattern is mixed with the color of the background. | 
| Set blending on an element from JavaScript | Set a background color for the SVG. Create a rectelement and fill it with a solid color.Apply a mix-blend-mode(other thannormal) on it from JavaScript. | The color of the rectis mixed with the color of the background. | 
| Marker with SVG background | Set a background color for the SVG. Create a lineelement containing a marker.Apply a mix-blend-modeother thannormalon the marker. | The marker color is mixed with the color of the background. | 
| Metadata with SVG background | Set a background color for the SVG. Create a metadataelement containing an embedded pdf.Apply a mix-blend-modeother thannormalon the marker. | The metadata content is not mixed with the color of the background. | 
| ForeignObject with SVG background | Set a background color for the SVG. Create a foreignObjectelement containing a simple xhtml file.Apply a mix-blend-modeother thannormalon the marker. | The foreignObject content is not mixed with the color of the background. | 
mix-blend-mode with SVG groups| Test name | Elements and styles | Expected result | 
|---|---|---|
| Group of overlapping elements with SVG background | Set a background color for the SVG. Create a groupelement containing two overlappingrectelements, each filled with a different solid color.Apply a mix-blend-modeother thannormalon the group. | The groupis mixed as a whole with the color of the background. | 
mix-blend-mode with isolated groupsRefers to the following assertion in the spec:
					By default, every element must create a non-isolated group.
					
						However, certain operations in SVG will create isolated groups.
						If one of the following features is used, the group must become isolated:
						
						    
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blending two elements in an isolated group | Set a background color for the SVG. Create a groupelement containing two overlappingrectelements, each filled with a different solid color.Apply opacityless than 1 on the group and amix-blend-modeother thannormalon the second rect. | Only the intersection of the rectelements should mix. | 
| Blending in a group with opacity | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply opacityless than 1 on the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blending in a group with filter | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply a filteron the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blending in a group with 2D transform | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply a transformon the group and amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Blending in a group with 3D transform | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply a 3d transform on the group and a mix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blending in a group with a mask | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply a maskon the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blending in a group with mix-blend-mode | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply a mix-blend-modeother thannormalon the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blend with element having opacity | Set a background color for the SVG. Create a rectelement filled with a different solid color.Apply opacityless than 1 and amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Blend with element having stroke | Set a background color for the SVG. Create a rectelement filled with a different solid color.Apply a strokeand amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Blend with element having stroke-opacity | Set a background color for the SVG. Create a rectelement filled with a different solid color.Apply a stroke,stroke-opacityless than 1 and amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Blend with element having stroke-dasharray | Set a background color for the SVG. Create a rectelement filled with a different solid color.Apply a stroke-dasharrayand amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Blend with element having transform | Set a background color for the SVG. Create an imageelement. Apply atransform(any combination oftranslate,rotate,scale,skew) and amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with SVG having viewbox and preserveAspectRatio set | Set a background color for the SVG, as well as viewboxandpreserveAspectRatio.Create a rectelement filled with a different solid color and apply amix-blend-modeother thannormalon it. | The rectwill mix with the content behind it. | 
| Blend with an element having color-profile set | Set a background color for the SVG. Create an imageelement. Apply acolor-profile(sRGB, for example) and amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with an element having overflow | Set a background color for the SVG. Create an imagelarger than the SVG.Apply overflow(visible,hidden,scroll) and amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with an element having clip-path | Set a background color for the SVG. Create an imageelement. Apply aclip-pathand amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with an element having a mask | Set a background color for the SVG. Create an imageelement.Apply a maskand amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with an element having a filter | Set a background color for the SVG. Create an imageelement.Apply a filterand amix-blend-modeother thannormalon theimage. | The imagewill mix with the content behind it. | 
| Blend with an animated element | Set a background color for the SVG. Create a rectelement filled with a different solid color.Apply an animateTransformand amix-blend-modeother thannormalon therect. | The rectwill mix with the content behind it. | 
| Set blending from an SVG script element | Set a background color for the SVG. Create a rectelement and fill it with a solid color.Apply a mix-blend-mode(other thannormal) on it from an svgscriptelement. | The rectwill mix with the content behind it. | 
background-blend-modebackground-blend-mode Refers to the following assertion in the spec: Each background layer must blend with the element's background layer that are below it and the element's background color.
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Images with different formats | Element with 
 <image>with different formats such as PNG, JPEG or SVG | The content of the background-imageis mixed with the color of thebackground-color | 
| Gradient and background color | Element with 
 | The content of the background-imageis mixed with the color of thebackground-color | 
| Image and gradient | Element with 
 | The content of the <image>is mixed with the content of the<gradient> | 
| Gradient and image | Element with 
 | The content of the <image>is mixed with the content of the<gradient> | 
| Two gradients | Element with 
 | The content of the two gradients is mixed | 
| Two images | Element with 
 | The content of the two images is mixed | 
| Image and background color with transparency | Element with 
 | The content of the background-imageis mixed with the color of thebackground-color | 
| Cross-fade image and gradient | Element with 
 | The content of the cross-faded image is mixed with the content of the <gradient> | 
| SVG image and background color | Element with 
 | The content of the image is mixed with the color of the background | 
| Animated gif image and background color | Element with 
 | The content of the image is mixed with the color of the background | 
| Set background-blend-modefrom JavaScript | Element with 
 background-blend-modeproperty to a value other than normal. | The content of the gradient is mixed with the color of the background | 
| background-blend-modeon element with 3D transform | Element with 
 | The content of the image is mixed with the color of the background | 
Refers to the following assertion in the spec: Background layer must not blend with the content that is behind the element instead they must act as if they are rendered into an isolated group.
					
| Test name | Elements and styles | Expected result | 
|---|---|---|
| One background layer | Element with 
 | The background-imageis not mixed with anything outside the element | 
| Two elements | 2 elements required: a parent element with a child. Each one with the following properties: 
 | No blending between the background colors of the two elements | 
| Parent and child with background-blend-mode | 2 elements required: a parent element with a child Parent properties: 
 
 | The content of the image from the child element does not mixes with the background color from the parent element | 
background-blend-mode list values apply to the corresponding background layerRefers to the following assertion in the spec: The ‘background-blend-mode’ list must be applied in the same order as ‘background-image’[CSS3BG]. This means that the first element in the list will apply to the layer that is on top.
					
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Different blend modes applied between layers | Element with 
 | The content of the three images is correctly mixed (multiply for I1, difference for I2 and screen for I3) | 
background-blend-mode list values are repeated if the list is shorter than the background layer listRefers to the following assertion in the spec: If a property doesn't have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough.
					
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blend mode list repeat | Element with 
 | The unspecified blend modes should be obtained by repeating the blend mode list from the beginning | 
background-blend-mode value for the background shorthand is 'normal' Refers to the following assertion in the spec: If the ‘background’ [CSS3BG] shorthand is used, the ‘background-blend-mode’ property for that element must be reset to its initial value.
					
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Default blend mode for 'background' shorthand | Element with 
 | The computed value of background-blend-modeis 'normal' | 
background-blend-mode for an element with background-position| Test name | Elements and styles | Expected result | 
|---|---|---|
| background-positionpercentage | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imageis correctly positioned | 
background-blend-mode for an element with background-size| Test name | Elements and styles | Expected result | 
|---|---|---|
| Background size defined in pixels | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imagehas the correct size | 
| Background size defined in percentage (second phase) | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imagehas the correct size | 
| Background size cover | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imagehas the correct size | 
| Background size contain | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imagehas the correct size | 
background-blend-mode for an element with background-repeat| Test name | Elements and styles | Expected result | 
|---|---|---|
| background-repeatset to no-repeat | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background-imageis not repeated | 
| background-repeatset to space | Element with 
 | The content of the background-imageis mixed with the color of thebackground-color | 
| background-repeatset to round | Element with 
 | The content of the background-imageis mixed with the color of thebackground-color | 
background-blend-mode for an element with background-clip| Test name | Elements and styles | Expected result | 
|---|---|---|
| background-clipset topadding-box | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorNo background is drawn below the border (background extends to the outside edge of the padding) | 
| background-clipset tocontent-box | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background is painted within (clipped to) the content box | 
background-blend-mode for an element with background-origin| Test name | Elements and styles | Expected result | 
|---|---|---|
| background-originset toborder-box | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background extends to the outside edge of the border (but underneath the border in z-ordering) | 
| background-originset tocontent-box | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background is painted within (clipped to) the content box | 
background-blend-mode for an element with background-attachement| Test name | Elements and styles | Expected result | 
|---|---|---|
| background-attachmentset tofixed | Element with 
 | The content of the background-imageis mixed with the color of thebackground-colorThe background image will not scroll with its containing element, instead remaining stationary within the viewport | 
| 2 background images with background-attachmentset tofixed, scroll | Element with 
 | The background images will be mixed when they overlap while scrolling | 
isolationisolation:isolate creates a stacking contextRefers to the following assertion in the spec: For CSS, setting ‘isolation’ to ‘isolate’ will turn the element into a stacking context [CSS21].
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Isolation isolate | Have an element with isolationset toisolate | The element creates a stacking context. | 
isolation:isolate creates an isolated group for blended children| Test name | Elements and styles | Expected result | 
|---|---|---|
| Isolation of blended child which overflows | 3 elements required:
								[P],
								[IN-P] and
								[B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed)[IN-P] - Intermediate child element between the parent [P] and the child [B] This element has isolation:isolateset.[B] - element with mix-blend-modeother thannormalThe blending element [B] has content that lies outside the parent element. | The color of the child element [B] mixes with the color of the intermediate element [IN-P], where they overlap. The area of the child element outside of the intermediate parent element does not mix with the color of the parent element [P], or of the body. | 
| Isolation on intermediate element with transparent pixels | 3 elements required:
								[P],
								[IN-P] and
								[B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed); the elementbackground-coloris other thantransparent[IN-P] - Intermediate child element between the parent [P] and the child [B] The intermediate element has text content, default value for background-colorandisolation:isolateset[B] - element with mix-blend-modeother thannormal
							 | |
| Isolate inside a stacking context created by a 3d transform | 3 elements required:
								[P],
								[IN-P] and
								[B] [P] - parent element with a 3D transformapplied[IN-P] - Intermediate child element between the parent [P] and the child [B] The intermediate element has isolation:isolateset[B] - element with mix-blend-modeother thannormal | The color of the child element [B] mixes with the color of the intermediate element [IN-P], where they overlap. There is no blending between the color of the parent element [P] and the color of the blended element [B]. | 
isolation:auto set does not change the elements existing stacking context behavior| Test name | Elements and styles | Expected result | 
|---|---|---|
| Isolation auto | Have an element with isolationexplicitly set toauto, and no other style that would create a stacking context | The element does not create a stacking context - the computed value of its z-indexis valueauto | 
| Stacking context not affected by isolation | 2 elements required:
								[P] and
								[B] [P] - parent element with a property that creates a stacking context (e.g. position:fixed); This element hasisolationexplicitly set toauto[B] - element with mix-blend-modeother thannormalThe blending element [B] has content that lies outside the parent element. Set the background-colorof thebodyto a value other than default | The color of the parent element mixes with the color of the child element. The area of the child element outside of the parent element doesn't mix with the color of the body.In other words, setting the isolationtoautodoes not affect the creation of a stacking context by other properties. | 
isolation in SVGisolation:isolate creates an isolated group for blended childrenRefers to the following assertion in the spec: In SVG, this defines whether an element is isolated or not.
| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blending in an isolated group | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply isolation:isolateon the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Blending two elements in an isolated group | Set a background color for the SVG. Create a groupelement containing two overlappingrectelements, each filled with a different solid color.Apply isolation:isolateon the group and amix-blend-modeother thannormalon the second rect. | Only the intersection of the rectelements should mix. | 
| Blending in an isolated group with 2D transform | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply isolation:isolateand 2D transform on the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. | 
| Set isolation on an element from JavaScript | Set a background color for the SVG. Create a rectelement and fill it with a solid color and amix-blend-modeother thannormal.Apply isolation:isolateon it from JavaScript. | The rectwill not mix with the content behind it. | 
isolation:auto set does not change the rendering behaviour| Test name | Elements and styles | Expected result | 
|---|---|---|
| Blending a group with isolation:auto | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply isolation:autoon the group and amix-blend-modeother thannormalon therect. | The element will mix with the content behind it. | 
| Blending in a group with opacity | Set a background color for the SVG. Create a groupelement containing arectelement filled with a different solid color.Apply opacityless than 1 andisolation:autoon the group and amix-blend-modeother thannormalon therect. | The rectwill not mix with the content behind it. |