From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../test-plan/css-blending-test-plan-proposal.html | 1616 ++++++++++++++++++++ 1 file changed, 1616 insertions(+) create mode 100644 testing/web-platform/tests/css/compositing/test-plan/css-blending-test-plan-proposal.html (limited to 'testing/web-platform/tests/css/compositing/test-plan/css-blending-test-plan-proposal.html') diff --git a/testing/web-platform/tests/css/compositing/test-plan/css-blending-test-plan-proposal.html b/testing/web-platform/tests/css/compositing/test-plan/css-blending-test-plan-proposal.html new file mode 100644 index 0000000000..c82a543a4e --- /dev/null +++ b/testing/web-platform/tests/css/compositing/test-plan/css-blending-test-plan-proposal.html @@ -0,0 +1,1616 @@ + + + + + Compositing and Blending test plan + + + + + + +
+

+ 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. +

+
+
+

Goals

+
+

Providing guidance on testing

+

+ In order to increase the quality of the test contributions, this + document offers a set of test cases description for conducting testing (see + ). +

+
+
+

Creating automation-friendly tests

+

+ 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. +

+
+
+
+

Approach

+

+ 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 . +

+
+
+

Testing areas

+
+

Explicit testing areas

+

+ 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:

+
    +
  1. Proper parsing of the CSS properties and rendering according to the spec +
      mix-blend-mode
    +
      isolation
    +
      background-blend-mode
    +
  2. +
  3. SVG blending
  4. +
  5. Canvas 2D blending
  6. +
+
+
+

Implicit testing areas

+

+ These 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:

+
    +
  1. Blending different types of elements +
      +
    • <video>
    • +
    • <canvas>
    • +
    • <table>
    • +
    +
  2. +
  3. Blending elements with specific style rules applied +
      +
    • transforms
    • +
    • transitions
    • +
    • animations
    • +
    +
  4. +
+
+
+
+

Test cases description

+
+

Test cases for mix-blend-mode

+

+ The 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. +

+

+ Mix-blend-mode sample elements +

+

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:
+

    +
  • default value for the background-color of the body
  • +
  • background-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. +

+
+

An element with mix-blend-mode other than normal creates a stacking context

+

Refers to the following assertion in the spec: Applying a blendmode other than ‘normal’ to the element must establish a new stacking context [CSS21].

+ + + + + + + + + + + +
Test nameElements and stylesExpected result
Simple <div>1 element required: [B]
+ [B] - element with mix-blend-mode other than normal +
The element [B] creates a stacking context
+
+
+

An element with mix-blend-mode blends with the content within the current stacking context

+

Refers 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 nameElements and stylesExpected 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-mode other 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 with mix-blend-mode other than normal
+ [IN-S] - sibling(of the element [B]) visually overlaping the <video> element
+ [IN-S] has some text inside +
The content of the video element [B] mixes with the colors of the sibling element and the text from [IN-S].
Blending with a sibling3 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-mode other 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 ascendants3 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-mode other 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].
+
+
+

An element with mix-blend-mode doesn't blend with anything outside the current stacking context

+

Refers 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 nameElements and stylesExpected result
Blending child overflows the parent2 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-mode other than normal
+ The blending element [B] has content that lies outside the parent element.
+ Set the background-color of the body to 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 pixels2 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-mode other than normal
+ The background-color of the body has 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 body and the color of the blending element [B]. +
Parent with border-radius2 elements required: [P] and [B]
+ [P] - parent element with a property that creates a stacking context (e.g. position:fixed)
+ [P] has border-radius specified (e.g.50%).
+ [B] - element with mix-blend-mode other than normal
+ [B] has content that lies outside the parent element, over a rounded corner.
+ The background-color of the body has 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
+
+
+

An element with mix-blend-mode other than normal must cause a group to be isolated

+

Refers to the following assertion in the spec: operations that cause the creation of stacking context [CSS21] must cause a group to be isolated.

+ + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Child of the blended element has opacity3 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-mode other than normal
+ [CB] - child of the element [B] with opacity less 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 element3 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-mode other 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 pixels3 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-mode other than normal and transparent background-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].
+
+
+

An element with mix-blend-mode must work properly with css transforms

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Parent with 3D transform2 elements required: [P] and [B]
+ [P] - parent element with 3D transform
+ [B] - element with mix-blend-mode other 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 transform2 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-mode other than normal and 3D 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-mode other than normal and 3D 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-3d3 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-mode other than normal and transform with transform-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-mode override the behavior of transform-style:preserve-3d: + creates a flattened representation of the descendant elements
+ The 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 perspective2 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-mode other than normal and transform with perspective set 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 element3 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-mode other than normal
+ [IN-S] - Sibling(of the element [B]) with 3D transform 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 +
Parent with 3D transform and transition2 elements required: [P] and [B]
+ [P] - parent element with 3D transform and transition
+ [B] - element with mix-blend-mode other 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 element3 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-mode other than normal
+ [IN-S] - sibling(of the element [B]) with 3D transform and 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 +
+
+
+

An element with 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-mode other 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:scroll2 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-mode other than normal, overflow:scroll and 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:scroll and blended with position: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-mode other than normal, position:fixed and 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:hidden and border-radius2 elements required: [P] and [B]
+ [P] - parent element with a property that creates a stacking context (e.g. position:fixed)
+ [P] has overflow:hidden and border-radius specified (e.g.50%)
+ [B] - element with mix-blend-mode other than normal with content that lies outside the parent element, over a rounded corner
+ Set the background-color of the body to 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:hidden and border-radius3 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-mode other than normal, overflow:hidden and border-radius specified (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:hidden and border-radius between the parent and the blended element3 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-mode other than normal that overflows the parents [IN-P] dimensions + [IN-P] - child(of the element [P]) with overflow:hidden and border-radius specified (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 +
+
+
+

Other test cases

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected 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-mode other than normal and border-image specified as a png file +
The color of the parent element [P] mixes with the color of the child element.
+ The color of the border-image mixes with the color of the parent element [P]. +
Blending with <canvas> 2 elements required: [B] and [IN-S]
+ [B] - <canvas> element with mix-blend-mode other than normal
+ [IN-S] - Sibling of the <canvas> element with some text
+ The [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 with mix-blend-mode other 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 with mix-blend-mode other 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 with mix-blend-mode other 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 with mix-blend-mode other than normal +
The color of the <iframe> element [B] mixes with the color of the parent element [P].
Blended element with mask property2 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-mode other than normal and mask property 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-path property 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-mode other than normal and clip-path property 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 filter property2 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-mode other than normal and filter property value other than none
The filter is applied and the result is mixed with the parent element
Blended element with transition2 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-mode other than normal and transition-property for opacity
The transition is applied and the result is mixed with the parent element
Blended element with animation2 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-mode other than normal and animation specified
The animation is applied to the child element and the result is mixed with the parent element
Image element2 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) with mix-blend-mode other than normal
The color of the <img> is mixed with the color of the <div>.
SVG element2 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-mode other than normal
The color of the SVG is mixed with the color of the <div>.
Paragraph element2 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-mode other than normal
The color of the text from the paragraph element is mixed with the color of the <div>
Paragraph element and background-image2 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 p element with some text and mix-blend-mode other than normal
The color of the text from the p element is mixed with the background image of the <div>.
Set blending from JavaScript2 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 no mix-blend-mode specified
+ From JavaScript, set the mix-blend-mode property for the child <div> to a value other than normal
The colors of the <div> elements are mixed.
+
+
+
+

Test cases for SVG elements with mix-blend-mode

+
+

mix-blend-mode with simple SVG graphical elements

+

Refers 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 nameElements and stylesExpected result
Circle with SVG backgroundSet a background color for the SVG.
+ Create 16 circle elements and fill them with a solid color. +
Apply each mix-blend-mode on them.
The color of the circle is mixed with the color of the background.
Ellipse with SVG backgroundSet a background color for the SVG.
+ Create an ellipse element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the ellipse is mixed with the color of the background.
Image with SVG backgroundSet a background color for the SVG. +
Create an image element and apply a mix-blend-mode other than normal.
The image is mixed with the color of the background.
Line with SVG backgroundSet a background color for the SVG. +
Create a line element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the line is mixed with the color of the background.
Path with SVG backgroundSet a background color for the SVG. +
Create a path element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the path is mixed with the color of the background.
Polygon with SVG backgroundSet a background color for the SVG. +
Create a polygon element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the polygon is mixed with the color of the background.
Polyline with SVG backgroundSet a background color for the SVG. +
Create a polyline element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the polyline is mixed with the color of the background.
Rect with SVG backgroundSet a background color for the SVG. +
Create a rect element and fill it with a solid color. +
Apply a mix-blend-mode on it other than normal.
The color of the rect is mixed with the color of the background.
Text with SVG backgroundSet a background color for the SVG. +
Create a text element and apply a mix-blend-mode other than normal.
The text is mixed with the color of the background.
Text having tspan with SVG backgroundSet a background color for the SVG. +
Create a text element and a tspan inside it. +
Apply a mix-blend-mode other than normal on the tspan.
The text is mixed with the color of the background.
Gradient with SVG backgroundSet a background color for the SVG. +
Create a rect element and fill it with a gradient. +
Apply a mix-blend-mode on it other than normal.
The gradient is mixed with the color of the background.
Pattern with SVG backgroundSet a background color for the SVG. +
Create a rect element and fill it with a pattern. +
Apply a mix-blend-mode on it other than normal.
The pattern is mixed with the color of the background.
Set blending on an element from JavaScriptSet a background color for the SVG. +
Create a rect element and fill it with a solid color. +
Apply a mix-blend-mode (other than normal) on it from JavaScript.
The color of the rect is mixed with the color of the background.
Marker with SVG backgroundSet a background color for the SVG. +
Create a line element containing a marker. +
Apply a mix-blend-mode other than normal on the marker.
The marker color is mixed with the color of the background.
Metadata with SVG backgroundSet a background color for the SVG. +
Create a metadata element containing an embedded pdf. +
Apply a mix-blend-mode other than normal on the marker.
The metadata content is not mixed with the color of the background.
ForeignObject with SVG backgroundSet a background color for the SVG. +
Create a foreignObject element containing a simple xhtml file. +
Apply a mix-blend-mode other than normal on the marker.
The foreignObject content is not mixed with the color of the background.
+
+
+

mix-blend-mode with SVG groups

+ + + + + + + + + + + +
Test nameElements and stylesExpected result
Group of overlapping elements with SVG backgroundSet a background color for the SVG. +
Create a group element containing two overlapping rect elements, each filled with a different solid color. +
Apply a mix-blend-mode other than normal on the group.
The group is mixed as a whole with the color of the background.
+
+
+

mix-blend-mode with isolated groups

+

Refers 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: +

    +
  • opacity
  • +
  • filters
  • +
  • 3D transforms (2D transforms must NOT cause isolation)
  • +
  • blending
  • +
  • masking
  • +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Blending two elements in an isolated groupSet a background color for the SVG.
+ Create a group element containing two overlapping rect elements, each filled with a different solid color.
+ Apply opacity less than 1 on the group and a mix-blend-mode other than normal on the second rect.
Only the intersection of the rect elements should mix.
Blending in a group with opacitySet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply opacity less than 1 on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Blending in a group with filterSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply a filter on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Blending in a group with 2D transformSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply a transform on the group and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Blending in a group with 3D transformSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply a 3d transform on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Blending in a group with a maskSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply a mask on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Blending in a group with mix-blend-modeSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply a mix-blend-mode other than normal on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
+
+
+

Other test cases for SVG

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Blend with element having opacitySet a background color for the SVG.
+ Create a rect element filled with a different solid color.
+ Apply opacity less than 1 and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Blend with element having strokeSet a background color for the SVG.
+ Create a rect element filled with a different solid color.
+ Apply a stroke and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Blend with element having stroke-opacitySet a background color for the SVG.
+ Create a rect element filled with a different solid color.
+ Apply a stroke, stroke-opacity less than 1 and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Blend with element having stroke-dasharraySet a background color for the SVG.
+ Create a rect element filled with a different solid color.
+ Apply a stroke-dasharray and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Blend with element having transformSet a background color for the SVG.
+ Create an image element. Apply a transform (any combination of translate, rotate, scale, skew) and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with SVG having viewbox and preserveAspectRatio setSet a background color for the SVG, as well as viewbox and preserveAspectRatio.
+ Create a rect element filled with a different solid color and apply a mix-blend-mode other than normal on it.
The rect will mix with the content behind it.
Blend with an element having color-profile setSet a background color for the SVG.
+ Create an image element. Apply a color-profile (sRGB, for example) and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with an element having overflowSet a background color for the SVG.
+ Create an image larger than the SVG.
+ Apply overflow (visible, hidden, scroll) and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with an element having clip-pathSet a background color for the SVG.
+ Create an image element. Apply a clip-path and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with an element having a maskSet a background color for the SVG.
+ Create an image element.
+ Apply a mask and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with an element having a filterSet a background color for the SVG.
+ Create an image element.
+ Apply a filter and a mix-blend-mode other than normal on the image.
The image will mix with the content behind it.
Blend with an animated elementSet a background color for the SVG.
+ Create a rect element filled with a different solid color.
+ Apply an animateTransform and a mix-blend-mode other than normal on the rect.
The rect will mix with the content behind it.
Set blending from an SVG script elementSet a background color for the SVG.
+ Create a rect element and fill it with a solid color.
+ Apply a mix-blend-mode (other than normal) on it from an svg script element.
The rect will mix with the content behind it.
+
+
+
+

Test cases for background-blend-mode

+
+

Blending between the background layers and the background color for an element with background-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 nameElements and stylesExpected result
Images with different formatsElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+ Tests should be created for <image> with different formats such as PNG, JPEG or SVG +
The content of the background-image is mixed with the color of the background-color
Gradient and background color + Element with +
    +
  • background-image set to an <gradient>
  • +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
Image and gradient + Element with +
    +
  • background-image set to an <image> on top of a <gradient>
  • +
  • background-blend-mode other than normal
  • +
+
The content of the <image> is mixed with the content of the <gradient> +
Gradient and imageElement with +
    +
  • background-image set to a <gradient> on top of an <image>
  • +
  • background-blend-mode other than normal
  • +
+
The content of the <image> is mixed with the content of the <gradient>
Two gradientsElement with +
    +
  • background-image set to a <gradient> on top of another <gradient>
  • +
  • background-blend-mode other than normal
  • +
The content of the two gradients is mixed
Two imagesElement with +
    +
  • background-image set to an <image> on top of another <image>
  • +
  • background-blend-mode other than normal
  • +
The content of the two images is mixed
Image and background color with transparencyElement with +
    +
  • background-image set to an <image> with transparency(e.g. PNG images)
  • +
  • background-color set to a transparent color
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
Cross-fade image and gradientElement with +
    +
  • background-image set to a cross-fade() image on top of a <gradient>
  • +
  • background-blend-mode other than normal
  • +
+
The content of the cross-faded image is mixed with the content of the <gradient>
SVG image and background colorElement with +
    +
  • background-image set to a data URI for an SVG image
  • +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+
The content of the image is mixed with the color of the background
Animated gif image and background colorElement with +
    +
  • background-image set to an animated gif image
  • +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+
The content of the image is mixed with the color of the background
Set background-blend-mode from JavaScriptElement with +
    +
  • background-image set to a gradient
  • +
  • background-color set to a fully opaque color
  • +
  • no background-blend-mode explicitly specified
  • + From JavaScript, set the background-blend-mode property to a value other than normal. +
+
The content of the gradient is mixed with the color of the background
background-blend-mode on element with 3D transformElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
  • transform set to a 3D function like rotateX, rotateY or translateZ
  • +
+
The content of the image is mixed with the color of the background
+
+
+

Background layers do not blend with content outside the background (or behind the element)

+

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 nameElements and stylesExpected result
One background layerElement with +
    +
  • background-image set to an <image>
  • +
  • background-blend-mode other than normal
  • +
+
The background-image is not mixed with anything outside the element
Two elements2 elements required: a parent element with a child.
+ Each one with the following properties: +
    +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+
No blending between the background colors of the two elements
Parent and child with background-blend-mode2 elements required: a parent element with a child
+ Parent properties:
+
    +
  • background-color set to a fully opaque color
  • +
  • background-blend-mode other than normal
  • +
+ Child properties:
+
    +
  • background-image set to an <image>
  • +
  • background-blend-mode other than normal
  • +
+
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 layer

+

Refers 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 nameElements and stylesExpected result
Different blend modes applied between layersElement with +
    +
  • background-image set to an <image-list> containing three images: (e.g. I1, I2 and I3 )
  • +
  • background-blend-mode set to different blendmode for every image: (e.g. multiply, difference, screen)
  • +
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 list

+

Refers 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 nameElements and stylesExpected result
Blend mode list repeatElement with +
    +
  • background-image set to an <image-list> containing three images
  • +
  • background-blend-mode set to two different blendmode values
  • +
The unspecified blend modes should be obtained by repeating the blend mode list from the beginning
+
+
+

The default 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 nameElements and stylesExpected result
Default blend mode for 'background' shorthandElement with +
    +
  • background property set to an image and a color
  • +
  • No value explicitly set for background-blend-mode
  • +
The computed value of background-blend-mode is 'normal' +
+
+
+

background-blend-mode for an element with background-position

+ + + + + + + + + + + +
Test nameElements and stylesExpected result
background-position percentageElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-position specified in percentage, such as 50% 50%
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image is correctly positioned +
+
+
+

background-blend-mode for an element with background-size

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Background size defined in pixelsElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-size specified in pixels
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image has the correct size +
Background size defined in percentage (second phase)Element with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-size specified in percentage
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image has the correct size +
Background size coverElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-size set to cover
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image has the correct size +
Background size containElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-size set to contain
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image has the correct size +
+
+
+

background-blend-mode for an element with background-repeat

+ + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
background-repeat set to no-repeatElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-repeat set to no-repeat
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background-image is not repeated +
background-repeat set to spaceElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-repeat set to space
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+
background-repeat set to roundElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-repeat set to round
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+
+
+
+

background-blend-mode for an element with background-clip

+ + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
background-clip set to padding-boxElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-clip set to padding-box
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ No background is drawn below the border (background extends to the outside edge of the padding) +
background-clip set to content-boxElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-clip set to content-box
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background is painted within (clipped to) the content box +
+
+
+

background-blend-mode for an element with background-origin

+ + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
background-origin set to border-boxElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-origin set to border-box
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background extends to the outside edge of the border (but underneath the border in z-ordering) +
background-origin set to content-boxElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-origin set to content-box
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background is painted within (clipped to) the content box +
+
+
+

background-blend-mode for an element with background-attachement

+ + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
background-attachment set to fixedElement with +
    +
  • background-image set to an <image>
  • +
  • background-color set to a fully opaque color
  • +
  • background-attachment set to fixed
  • +
  • background-blend-mode other than normal
  • +
+
The content of the background-image is mixed with the color of the background-color
+ The background image will not scroll with its containing element, instead remaining stationary within the viewport +
2 background images with background-attachment set to fixed, scrollElement with +
    +
  • background-image set to 2 <image>(s)
  • +
  • background-attachment set to fixed, scroll
  • +
  • background-blend-mode other than normal
  • +
+
The background images will be mixed when they overlap while scrolling +
+
+
+
+

Test cases for isolation

+
+

An element with isolation:isolate creates a stacking context

+

Refers to the following assertion in the spec: For CSS, setting ‘isolation’ to ‘isolate’ will turn the element into a stacking context [CSS21].

+ + + + + + + + + + + +
Test nameElements and stylesExpected result
Isolation isolateHave an element with isolation set to isolateThe element creates a stacking context.
+
+
+

An element with isolation:isolate creates an isolated group for blended children

+ + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Isolation of blended child which overflows3 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:isolate set.
+ [B] - element with mix-blend-mode other than normal
+ The 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 pixels3 elements required: + [P], + [IN-P] and + [B]
+ [P] - parent element with a property that creates a stacking context (e.g. position:fixed); the element background-color is other than transparent
+ [IN-P] - Intermediate child element between the parent [P] and the child [B]
+ The intermediate element has text content, default value for background-color and isolation:isolate set
+ [B] - element with mix-blend-mode other than normal +
+ 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]. +
Isolate inside a stacking context created by a 3d transform + 3 elements required: + [P], + [IN-P] and + [B]
+ [P] - parent element with a 3D transform applied
+ [IN-P] - Intermediate child element between the parent [P] and the child [B]
+ The intermediate element has isolation:isolate set
+ [B] - element with mix-blend-mode other than normal
+
+ 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]. +
+
+
+

An element with isolation:auto set does not change the elements existing stacking context behavior

+ + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Isolation autoHave an element with isolation explicitly set to auto, and no other style that would create a stacking contextThe element does not create a stacking context - the computed value of its z-index is value auto
Stacking context not affected by isolation2 elements required: + [P] and + [B]
+ [P] - parent element with a property that creates a stacking context (e.g. position:fixed); This element has isolation explicitly set to auto
+ [B] - element with mix-blend-mode other than normal
+ The blending element [B] has content that lies outside the parent element.
+ Set the background-color of the body to 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 isolation to auto does not affect the creation of a stacking context by other properties. +
+
+
+
+

Test cases for isolation in SVG

+
+

In SVG, an element with isolation:isolate creates an isolated group for blended children

+

Refers to the following assertion in the spec: In SVG, this defines whether an element is isolated or not.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Blending in an isolated groupSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply isolation:isolate on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Blending two elements in an isolated groupSet a background color for the SVG.
+ Create a group element containing two overlapping rect elements, each filled with a different solid color.
+ Apply isolation:isolate on the group and a mix-blend-mode other than normal on the second rect.
Only the intersection of the rect elements should mix.
Blending in an isolated group with 2D transformSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply isolation:isolate and 2D transform on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
Set isolation on an element from JavaScriptSet a background color for the SVG. +
Create a rect element and fill it with a solid color and a mix-blend-mode other than normal. +
Apply isolation:isolate on it from JavaScript.
The rect will not mix with the content behind it.
+
+
+

In SVG, an element with isolation:auto set does not change the rendering behaviour

+ + + + + + + + + + + + + + + + +
Test nameElements and stylesExpected result
Blending a group with isolation:autoSet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply isolation:auto on the group and a mix-blend-mode other than normal on the rect.
The element will mix with the content behind it.
Blending in a group with opacitySet a background color for the SVG.
+ Create a group element containing a rect element filled with a different solid color.
+ Apply opacity less than 1 and isolation:auto on the group and a mix-blend-mode other than normal on the rect.
The rect will not mix with the content behind it.
+
+
+ + -- cgit v1.2.3