test-plan.html (121765B)
1 <!DOCTYPE html> 2 <html lang="en" dir="ltr" typeof="bibo:Document " about="" property="dcterms:language" content="en" prefix="bibo: http://purl.org/ontology/bibo/ w3p: http://www.w3.org/2001/02pd/rec54#"><head> 3 <title>Compositing and Blending Test Plan</title> 4 <meta charset="utf-8"> 5 6 7 <style> 8 table 9 { 10 border-collapse:collapse; 11 } 12 table, td, th 13 { 14 border:1px solid black; 15 padding: 13px; 16 } 17 table 18 { 19 width: 100%; 20 } 21 img 22 { 23 width: 400px; 24 } 25 </style> 26 <style>/***************************************************************** 27 * ReSpec 3 CSS 28 * Robin Berjon - http://berjon.com/ 29 *****************************************************************/ 30 31 /* --- INLINES --- */ 32 em.rfc2119 { 33 text-transform: lowercase; 34 font-variant: small-caps; 35 font-style: normal; 36 color: #900; 37 } 38 39 h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym, 40 h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr { 41 border: none; 42 } 43 44 dfn { 45 font-weight: bold; 46 } 47 48 a.internalDFN { 49 color: inherit; 50 border-bottom: 1px solid #99c; 51 text-decoration: none; 52 } 53 54 a.externalDFN { 55 color: inherit; 56 border-bottom: 1px dotted #ccc; 57 text-decoration: none; 58 } 59 60 a.bibref { 61 text-decoration: none; 62 } 63 64 cite .bibref { 65 font-style: normal; 66 } 67 68 code { 69 color: #ff4500; 70 } 71 72 /* --- TOC --- */ 73 .toc a, .tof a { 74 text-decoration: none; 75 } 76 77 a .secno, a .figno { 78 color: #000; 79 } 80 81 ul.tof, ol.tof { 82 list-style: none outside none; 83 } 84 85 .caption { 86 margin-top: 0.5em; 87 font-style: italic; 88 } 89 90 /* --- TABLE --- */ 91 table.simple { 92 border-spacing: 0; 93 border-collapse: collapse; 94 border-bottom: 3px solid #005a9c; 95 } 96 97 .simple th { 98 background: #005a9c; 99 color: #fff; 100 padding: 3px 5px; 101 text-align: left; 102 } 103 104 .simple th[scope="row"] { 105 background: inherit; 106 color: inherit; 107 border-top: 1px solid #ddd; 108 } 109 110 .simple td { 111 padding: 3px 10px; 112 border-top: 1px solid #ddd; 113 } 114 115 .simple tr:nth-child(even) { 116 background: #f0f6ff; 117 } 118 119 /* --- DL --- */ 120 .section dd > p:first-child { 121 margin-top: 0; 122 } 123 124 .section dd > p:last-child { 125 margin-bottom: 0; 126 } 127 128 .section dd { 129 margin-bottom: 1em; 130 } 131 132 .section dl.attrs dd, .section dl.eldef dd { 133 margin-bottom: 0; 134 } 135 </style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/w3c-unofficial"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head> 136 <body class="h-entry" style="" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader"> 137 <p> 138 139 </p> 140 <h1 class="title p-name" id="title" property="dcterms:title">Compositing and Blending Test Plan</h1> 141 142 <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-12-03T10:52:36.000Z" id="unofficial-draft-03-december-2013">Unofficial Draft <time class="dt-published" datetime="2013-12-03">03 December 2013</time></h2> 143 <dl> 144 145 146 147 148 149 150 151 <dt>Editors:</dt> 152 <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Mirela Budaes</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.adobe.com/">Adobe Systems, Inc.</a></span> 153 </dd> 154 <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Horia Olaru</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.adobe.com/">Adobe Systems, Inc.</a></span> 155 </dd> 156 <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Mihai Tica</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.adobe.com/">Adobe Systems, Inc.</a></span> 157 </dd> 158 159 160 161 </dl> 162 163 164 165 166 167 168 <p class="copyright"> 169 This document is licensed under a 170 <a class="subfoot" href="http://creativecommons.org/licenses/by/3.0/" rel="license">Creative Commons 171 Attribution 3.0 License</a>. 172 </p> 173 174 175 176 <hr> 177 </div> 178 <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2> 179 <p> 180 This document is intended to be used as a guideline for the testing 181 activities related to the Compositing and Blending spec [<cite><a class="bibref" href="#bib-compositing-1">compositing-1</a></cite>]. Its main 182 goal is to provide an overview of the general testing areas and an informative 183 description of possible test cases. 184 </p> 185 <p> 186 This document is not meant to replace the spec in determining the 187 normative and non-normative assertions to be tested, but rather 188 complement it. 189 </p> 190 </section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2> 191 192 <p> 193 This document is merely a public working draft of a potential specification. It has 194 no official standing of any kind and does not represent the support or consensus of any 195 standards organisation. 196 </p> 197 198 199 </section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#goals" class="tocxref"><span class="secno">1. </span>Goals</a><ul class="toc"><li class="tocline"><a href="#providing-guidance-on-testing" class="tocxref"><span class="secno">1.1 </span>Providing guidance on testing</a></li><li class="tocline"><a href="#creating-automation-friendly-tests" class="tocxref"><span class="secno">1.2 </span>Creating automation-friendly tests</a></li></ul></li><li class="tocline"><a href="#approach" class="tocxref"><span class="secno">2. </span>Approach</a></li><li class="tocline"><a href="#testing-areas" class="tocxref"><span class="secno">3. </span>Testing areas</a><ul class="toc"><li class="tocline"><a href="#explicit-testing-areas" class="tocxref"><span class="secno">3.1 </span>Explicit testing areas</a></li><li class="tocline"><a href="#implicit-testing-areas" class="tocxref"><span class="secno">3.2 </span>Implicit testing areas</a></li></ul></li><li class="tocline"><a href="#test-cases-description" class="tocxref"><span class="secno">4. </span>Test cases description</a><ul class="toc"><li class="tocline"><a href="#test-cases-for-mix-blend-mode" class="tocxref"><span class="secno">4.1 </span>Test cases for <code>mix-blend-mode</code></a><ul class="toc"><li class="tocline"><a href="#an-element-with-mix-blend-mode-other-than-normal-creates-a-stacking-context" class="tocxref"><span class="secno">4.1.1 </span>An element with <code>mix-blend-mode</code> other than normal creates a stacking context</a></li><li class="tocline"><a href="#an-element-with-mix-blend-mode-blends-with-the-content-within-the-current-stacking-context" class="tocxref"><span class="secno">4.1.2 </span>An element with <code>mix-blend-mode</code> blends with the content within the current stacking context</a></li><li class="tocline"><a href="#an-element-with-mix-blend-mode-doesn-t-blend-with-anything-outside-the-current-stacking-context" class="tocxref"><span class="secno">4.1.3 </span>An element with <code>mix-blend-mode</code> doesn't blend with anything outside the current stacking context</a></li><li class="tocline"><a href="#an-element-with-mix-blend-mode-other-than-normal-must-cause-a-group-to-be-isolated" class="tocxref"><span class="secno">4.1.4 </span>An element with <code>mix-blend-mode</code> other than normal must cause a group to be isolated</a></li><li class="tocline"><a href="#an-element-with-mix-blend-mode-must-work-properly-with-css-transforms" class="tocxref"><span class="secno">4.1.5 </span>An element with <code>mix-blend-mode</code> must work properly with css transforms</a></li><li class="tocline"><a href="#an-element-with-mix-blend-mode-must-work-properly-with-elements-with-overflow-property" class="tocxref"><span class="secno">4.1.6 </span>An element with <code>mix-blend-mode</code> must work properly with elements with <code>overflow</code> property</a></li><li class="tocline"><a href="#other-test-cases" class="tocxref"><span class="secno">4.1.7 </span>Other test cases</a></li></ul></li><li class="tocline"><a href="#test-cases-for-svg-elements-with-mix-blend-mode" class="tocxref"><span class="secno">4.2 </span>Test cases for SVG elements with <code>mix-blend-mode</code></a><ul class="toc"><li class="tocline"><a href="#mix-blend-mode-with-simple-svg-graphical-elements" class="tocxref"><span class="secno">4.2.1 </span><code>mix-blend-mode</code> with simple SVG graphical elements</a></li><li class="tocline"><a href="#mix-blend-mode-with-svg-groups" class="tocxref"><span class="secno">4.2.2 </span><code>mix-blend-mode</code> with SVG groups</a></li><li class="tocline"><a href="#mix-blend-mode-with-isolated-groups" class="tocxref"><span class="secno">4.2.3 </span><code>mix-blend-mode</code> with isolated groups</a></li><li class="tocline"><a href="#other-test-cases-for-svg" class="tocxref"><span class="secno">4.2.4 </span>Other test cases for SVG</a></li></ul></li><li class="tocline"><a href="#test-cases-for-background-blend-mode" class="tocxref"><span class="secno">4.3 </span>Test cases for <code>background-blend-mode</code></a><ul class="toc"><li class="tocline"><a href="#blending-between-the-background-layers-and-the-background-color-for-an-element-with-background-blend-mode" class="tocxref"><span class="secno">4.3.1 </span>Blending between the background layers and the background color for an element with <code>background-blend-mode</code> </a></li><li class="tocline"><a href="#background-layers-do-not-blend-with-content-outside-the-background-or-behind-the-element" class="tocxref"><span class="secno">4.3.2 </span>Background layers do not blend with content outside the background (or behind the element)</a></li><li class="tocline"><a href="#background-blend-mode-list-values-apply-to-the-corresponding-background-layer" class="tocxref"><span class="secno">4.3.3 </span> <code>background-blend-mode</code> list values apply to the corresponding background layer</a></li><li class="tocline"><a href="#background-blend-mode-list-values-are-repeated-if-the-list-is-shorter-than-the-background-layer-list" class="tocxref"><span class="secno">4.3.4 </span><code>background-blend-mode</code> list values are repeated if the list is shorter than the background layer list</a></li><li class="tocline"><a href="#the-default-background-blend-mode-value-for-the-background-shorthand-is-normal" class="tocxref"><span class="secno">4.3.5 </span>The default <code>background-blend-mode</code> value for the <code>background</code> shorthand is 'normal' </a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-position" class="tocxref"><span class="secno">4.3.6 </span><code>background-blend-mode</code> for an element with <code>background-position</code></a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-size" class="tocxref"><span class="secno">4.3.7 </span><code>background-blend-mode</code> for an element with <code>background-size</code></a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-repeat" class="tocxref"><span class="secno">4.3.8 </span><code>background-blend-mode</code> for an element with <code>background-repeat</code></a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-clip" class="tocxref"><span class="secno">4.3.9 </span><code>background-blend-mode</code> for an element with <code>background-clip</code></a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-origin" class="tocxref"><span class="secno">4.3.10 </span><code>background-blend-mode</code> for an element with <code>background-origin</code></a></li><li class="tocline"><a href="#background-blend-mode-for-an-element-with-background-attachement" class="tocxref"><span class="secno">4.3.11 </span><code>background-blend-mode</code> for an element with <code>background-attachement</code></a></li></ul></li><li class="tocline"><a href="#test-cases-for-isolation" class="tocxref"><span class="secno">4.4 </span>Test cases for <code>isolation</code></a><ul class="toc"><li class="tocline"><a href="#an-element-with-isolation-isolate-creates-a-stacking-context" class="tocxref"><span class="secno">4.4.1 </span>An element with <code>isolation:isolate</code> creates a stacking context</a></li><li class="tocline"><a href="#an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children" class="tocxref"><span class="secno">4.4.2 </span>An element with <code>isolation:isolate</code> creates an isolated group for blended children</a></li><li class="tocline"><a href="#an-element-with-isolation-auto-set-does-not-change-the-elements-existing-stacking-context-behavior" class="tocxref"><span class="secno">4.4.3 </span>An element with <code>isolation:auto</code> set does not change the elements existing stacking context behavior</a></li></ul></li><li class="tocline"><a href="#test-cases-for-isolation-in-svg" class="tocxref"><span class="secno">4.5 </span>Test cases for <code>isolation</code> in SVG</a><ul class="toc"><li class="tocline"><a href="#in-svg-an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children" class="tocxref"><span class="secno">4.5.1 </span>In SVG, an element with <code>isolation:isolate</code> creates an isolated group for blended children</a></li><li class="tocline"><a href="#in-svg-an-element-with-isolation-auto-set-does-not-change-the-rendering-behaviour" class="tocxref"><span class="secno">4.5.2 </span>In SVG, an element with <code>isolation:auto</code> set does not change the rendering behaviour</a></li></ul></li></ul></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section> 200 <section id="goals"> 201 <!--OddPage--><h2 aria-level="1" role="heading" id="h2_goals"><span class="secno">1. </span>Goals</h2> 202 <section id="providing-guidance-on-testing"> 203 <h3 aria-level="2" role="heading" id="h3_providing-guidance-on-testing"><span class="secno">1.1 </span>Providing guidance on testing</h3> 204 <p> 205 In order to increase the quality of the test contributions, this 206 document offers a set of test cases description for conducting testing (see 207 <a href="#test-cases-description" class="sectionRef sec-ref">section <span class="secno">4.</span> <span class="sec-title">Test cases description</span></a>). 208 </p> 209 </section> 210 <section id="creating-automation-friendly-tests"> 211 <h3 aria-level="2" role="heading" id="h3_creating-automation-friendly-tests"><span class="secno">1.2 </span>Creating automation-friendly tests</h3> 212 <p> 213 In terms of actual tests produced for the CSS Compositing and Blending, the main goal 214 is to ensure that most tests are automatable (i.e. they're either 215 reftests or use <code>testharness.js</code>). Even where manual tests 216 are absolutely necessary they should be written so that they can be 217 easily automated. This means that even if a manual test requires user 218 interaction, the validation or PASS/FAIL conditions should still be 219 clear enough as to allow automatic validation if said interaction is 220 later automated. 221 </p> 222 </section> 223 </section> 224 <section id="approach"> 225 <!--OddPage--><h2 aria-level="1" role="heading" id="h2_approach"><span class="secno">2. </span>Approach</h2> 226 <p> 227 Since CSS blending has only three new CSS properties, 228 the approach is to deep dive into every aspect of the spec as much as possible. 229 230 Tests will be created for the testing areas listed in <a href="#testig-areas" class="sectionRef"></a> 231 and having as guidance the test cases description from <a href="#test-cases-description" class="sectionRef sec-ref">section <span class="secno">4.</span> <span class="sec-title">Test cases description</span></a>. 232 </p> 233 </section> 234 <section id="testing-areas"> 235 <!--OddPage--><h2 aria-level="1" role="heading" id="h2_testing-areas"><span class="secno">3. </span>Testing areas</h2> 236 <section id="explicit-testing-areas"> 237 <h3 aria-level="2" role="heading" id="h3_explicit-testing-areas"><span class="secno">3.1 </span>Explicit testing areas</h3> 238 <p> 239 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 240 exhaustive and some normative behaviors may not be contained in it. 241 When in doubt, consult the Blending and Compositing spec or ask a question on the 242 <a href="http://lists.w3.org/Archives/Public/www-style/">mailing 243 list</a>. 244 </p> 245 <p>Below is the list of explicit testing areas:</p> 246 <ol> 247 <li>Proper parsing of the CSS properties and rendering according to the spec 248 <ul><code>mix-blend-mode</code></ul> 249 <ul><code>isolation</code></ul> 250 <ul><code>background-blend-mode</code></ul> 251 </li> 252 <li>SVG blending</li> 253 <li>Canvas 2D blending</li> 254 </ol> 255 </section> 256 <section id="implicit-testing-areas"> 257 <h3 aria-level="2" role="heading" id="h3_implicit-testing-areas"><span class="secno">3.2 </span>Implicit testing areas</h3> 258 <p> 259 These are testing areas either normatively defined in other specs 260 that explicitly refer to the Blending and Compositing spec (e.g. [<cite><a class="bibref" href="#bib-css3-transforms">css3-transforms</a></cite>]) 261 or simply not explicitly defined, but implied by various aspects of 262 the spec (e.g. processing model, CSS 2.1 compliance, etc.). 263 Please note that while detailed, this list is not necessarily 264 exhaustive and some normative behaviors may not be contained in it. 265 When in doubt, consult the Blending and Compositing spec or ask a question on the 266 <a href="http://lists.w3.org/Archives/Public/www-style/">mailing 267 list</a>. 268 </p> 269 <p>Below is the list of implicit testing areas:</p> 270 <ol> 271 <li>Blending different types of elements 272 <ul> 273 <li><code><video></code></li> 274 <li><code><canvas></code></li> 275 <li><code><table></code></li> 276 </ul> 277 </li> 278 <li>Blending elements with specific style rules applied 279 <ul> 280 <li><code>transforms</code></li> 281 <li><code>transitions</code> </li> 282 <li><code>animations</code> </li> 283 </ul> 284 </li> 285 </ol> 286 </section> 287 </section> 288 <section id="test-cases-description"> 289 <!--OddPage--><h2 aria-level="1" role="heading" id="h2_test-cases-description"><span class="secno">4. </span>Test cases description</h2> 290 <section id="test-cases-for-mix-blend-mode"> 291 <h3 aria-level="2" role="heading" id="h3_test-cases-for-mix-blend-mode"><span class="secno">4.1 </span>Test cases for <code>mix-blend-mode</code></h3> 292 <p> 293 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. 294 </p> 295 <p> 296 <img id="test_outline" src="test_template.png" alt="Mix-blend-mode sample elements"> 297 </p> 298 <p>The intended structure of the document is the following:</p> 299 <pre><body> 300 <div id="[P]"> 301 <div id="[IN-S]"></div> 302 <div id="[IN-P]"> 303 <div id="[B]"> 304 <div id="[CB]"></div> 305 </div> 306 </div> 307 </div> 308 </body> 309 </pre> 310 <p> Unless otherwise stated, test cases assume the following properties for the elements: <br> 311 </p><ul> 312 <li> default value for the <code>background-color</code> of the <code>body</code></li> 313 <li> <code>background-color</code> set to a fully opaque color for all the other elements </li> 314 </ul> 315 <p></p> 316 <p>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.</p> 317 <p><a href="http://www.w3.org/TR/CSS2/visuren.html#propdef-z-index">Here you can find a description of stacking contexts.</a> Note that z-index applied to positioned elements creates a stacking context. This means that for [P], we must set the z-index and position (absolute, for example) properties to make sure it creates the stacking context.</p> 318 <p>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. 319 </p><p></p> 320 <section id="an-element-with-mix-blend-mode-other-than-normal-creates-a-stacking-context"> 321 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-other-than-normal-creates-a-stacking-context"><span class="secno">4.1.1 </span>An element with <code>mix-blend-mode</code> other than normal creates a stacking context</h4> 322 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode">spec</a>: <q>Applying a blendmode other than ‘normal’ to the element must establish a new stacking context [CSS21].</q></p> 323 <table> 324 <tbody><tr> 325 <th>Test name</th> 326 <th>Elements and styles</th> 327 <th>Expected result</th> 328 </tr> 329 <tr> 330 <td>Simple <code><div></code></td> 331 <td>1 element required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 332 [B] - element with <code>mix-blend-mode</code> other than normal 333 </td> 334 <td>The element [B] creates a stacking context</td> 335 </tr> 336 </tbody></table> 337 </section> 338 <section id="an-element-with-mix-blend-mode-blends-with-the-content-within-the-current-stacking-context"> 339 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-blends-with-the-content-within-the-current-stacking-context"><span class="secno">4.1.2 </span>An element with <code>mix-blend-mode</code> blends with the content within the current stacking context</h4> 340 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#csscompositingrules_CSS">spec</a>: <q>An element that has blending applied, must blend with all the underlying content of the stacking context [CSS21] that that element belongs to.</q><br> 341 This section tests if the blending operation is performed. </p> 342 <table> 343 <tbody><tr> 344 <th>Test name</th> 345 <th>Elements and styles</th> 346 <th>Expected result</th> 347 </tr> 348 <tr> 349 <td>Blending simple elements </td> 350 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 351 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 352 [B] - element with <code>mix-blend-mode</code> other than normal 353 </td> 354 <td>The color of the parent element [P] mixes with the color of the child element [B].</td> 355 </tr> 356 <tr> 357 <td>Blending with a sibling</td> 358 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 359 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 360 [B] - element with <code>mix-blend-mode</code> other than normal <br> 361 [IN-S] - sibling of the element [B] <br> 362 The [IN-S] element visually overlaps the [B] element 363 </td> 364 <td>The colors of the parent element [P] and the sibling element [IN-S] mixes with the color of the blended element [B].</td> 365 </tr> 366 <tr> 367 <td>Blending with two levels of ascendants</td> 368 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="child of the element [P]">[IN-P]</a> <br> 369 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 370 [B] - element with <code>mix-blend-mode</code> other than normal <br> 371 [IN-P] - Intermediate child element between the parent [P] and the child [B] 372 </td> 373 <td>The colors of the parent element [P] and the child element [IN-P] mixes with the color of the blended element [B].</td> 374 </tr> 375 </tbody></table> 376 </section> 377 <section id="an-element-with-mix-blend-mode-doesn-t-blend-with-anything-outside-the-current-stacking-context"> 378 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-doesn-t-blend-with-anything-outside-the-current-stacking-context"><span class="secno">4.1.3 </span>An element with <code>mix-blend-mode</code> doesn't blend with anything outside the current stacking context</h4> 379 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#csscompositingrules_CSS">spec</a>: <q> An element that has blending applied, must blend with all the underlying content of the stacking context [CSS21] that that element belongs to.</q> <br> 380 This section tests if the isolation is performed. </p> 381 <table> 382 <tbody><tr> 383 <th>Test name</th> 384 <th>Elements and styles</th> 385 <th>Expected result</th> 386 </tr> 387 <tr> 388 <td>Blending child overflows the parent</td> 389 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 390 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 391 [B] - element with <code>mix-blend-mode</code> other than normal <br> 392 The blending element [B] has content that lies outside the parent element. <br> 393 Set the <code>background-color</code> of the <code>body</code> to a value other than default</td> 394 <td>The color of the parent element mixes with the color of the child element. <br> 395 The area of the child element outside of the parent element doesn't mix with the color of the <code>body</code></td> 396 </tr> 397 <tr> 398 <td>Parent with transparent pixels</td> 399 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 400 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 401 The element has some text inside and default value for <code>background-color</code> <br> 402 [B] - element with <code>mix-blend-mode</code> other than normal <br> 403 The <code>background-color</code> of the <code>body</code> has a value other than default</td> 404 <td>The color of the text from the parent element [P] mixes with the color of the child element [B]. <br> 405 No blending between the color of the <code>body</code> and the color of the blending element [B]. 406 </td> 407 </tr> 408 <tr> 409 <td>Parent with <code>border-radius</code></td> 410 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 411 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 412 [P] has <code>border-radius</code> specified (e.g.50%). <br> 413 [B] - element with <code>mix-blend-mode</code> other than normal <br> 414 [B] has content that lies outside the parent element, over a rounded corner. <br> 415 The <code>background-color</code> of the <code>body</code> has a value other than default. </td> 416 <td>The color of the parent element mixes with the color of the child element. <br> 417 The area of the child element which draws over the rounded corner doesn't mix with the color of the <code>body</code></td> 418 </tr> 419 </tbody></table> 420 </section> 421 <section id="an-element-with-mix-blend-mode-other-than-normal-must-cause-a-group-to-be-isolated"> 422 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-other-than-normal-must-cause-a-group-to-be-isolated"><span class="secno">4.1.4 </span>An element with <code>mix-blend-mode</code> other than normal must cause a group to be isolated</h4> 423 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#isolation">spec</a>: <q>operations that cause the creation of stacking context [CSS21] must cause a group to be isolated.</q> <br> 424 The following section also tests that mix-blend-mode is not inheritable. If you set mix-blend-mode on a parent, the child should not blend with the parent. Instead, the whole group should blend as a whole, using the parent's blending operator.</p> 425 <table> 426 <tbody><tr> 427 <th>Test name</th> 428 <th>Elements and styles</th> 429 <th>Expected result</th> 430 </tr> 431 <tr> 432 <td>Child of the blended element has opacity</td> 433 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the lement [B]">[CB]</a> <br> 434 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 435 [B] - element with <code>mix-blend-mode</code> other than normal <br> 436 [CB] - child of the element [B] with <code>opacity</code> less than one. </td> 437 <td>The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. <br> 438 No blending between [B] and [CB]</td> 439 </tr> 440 <tr> 441 <td>Overflowed child of the blended element</td> 442 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the lement [B]">[CB]</a> <br> 443 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 444 [B] - element with <code>mix-blend-mode</code> other than normal <br> 445 [CB] - child of the element [B] with content that lies outside the parent element [B]. 446 </td> 447 <td>The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. <br> 448 No blending between [B] and [CB]. There is only one color for the entire element [CB] </td> 449 </tr> 450 <tr> 451 <td>Blended element with transparent pixels</td> 452 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the lement [B]">[CB]</a> <br> 453 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 454 [B] - element with <code>mix-blend-mode</code> other than normal and transparent <code>background-color</code> <br> 455 [CB] - child of the element [B] 456 </td> 457 <td>The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. <br> 458 No blending between [B] and [CB]. </td> 459 </tr> 460 </tbody></table> 461 </section> 462 <section id="an-element-with-mix-blend-mode-must-work-properly-with-css-transforms"> 463 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-must-work-properly-with-css-transforms"><span class="secno">4.1.5 </span>An element with <code>mix-blend-mode</code> must work properly with css transforms</h4> 464 <table> 465 <tbody><tr> 466 <th>Test name</th> 467 <th>Elements and styles</th> 468 <th>Expected result</th> 469 </tr> 470 <tr> 471 <td>Parent with 3D transform</td> 472 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 473 [P] - parent element with <code>3D transform</code> <br> 474 [B] - element with <code>mix-blend-mode</code> other than normal 475 </td><td>The color of the parent element [P] mixes with the color of the child element [B] <br> 476 The element (and the content) of the element [P] is properly transformed 477 </td> 478 </tr> 479 <tr> 480 <td>Blended element with 3D transform</td> 481 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the lement [B]">[CB]</a> <br> 482 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 483 [B] - element with <code>mix-blend-mode</code> other than normal and <code>3D transform</code> <br> 484 [CB] - child of the element [B] </td> 485 <td> The color of the parent element [P] mixes with the color of the child element [B] <br> 486 The element (and the content) of the element [P] is properly transformed </td> 487 </tr> 488 <tr> 489 <td>Both parent and blended element with 3D transform</td> 490 <td> 2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 491 [P] - parent element with <code>3D transform</code> <br> 492 [B] - element with <code>mix-blend-mode</code> other than normal and <code>3D transform</code> 493 </td> 494 <td>The color of the parent element [P] mixes with the color of the child element [B] <br> 495 The elements (and the content) of the elements [P] and [B] are properly transformed</td> 496 </tr> 497 <tr> 498 <td>Blended element should force transform-style to flat</td> 499 <td>1 element required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 500 [B] - element with <code>mix-blend-mode</code> other than normal and <code>transform-style</code>. 501 </td> 502 <td>For each value of the <code>transform-style</code> (<code>preserve-3d</code> or <code>flat</code>), [B]'s computed value of <code>transform-style</code> is equal to <code>flat</code></td> 503 </tr> 504 <tr> 505 <td>Blended element with transform and preserve-3d</td> 506 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the lement [B]">[CB]</a> <br> 507 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 508 [B] - element with <code>mix-blend-mode</code> other than normal and transform with <code>transform-style:preserve-3d</code> <br> 509 [CB] - child of the element [B]. It has 3D transform property</td> 510 <td> The child element [CB] will NOT preserve its 3D position. <br> 511 <code>mix-blend-mode</code> override the behavior of <code>transform-style:preserve-3d</code>: 512 creates a flattened representation of the descendant elements <br> 513 The color of the group created by the child elements([B] and [CB]) will blend with the color of the parent element [P] </td> 514 </tr> 515 <tr> 516 <td>Blended element with transform and perspective</td> 517 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 518 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 519 [B] - element with <code>mix-blend-mode</code> other than normal and transform with <code>perspective</code> set to positive length </td> 520 <td>The colors of the parent and the child are mixed ([P] and [B]) <br> 521 The element (and the content) of the element [B] is properly transformed 522 </td> 523 </tr> 524 <tr> 525 <td>Sibling with 3D transform between the parent and the blended element</td> 526 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 527 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 528 [B] - element with <code>mix-blend-mode</code> other than normal <br> 529 [IN-S] - Sibling(of the element [B]) with <code>3D transform</code> between the parent [P] and the child [B] 530 </td> 531 <td>The colors of the parent element [P] and the transformed sibling element [IN-S] mixes with the color of the blended element [B].<br> 532 The element (and the content) of the element [IN-S] is properly transformed 533 </td> 534 </tr> 535 <tr> 536 <td>Parent with 3D transform and transition</td> 537 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 538 [P] - parent element with <code>3D transform</code> and transition <br> 539 [B] - element with <code>mix-blend-mode</code> other than normal 540 </td><td>The color of the parent element [P] mixes with the color of the child element [B] <br> 541 The element (and the content) of the element [P] is properly transformed 542 </td> 543 </tr> 544 <tr> 545 <td>Sibling with 3D transform(and transition) between the parent and the blended element</td> 546 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 547 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 548 [B] - element with <code>mix-blend-mode</code> other than normal <br> 549 [IN-S] - sibling(of the element [B]) with <code>3D transform</code> and transition between the parent [P] and the child [B] 550 </td> 551 <td>The colors of the parent element [P] and the transformed sibling element [IN-S] mixes with the color of the blended element [B].<br> 552 The element (and the content) of the element [IN-S] is properly transformed 553 </td> 554 </tr> 555 </tbody></table> 556 </section> 557 <section id="an-element-with-mix-blend-mode-must-work-properly-with-elements-with-overflow-property"> 558 <h4 aria-level="3" role="heading" id="h4_an-element-with-mix-blend-mode-must-work-properly-with-elements-with-overflow-property"><span class="secno">4.1.6 </span>An element with <code>mix-blend-mode</code> must work properly with elements with <code>overflow</code> property</h4> 559 <table> 560 <tbody><tr> 561 <td>Parent element with <code>overflow:scroll</code> </td> 562 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 563 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 564 [P] has <code>overflow:scroll</code> <br> 565 [B] - element with <code>mix-blend-mode</code> other than normal tat overflows the parents [P] dimensions so that it creates scrolling for the parent 566 </td><td>The color of the parent element [P] mixes with the color of the child element [B]. <br> 567 The scrolling mechanism is not affected. 568 </td> 569 </tr> 570 <tr> 571 <td>Blended element with <code>overflow:scroll</code></td> 572 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 573 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 574 [B] - element with <code>mix-blend-mode</code> other than normal, <code>overflow:scroll</code> and a child element that creates overflow for [B]</td> 575 <td>The color of the parent element [P] mixes with the color of the child element [B] <br> 576 The scrolling mechanism is not affected. 577 </td> 578 </tr> 579 <tr> 580 <td>Parent element with <code>overflow:scroll</code> and blended with <code>position:fixed</code> </td> 581 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 582 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 583 [P] has <code>overflow:scroll</code> <br> 584 [B] - element with <code>mix-blend-mode</code> other than normal, <code>position:fixed</code> and should overflow the parents [P] dimensions so that it creates scrolling for the parent</td> 585 <td>The color of the parent element [P] mixes with the color of the child element [B] <br> 586 The blending happens when scrolling the content of the parent element [P] too. <br> 587 The scrolling mechanism is not affected. 588 </td> 589 </tr> 590 591 <tr> 592 <td>Parent with <code>overflow:hidden</code></td> 593 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 594 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 595 [P] has <code>overflow:hidden</code><br> 596 [B] - element with <code>mix-blend-mode</code> other than normal with content that lies outside the parent element<br> 597 Set the <code>background-color</code> of the <code>body</code> to a value other than default.</td> 598 <td>The color of the parent element mixes with the color of the child element.</td> 599 </tr> 600 <tr> 601 <td>Blended element with <code>overflow:hidden</code></td> 602 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the element [B]">[CB]</a> <br> 603 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 604 [B] - element with <code>mix-blend-mode</code> other than normal and <code>overflow:hidden</code>. <br> 605 [CB] - child of the element [B], with content that lies outside the parent element. <br> </td> 606 <td>The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. <br> 607 No blending between [B] and [CB]. <br> 608 [CB] is properly clipped so no overflow is visible.</td> 609 </tr> 610 <tr> 611 <td>Intermediate child with <code>overflow:hidden</code>between the parent and the blended element</td> 612 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="child of the element [P]">[IN-P]</a> <br> 613 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 614 [B] - element with <code>mix-blend-mode</code> other than normal that overflows the parents [IN-P] dimensions 615 [IN-P] - child(of the element [P]) with <code>overflow:hidden</code> 616 </td> 617 <td>The colors of the parent element [P] and the child element [IN-P] mixes with the color of the blended element [B]. <br> 618 [B] is is properly clipped so no overflow is visible 619 </td> 620 </tr> 621 622 <tr> 623 <td>Parent with <code>overflow:hidden</code> and <code>border-radius</code></td> 624 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 625 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 626 [P] has <code>overflow:hidden</code> and <code>border-radius</code> specified (e.g.50%) <br> 627 [B] - element with <code>mix-blend-mode</code> other than normal with content that lies outside the parent element, over a rounded corner <br> 628 Set the <code>background-color</code> of the <code>body</code> to a value other than default.</td> 629 <td>The color of the parent element mixes with the color of the child element. <br> 630 The area of the child element which draws over the rounded corner is properly cut </td> 631 </tr> 632 <tr> 633 <td>Blended element with <code>overflow:hidden</code> and <code>border-radius</code></td> 634 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Child of the element [B]">[CB]</a> <br> 635 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 636 [B] - element with <code>mix-blend-mode</code> other than normal, <code>overflow:hidden</code> and <code>border-radius</code> specified (e.g.50%). <br> 637 [CB] - child of the element [B], with content that lies outside the parent element, over a rounded corner. <br> </td> 638 <td>The group created by the two child elements([B] and [CB]) is blended with the parent element [P]. <br> 639 No blending between [B] and [CB]. <br> 640 [CB] is properly clipped so no overflow is visible.</td> 641 </tr> 642 <tr> 643 <td>Intermediate child with <code>overflow:hidden</code> and <code>border-radius</code> between the parent and the blended element</td> 644 <td>3 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="child of the element [P]">[IN-P]</a> <br> 645 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 646 [B] - element with <code>mix-blend-mode</code> other than normal that overflows the parents [IN-P] dimensions 647 [IN-P] - child(of the element [P]) with <code>overflow:hidden</code> and <code>border-radius</code> specified (e.g.50%) 648 </td> 649 <td>The colors of the parent element [P] and the child element [IN-P] mixes with the color of the blended element [B]. <br> 650 [B] is is properly clipped so no overflow is visible 651 </td> 652 </tr> 653 </tbody></table> 654 </section> 655 <section id="other-test-cases"> 656 <h4 aria-level="3" role="heading" id="h4_other-test-cases"><span class="secno">4.1.7 </span>Other test cases</h4> 657 <table> 658 <tbody><tr> 659 <th>Test name</th> 660 <th>Elements and styles</th> 661 <th>Expected result</th> 662 </tr> 663 <tr> 664 <td>Blended element with <code>border-image</code> </td> 665 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 666 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 667 [B] - element with <code>mix-blend-mode</code> other than normal and <code>border-image</code> specified as a png file 668 </td> 669 <td>The color of the parent element [P] mixes with the color of the child element. <br> 670 The color of the <code>border-image</code> mixes with the color of the parent element [P]. 671 </td> 672 </tr> 673 <tr> 674 <td>Blending with <code><canvas></code> </td> 675 <td>2 elements required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 676 [B] - <code><canvas></code> element with <code>mix-blend-mode</code> other than normal <br> 677 [IN-S] - Sibling of the <code><canvas></code> element with some text <br> 678 The [IN-S] element overlaps the <code><canvas></code> element 679 </td> 680 <td>The content of the <code><canvas></code> element mixes with the color of the sibling element and the text [IN-S].</td> 681 </tr> 682 <tr> 683 <td>Blended <code><canvas></code></td> 684 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 685 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 686 [B] - Child <code><canvas></code> element with <code>mix-blend-mode</code> other than normal 687 </td> 688 <td>The color of the <code><canvas></code> element [B] mixes with the color of the parent element [P] .</td> 689 </tr> 690 <tr> 691 <td>Blending with <code><video></code></td> 692 <td>2 elements required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 693 [B] - <code><video></code> element with <code>mix-blend-mode</code> other than normal <br> 694 [IN-S] - sibling(of the element [B]) visually overlaping the <code><video></code> element <br> 695 [IN-S] has some text inside 696 </td> 697 <td>The content of the <code>video</code> element [B] mixes with the colors of the sibling element and the text from [IN-S].</td> 698 </tr> 699 <tr> 700 <td>Blended <code><video></code></td> 701 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 702 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 703 [B] - <code><video></code> element with <code>mix-blend-mode</code> other than normal 704 </td> 705 <td>The color of the <code><video></code> element mixes with the color of the parent element [P] .</td> 706 </tr> 707 <tr> 708 <td>Blending with <code><iframe></code> </td> 709 <td>2 elements required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 710 [B] - <code><iframe></code> element with <code>mix-blend-mode</code> other than normal <br> 711 [IN-S] - sibling(of the element [B]) with some text <br> 712 The [IN-S] element visually overlaps the <code><iframe></code> element 713 </td> 714 <td>The color of the <code><iframe></code> element mixes with the color of the sibling element and the text [IN-S].</td> 715 </tr> 716 <tr> 717 <td>Blended <code><iframe></code></td> 718 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 719 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 720 [B] - <code><iframe></code> element with <code>mix-blend-mode</code> other than normal 721 </td> 722 <td>The color of the <code><iframe></code> element [B] mixes with the color of the parent element [P]. </td> 723 </tr> 724 <tr> 725 <td>Blended element with <code>mask</code> property</td> 726 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 727 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 728 [B] - element with <code>mix-blend-mode</code> other than normal and <code>mask</code> property specified to an SVG image (e.g. circle)</td> 729 <td>The colors of the parent and the masked child are mixed ([P] and [B])</td> 730 </tr> 731 <tr> 732 <td>Blended element with <code>clip-path</code> property </td> 733 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 734 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 735 [B] - element with <code>mix-blend-mode</code> other than normal and <code>clip-path</code> property specified to a basic shape (e.g. ellipse)</td> 736 <td>The colors of the parent and the clipped child are mixed ([P] and [B])</td> 737 </tr> 738 <tr> 739 <td>Blended element with <code>filter</code> property</td> 740 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 741 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 742 [B] - element with <code>mix-blend-mode</code> other than normal and <code>filter</code> property value other than none </td> 743 <td>The filter is applied and the result is mixed with the parent element</td> 744 </tr> 745 <tr> 746 <td>Blended element with <code>transition</code></td> 747 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 748 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 749 [B] - element with <code>mix-blend-mode</code> other than normal and <code>transition-property</code> for <code>opacity</code> </td> 750 <td>The transition is applied and the result is mixed with the parent element</td> 751 </tr> 752 <tr> 753 <td>Blended element with <code>animation</code></td> 754 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 755 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 756 [B] - element with <code>mix-blend-mode</code> other than normal and <code>animation</code> specified</td> 757 <td>The animation is applied to the child element and the result is mixed with the parent element</td> 758 </tr> 759 <tr> 760 <td>Blending with Image</td> 761 <td>2 elements required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 762 [B] - <code><img></code> element with <code>mix-blend-mode</code> other than normal <br> 763 [IN-S] - Sibling of the <code><img></code> element<br> 764 The [IN-S] element overlaps the <code><img></code> element 765 </td> 766 <td>The content of the <code><img></code> element mixes with the color of the sibling element [IN-S].</td> 767 </tr> 768 <tr> 769 <td>Blended Image</td> 770 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 771 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 772 [B] - <code><img></code> element (.jpeg or .gif image) with <code>mix-blend-mode</code> other than normal</td> 773 <td>The color of the <code><img></code> is mixed with the color of the <code><div></code>.</td> 774 </tr> 775 <tr> 776 <td>Blending with SVG</td> 777 <td>2 elements required: <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> and <a href="#test_outline" title="Sibling of the element [B]">[IN-S]</a> <br> 778 [B] - <code><svg></code> element with <code>mix-blend-mode</code> other than normal <br> 779 [IN-S] - Sibling of the <code><svg></code> element<br> 780 The [IN-S] element overlaps the <code><svg></code> element 781 </td> 782 <td>The content of the <code><svg></code> element mixes with the color of the sibling element [IN-S].</td> 783 </tr> 784 <tr> 785 <td>Blended SVG</td> 786 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 787 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 788 [B] - SVG element with <code>mix-blend-mode</code> other than normal</td> 789 <td>The color of the SVG is mixed with the color of the <code><div></code>.</td> 790 </tr> 791 <tr> 792 <td>Linking SVG in an image</td> 793 <td>1 element required: <a href="#test_outline" <a href="#test_outline" title="img element">[B]</a> <br> 794 [B] - <code>img</code> linking an <code>svg</code> element that has content with <code>mix-blend-mode</code>. <br> 795 Set the <code>background-color</code> of the <code>body</code> to a value other than default. 796 </td> 797 <td>The contents of the SVG is not mixed with the color of the <code><body></code>.</td> 798 </tr> 799 <tr> 800 <td>Paragraph element</td> 801 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 802 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 803 [B] - paragraph element with <code>mix-blend-mode</code> other than normal</td> 804 <td>The color of the text from the paragraph element is mixed with the color of the <code><div></code></td> 805 </tr> 806 <tr> 807 <td>Paragraph element and background-image</td> 808 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 809 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 810 and <code>background-image</code> <br> 811 [B] - Child <code>p</code> element with some text and <code>mix-blend-mode</code> other than normal</td> 812 <td>The color of the text from the <code>p</code> element is mixed with the background image of the <code><div></code>.</td> 813 </tr> 814 <tr> 815 <td>Set blending from JavaScript</td> 816 <td>2 elements required: <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 817 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 818 [B] - Child <code><div></code> element with no <code>mix-blend-mode</code> specified<br> 819 From JavaScript, set the <code>mix-blend-mode</code> property for the child <code><div></code> to a value other than normal</td> 820 <td>The colors of the <code><div></code> elements are mixed.</td> 821 </tr> 822 </tbody></table> 823 </section> 824 </section> 825 <section id="test-cases-for-svg-elements-with-mix-blend-mode"> 826 <h3 aria-level="2" role="heading" id="h3_test-cases-for-svg-elements-with-mix-blend-mode"><span class="secno">4.2 </span>Test cases for SVG elements with <code>mix-blend-mode</code></h3> 827 <section id="mix-blend-mode-with-simple-svg-graphical-elements"> 828 <h4 aria-level="3" role="heading" id="h4_mix-blend-mode-with-simple-svg-graphical-elements"><span class="secno">4.2.1 </span><code>mix-blend-mode</code> with simple SVG graphical elements</h4> 829 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode">spec</a> : <q><code>mix-blend-mode</code> applies to svg, g, use, image, path, rect, circle, ellipse, line, polyline, polygon, text, tspan, and marker.</q></p> 830 <table> 831 <tbody><tr> 832 <th>Test name</th> 833 <th>Elements and styles</th> 834 <th>Expected result</th> 835 </tr> 836 <tr> 837 <td>Circle with SVG background</td> 838 <td>Set a background color for the SVG.<br> 839 Create 16 <code>circle</code> elements and fill them with a solid color. 840 <br>Apply each <code>mix-blend-mode</code> on them.</td> 841 <td>The color of the <code>circle</code> is mixed with the color of the background.</td> 842 </tr> 843 <tr> 844 <td>Ellipse with SVG background</td> 845 <td>Set a background color for the SVG.<br> 846 Create an <code>ellipse</code> element and fill it with a solid color. 847 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 848 <td>The color of the <code>ellipse</code> is mixed with the color of the background.</td> 849 </tr> 850 <tr> 851 <td>Image with SVG background</td> 852 <td>Set a background color for the SVG. 853 <br>Create an <code>image</code> element and apply a <code>mix-blend-mode</code> other than <code>normal</code>.</td> 854 <td>The <code>image</code> is mixed with the color of the background.</td> 855 </tr> 856 <tr> 857 <td>Line with SVG background</td> 858 <td>Set a background color for the SVG. 859 <br>Create a <code>line</code> element and fill it with a solid color. 860 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 861 <td>The color of the <code>line</code> is mixed with the color of the background.</td> 862 </tr> 863 <tr> 864 <td>Path with SVG background</td> 865 <td>Set a background color for the SVG. 866 <br>Create a <code>path</code> element and fill it with a solid color. 867 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 868 <td>The color of the <code>path</code> is mixed with the color of the background.</td> 869 </tr> 870 <tr> 871 <td>Polygon with SVG background</td> 872 <td>Set a background color for the SVG. 873 <br>Create a <code>polygon</code> element and fill it with a solid color. 874 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 875 <td>The color of the <code>polygon</code> is mixed with the color of the background.</td> 876 </tr> 877 <tr> 878 <td>Polyline with SVG background</td> 879 <td>Set a background color for the SVG. 880 <br>Create a <code>polyline</code> element and fill it with a solid color. 881 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 882 <td>The color of the <code>polyline</code> is mixed with the color of the background.</td> 883 </tr> 884 <tr> 885 <td>Rect with SVG background</td> 886 <td>Set a background color for the SVG. 887 <br>Create a <code>rect</code> element and fill it with a solid color. 888 <br>Apply a <code>mix-blend-mode</code> on it other than <code>normal</code>.</td> 889 <td>The color of the <code>rect</code> is mixed with the color of the background.</td> 890 </tr> 891 <tr> 892 <td>Text with SVG background</td> 893 <td>Set a background color for the SVG. 894 <br>Create a <code>text</code> element and apply a <code>mix-blend-mode</code> other than <code>normal</code>.</td> 895 <td>The text is mixed with the color of the background.</td> 896 </tr> 897 <tr> 898 <td>Text having tspan with SVG background</td> 899 <td>Set a background color for the SVG. 900 <br>Create a <code>text</code> element and a <code>tspan</code> inside it. 901 <br>Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>tspan</code>.</td> 902 <td>The text is mixed with the color of the background.</td> 903 </tr> 904 <tr> 905 <td>Gradient with SVG background</td> 906 <td>Set a background color for the SVG. 907 <br>Create a <code>rect</code> element and fill it with a <code>gradient</code>. 908 <br>Apply a <code>mix-blend-mode</code> on it other than normal.</td> 909 <td>The gradient is mixed with the color of the background.</td> 910 </tr> 911 <tr> 912 <td>Pattern with SVG background</td> 913 <td>Set a background color for the SVG. 914 <br>Create a <code>rect</code> element and fill it with a <code>pattern</code>. 915 <br>Apply a <code>mix-blend-mode</code> on it other than normal.</td> 916 <td>The pattern is mixed with the color of the background.</td> 917 </tr> 918 <tr> 919 <td>Set blending on an element from JavaScript</td> 920 <td>Set a background color for the SVG. 921 <br>Create a <code>rect</code> element and fill it with a solid color. 922 <br>Apply a <code>mix-blend-mode</code> (other than <code>normal</code>) on it from JavaScript.</td> 923 <td>The color of the <code>rect</code> is mixed with the color of the background.</td> 924 </tr> 925 <tr> 926 <td>Marker with SVG background</td> 927 <td>Set a background color for the SVG. 928 <br>Create a <code>line</code> element containing a marker. 929 <br>Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the marker.</td> 930 <td>The marker color is mixed with the color of the background.</td> 931 </tr> 932 <tr> 933 <td>Metadata with SVG background</td> 934 <td>Set a background color for the SVG. 935 <br>Create a <code>metadata</code> element containing an embedded pdf. 936 <br>Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the marker.</td> 937 <td>The metadata content is not mixed with the color of the background.</td> 938 </tr> 939 <tr> 940 <td>ForeignObject with SVG background</td> 941 <td>Set a background color for the SVG. 942 <br>Create a <code>foreignObject</code> element containing a simple xhtml file. 943 <br>Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the marker.</td> 944 <td>The foreignObject content is not mixed with the color of the background.</td> 945 </tr> 946 </tbody></table> 947 </section> 948 <section id="mix-blend-mode-with-svg-groups"> 949 <h4 aria-level="3" role="heading" id="h4_mix-blend-mode-with-svg-groups"><span class="secno">4.2.2 </span><code>mix-blend-mode</code> with SVG groups</h4> 950 <table> 951 <tbody><tr> 952 <th>Test name</th> 953 <th>Elements and styles</th> 954 <th>Expected result</th> 955 </tr> 956 <tr> 957 <td>Group of overlapping elements with SVG background</td> 958 <td>Set a background color for the SVG. 959 <br>Create a <code>group</code> element containing two overlapping <code>rect</code> elements, each filled with a different solid color. 960 <br>Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the group.</td> 961 <td>The <code>group</code> is mixed as a whole with the color of the background.</td> 962 </tr> 963 </tbody></table> 964 </section> 965 <section id="mix-blend-mode-with-isolated-groups"> 966 <h4 aria-level="3" role="heading" id="h4_mix-blend-mode-with-isolated-groups"><span class="secno">4.2.3 </span><code>mix-blend-mode</code> with isolated groups</h4> 967 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode">spec</a>: 968 <br><q>By default, every element must create a non-isolated group.<br> 969 However, certain operations in SVG will create isolated groups.<br> 970 If one of the following features is used, the group must become isolated: 971 </q></p><ul> 972 <li>opacity</li> 973 <li>filters</li> 974 <li>3D transforms (2D transforms must NOT cause isolation)</li> 975 <li>blending</li> 976 <li>masking</li> 977 </ul> 978 979 <p></p> 980 <table> 981 <tbody><tr> 982 <th>Test name</th> 983 <th>Elements and styles</th> 984 <th>Expected result</th> 985 </tr> 986 <tr> 987 <td>Blending two elements in an isolated group</td> 988 <td>Set a background color for the SVG.<br> 989 Create a <code>group</code> element containing two overlapping <code>rect</code> elements, each filled with a different solid color.<br> 990 Apply <code>opacity</code> less than 1 on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the second rect.</td> 991 <td>Only the intersection of the <code>rect</code> elements should mix.</td> 992 </tr> 993 <tr> 994 <td>Blending in a group with opacity</td> 995 <td>Set a background color for the SVG.<br> 996 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 997 Apply <code>opacity</code> less than 1 on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 998 <td>The <code>rect</code> will not mix with the content behind it.</td> 999 </tr> 1000 <tr> 1001 <td>Blending in a group with filter</td> 1002 <td>Set a background color for the SVG.<br> 1003 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1004 Apply a <code>filter</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1005 <td>The <code>rect</code> will not mix with the content behind it.</td> 1006 </tr> 1007 <tr> 1008 <td>Blending in a group with 2D transform</td> 1009 <td>Set a background color for the SVG.<br> 1010 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1011 Apply a <code>transform</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1012 <td>The <code>rect</code> will mix with the content behind it.</td> 1013 </tr> 1014 <tr> 1015 <td>Blending in a group with 3D transform</td> 1016 <td>Set a background color for the SVG.<br> 1017 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1018 Apply a 3d transform on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1019 <td>The <code>rect</code> will not mix with the content behind it.</td> 1020 </tr> 1021 <tr> 1022 <td>Blending in a group with a mask</td> 1023 <td>Set a background color for the SVG.<br> 1024 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1025 Apply a <code>mask</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1026 <td>The <code>rect</code> will not mix with the content behind it.</td> 1027 </tr> 1028 <tr> 1029 <td>Blending in a group with mix-blend-mode</td> 1030 <td>Set a background color for the SVG.<br> 1031 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1032 Apply a <code>mix-blend-mode</code> other than <code>normal</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1033 <td>The <code>rect</code> will not mix with the content behind it.</td> 1034 </tr> 1035 </tbody></table> 1036 </section> 1037 <section id="other-test-cases-for-svg"> 1038 <h4 aria-level="3" role="heading" id="h4_other-test-cases-for-svg"><span class="secno">4.2.4 </span>Other test cases for SVG</h4> 1039 <table> 1040 <tbody><tr> 1041 <td>Blend with element having opacity</td> 1042 <td>Set a background color for the SVG.<br> 1043 Create a <code>rect</code> element filled with a different solid color.<br> 1044 Apply <code>opacity</code> less than 1 and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1045 <td>The <code>rect</code> will mix with the content behind it.</td> 1046 </tr> 1047 <tr> 1048 <td>Blend with element having stroke</td> 1049 <td>Set a background color for the SVG.<br> 1050 Create a <code>rect</code> element filled with a different solid color.<br> 1051 Apply a <code>stroke</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1052 <td>The <code>rect</code> will mix with the content behind it.</td> 1053 </tr> 1054 <tr> 1055 <td>Blend with element having stroke-opacity</td> 1056 <td>Set a background color for the SVG.<br> 1057 Create a <code>rect</code> element filled with a different solid color.<br> 1058 Apply a <code>stroke</code>, <code>stroke-opacity</code> less than 1 and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1059 <td>The <code>rect</code> will mix with the content behind it.</td> 1060 </tr> 1061 <tr> 1062 <td>Blend with element having stroke-dasharray</td> 1063 <td>Set a background color for the SVG.<br> 1064 Create a <code>rect</code> element filled with a different solid color.<br> 1065 Apply a <code>stroke-dasharray</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1066 <td>The <code>rect</code> will mix with the content behind it.</td> 1067 </tr> 1068 <tr> 1069 <td>Blend with element having transform</td> 1070 <td>Set a background color for the SVG.<br> 1071 Create an <code>image</code> element. Apply a <code>transform</code> (any combination of <code>translate</code>, <code>rotate</code>, <code>scale</code>, <code>skew</code>) and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1072 <td>The <code>image</code> will mix with the content behind it.</td> 1073 </tr> 1074 <tr> 1075 <td>Blend with SVG having viewbox and preserveAspectRatio set</td> 1076 <td>Set a background color for the SVG, as well as <code>viewbox</code> and <code>preserveAspectRatio</code>.<br> 1077 Create a <code>rect</code> element filled with a different solid color and apply a <code>mix-blend-mode</code> other than <code>normal</code> on it.</td> 1078 <td>The <code>rect</code> will mix with the content behind it.</td> 1079 </tr> 1080 <tr> 1081 <td>Blend with an element having color-profile set</td> 1082 <td>Set a background color for the SVG.<br> 1083 Create an <code>image</code> element. Apply a <code>color-profile</code> (<code>sRGB</code>, for example) and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1084 <td>The <code>image</code> will mix with the content behind it.</td> 1085 </tr> 1086 <tr> 1087 <td>Blend with an element having overflow</td> 1088 <td>Set a background color for the SVG.<br> 1089 Create an <code>image</code> larger than the SVG.<br> 1090 Apply <code>overflow</code> (<code>visible</code>, <code>hidden</code>, <code>scroll</code>) and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1091 <td>The <code>image</code> will mix with the content behind it.</td> 1092 </tr> 1093 <tr> 1094 <td>Blend with an element having clip-path</td> 1095 <td>Set a background color for the SVG.<br> 1096 Create an <code>image</code> element. Apply a <code>clip-path</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1097 <td>The <code>image</code> will mix with the content behind it.</td> 1098 </tr> 1099 <tr> 1100 <td>Blend with an element having a mask</td> 1101 <td>Set a background color for the SVG.<br> 1102 Create an <code>image</code> element.<br> 1103 Apply a <code>mask</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1104 <td>The <code>image</code> will mix with the content behind it.</td> 1105 </tr> 1106 <tr> 1107 <td>Blend with an element having a filter</td> 1108 <td>Set a background color for the SVG.<br> 1109 Create an <code>image</code> element.<br> 1110 Apply a <code>filter</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>image</code>.</td> 1111 <td>The <code>image</code> will mix with the content behind it.</td> 1112 </tr> 1113 <tr> 1114 <td>Blend with an animated element</td> 1115 <td>Set a background color for the SVG.<br> 1116 Create a <code>rect</code> element filled with a different solid color.<br> 1117 Apply an <code>animateTransform</code> and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1118 <td>The <code>rect</code> will mix with the content behind it.</td> 1119 </tr> 1120 <tr> 1121 <td>Set blending from an SVG script element</td> 1122 <td>Set a background color for the SVG.<br> 1123 Create a <code>rect</code> element and fill it with a solid color.<br> 1124 Apply a <code>mix-blend-mode</code> (other than <code>normal</code>) on it from an svg <code>script</code> element.</td> 1125 <td>The <code>rect</code> will mix with the content behind it.</td> 1126 </tr> 1127 </tbody></table> 1128 </section> 1129 </section> 1130 <section id="test-cases-for-background-blend-mode"> 1131 <h3 aria-level="2" role="heading" id="h3_test-cases-for-background-blend-mode"><span class="secno">4.3 </span>Test cases for <code>background-blend-mode</code></h3> 1132 <section id="blending-between-the-background-layers-and-the-background-color-for-an-element-with-background-blend-mode"> 1133 <h4 aria-level="3" role="heading" id="h4_blending-between-the-background-layers-and-the-background-color-for-an-element-with-background-blend-mode"><span class="secno">4.3.1 </span>Blending between the background layers and the background color for an element with <code>background-blend-mode</code> </h4> 1134 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#background-blend-mode">spec</a>: <q>Each background layer must blend with the element's background layer that are below it and the element's background color.</q></p> 1135 <table> 1136 <tbody><tr> 1137 <th>Test name</th> 1138 <th>Elements and styles</th> 1139 <th>Expected result</th> 1140 </tr> 1141 <tr> 1142 <td>Images with different formats</td> 1143 <td>Element with 1144 <ul> 1145 <li><code>background-image</code> set to an <code><image></code></li> 1146 <li><code>background-color</code> set to a fully opaque color</li> 1147 <li><code>background-blend-mode</code> other than normal</li> 1148 </ul> 1149 Tests should be created for <code><image></code> with different formats such as PNG, JPEG or SVG 1150 </td> 1151 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code></td> 1152 </tr> 1153 <tr> 1154 <td>Gradient and background color</td> 1155 <td> 1156 Element with 1157 <ul> 1158 <li><code>background-image</code> set to an <code><gradient></code></li> 1159 <li><code>background-color</code> set to a fully opaque color</li> 1160 <li><code>background-blend-mode</code> other than normal</li> 1161 </ul> 1162 </td> 1163 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code></td> 1164 </tr> 1165 <tr> 1166 <td>Image and gradient</td> 1167 <td> 1168 Element with 1169 <ul> 1170 <li><code>background-image</code> set to an <code><image></code> on top of a <code><gradient></code></li> 1171 <li><code>background-blend-mode</code> other than normal</li> 1172 </ul> 1173 </td> 1174 <td>The content of the <code><image></code> is mixed with the content of the <code><gradient></code> 1175 </td> 1176 </tr> 1177 <tr> 1178 <td>Gradient and image</td> 1179 <td>Element with 1180 <ul> 1181 <li><code>background-image</code> set to a <code><gradient></code> on top of an <code><image></code></li> 1182 <li><code>background-blend-mode</code> other than normal</li> 1183 </ul> 1184 </td> 1185 <td>The content of the <code><image></code> is mixed with the content of the <code><gradient></code></td> 1186 </tr> 1187 <tr> 1188 <td>Two gradients</td> 1189 <td>Element with 1190 <ul> 1191 <li><code>background-image</code> set to a <code><gradient></code> on top of another <code><gradient></code></li> 1192 <li><code>background-blend-mode</code> other than normal</li> 1193 </ul></td> 1194 <td>The content of the two gradients is mixed</td> 1195 </tr> 1196 <tr> 1197 <td>Two images</td> 1198 <td>Element with 1199 <ul> 1200 <li><code>background-image</code> set to an <code><image></code> on top of another <code><image></code></li> 1201 <li><code>background-blend-mode</code> other than normal</li> 1202 </ul></td> 1203 <td>The content of the two images is mixed</td> 1204 </tr> 1205 <tr> 1206 <td>Image and background color with transparency</td> 1207 <td>Element with 1208 <ul> 1209 <li><code>background-image</code> set to an <code><image></code> with transparency(e.g. PNG images)</li> 1210 <li><code>background-color</code> set to a transparent color</li> 1211 <li><code>background-blend-mode</code> other than normal</li> 1212 </ul> 1213 </td> 1214 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code></td> 1215 </tr> 1216 <tr> 1217 <td>Cross-fade image and gradient</td> 1218 <td>Element with 1219 <ul> 1220 <li><code>background-image</code> set to a <q>cross-fade()</q> image on top of a <code><gradient></code> </li> 1221 <li><code>background-blend-mode</code> other than normal</li> 1222 </ul> 1223 </td> 1224 <td>The content of the cross-faded image is mixed with the content of the <code><gradient></code></td> 1225 </tr> 1226 <tr> 1227 <td>SVG image and background color</td> 1228 <td>Element with 1229 <ul> 1230 <li><code>background-image</code> set to a data URI for an SVG image </li> 1231 <li><code>background-color</code> set to a fully opaque color</li> 1232 <li><code>background-blend-mode</code> other than normal</li> 1233 </ul> 1234 </td> 1235 <td>The content of the image is mixed with the color of the background</td> 1236 </tr> 1237 <tr> 1238 <td>Animated gif image and background color</td> 1239 <td>Element with 1240 <ul> 1241 <li><code>background-image</code> set to an animated gif image</li> 1242 <li><code>background-color</code> set to a fully opaque color</li> 1243 <li><code>background-blend-mode</code> other than normal</li> 1244 </ul> 1245 </td> 1246 <td>The content of the image is mixed with the color of the background</td> 1247 </tr> 1248 <tr> 1249 <td>Set <code>background-blend-mode</code> from JavaScript</td> 1250 <td>Element with 1251 <ul> 1252 <li><code>background-image</code> set to a <code>gradient</code></li> 1253 <li><code>background-color</code> set to a fully opaque color</li> 1254 <li>no <code>background-blend-mode</code> explicitly specified</li> 1255 From JavaScript, set the <code>background-blend-mode</code> property to a value other than normal. 1256 </ul> 1257 </td> 1258 <td>The content of the gradient is mixed with the color of the background</td> 1259 </tr> 1260 <tr> 1261 <td><code>background-blend-mode</code> on element with 3D transform</td> 1262 <td>Element with 1263 <ul> 1264 <li><code>background-image</code> set to an <code><image></code></li> 1265 <li><code>background-color</code> set to a fully opaque color</li> 1266 <li><code>background-blend-mode</code> other than normal</li> 1267 <li><code>transform</code> set to a 3D function like rotateX, rotateY or translateZ</li> 1268 </ul> 1269 </td> 1270 <td>The content of the image is mixed with the color of the background</td> 1271 </tr> 1272 </tbody></table> 1273 </section> 1274 <section id="background-layers-do-not-blend-with-content-outside-the-background-or-behind-the-element"> 1275 <h4 aria-level="3" role="heading" id="h4_background-layers-do-not-blend-with-content-outside-the-background-or-behind-the-element"><span class="secno">4.3.2 </span>Background layers do not blend with content outside the background (or behind the element)</h4> 1276 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#background-blend-mode">spec</a>: <q>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.</q> 1277 </p> 1278 <table> 1279 <tbody><tr> 1280 <th>Test name</th> 1281 <th>Elements and styles</th> 1282 <th>Expected result</th> 1283 </tr> 1284 <tr> 1285 <td>One background layer</td> 1286 <td>Element with 1287 <ul> 1288 <li><code>background-image</code> set to an <code><image></code></li> 1289 <li><code>background-blend-mode</code> other than normal</li> 1290 </ul> 1291 </td> 1292 <td>The <code>background-image</code> is not mixed with anything outside the element</td> 1293 </tr> 1294 <tr> 1295 <td>Two elements</td> 1296 <td>2 elements required: a parent element with a child. <br> 1297 Each one with the following properties: 1298 <ul> 1299 <li><code>background-color</code> set to a fully opaque color</li> 1300 <li><code>background-blend-mode</code> other than normal</li> 1301 </ul> 1302 </td><td>No blending between the background colors of the two elements</td> 1303 </tr> 1304 <tr> 1305 <td>Parent and child with <code>background-blend-mode</code></td> 1306 <td>2 elements required: a parent element with a child <br> 1307 Parent properties: <br> 1308 <ul> 1309 <li><code>background-color</code> set to a fully opaque color</li> 1310 <li><code>background-blend-mode</code> other than normal</li> 1311 </ul> 1312 Child properties: <br> 1313 <ul> 1314 <li><code>background-image</code> set to an <code><image></code></li> 1315 <li><code>background-blend-mode</code> other than normal</li> 1316 </ul> 1317 </td><td>The content of the image from the child element does not mixes with the background color from the parent element</td> 1318 </tr> 1319 </tbody></table> 1320 </section> 1321 <section id="background-blend-mode-list-values-apply-to-the-corresponding-background-layer"> 1322 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-list-values-apply-to-the-corresponding-background-layer"><span class="secno">4.3.3 </span> <code>background-blend-mode</code> list values apply to the corresponding background layer</h4> 1323 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#background-blend-mode">spec</a>: <q>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.</q> 1324 </p> 1325 <table> 1326 <tbody><tr> 1327 <th>Test name</th> 1328 <th>Elements and styles</th> 1329 <th>Expected result</th> 1330 </tr> 1331 <tr> 1332 <td>Different blend modes applied between layers</td> 1333 <td>Element with 1334 <ul> 1335 <li><code>background-image</code> set to an <code><image-list></code> containing three images: (e.g. I1, I2 and I3 ) </li> 1336 <li><code>background-blend-mode</code> set to different <code>blendmode</code> for every image: (e.g. multiply, difference, screen) </li> 1337 </ul></td> 1338 <td>The content of the three images is correctly mixed <br> 1339 (multiply for I1, difference for I2 and screen for I3) 1340 </td> 1341 </tr> 1342 </tbody></table> 1343 </section> 1344 <section id="background-blend-mode-list-values-are-repeated-if-the-list-is-shorter-than-the-background-layer-list"> 1345 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-list-values-are-repeated-if-the-list-is-shorter-than-the-background-layer-list"><span class="secno">4.3.4 </span><code>background-blend-mode</code> list values are repeated if the list is shorter than the background layer list</h4> 1346 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#background-blend-mode">spec</a>: <q>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.</q> 1347 </p> 1348 <table> 1349 <tbody><tr> 1350 <th>Test name</th> 1351 <th>Elements and styles</th> 1352 <th>Expected result</th> 1353 </tr> 1354 <tr> 1355 <td>Blend mode list repeat</td> 1356 <td>Element with 1357 <ul> 1358 <li><code>background-image</code> set to an <code><image-list></code> containing three images</li> 1359 <li><code>background-blend-mode</code> set to two different <code>blendmode</code> values</li> 1360 </ul></td> 1361 <td>The unspecified blend modes should be obtained by repeating the blend mode list from the beginning</td> 1362 </tr> 1363 </tbody></table> 1364 </section> 1365 <section id="the-default-background-blend-mode-value-for-the-background-shorthand-is-normal"> 1366 <h4 aria-level="3" role="heading" id="h4_the-default-background-blend-mode-value-for-the-background-shorthand-is-normal"><span class="secno">4.3.5 </span>The default <code>background-blend-mode</code> value for the <code>background</code> shorthand is 'normal' </h4> 1367 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#background-blend-mode">spec</a>: <q>If the ‘background’ [CSS3BG] shorthand is used, the ‘background-blend-mode’ property for that element must be reset to its initial value.</q> 1368 </p> 1369 <table> 1370 <tbody><tr> 1371 <th>Test name</th> 1372 <th>Elements and styles</th> 1373 <th>Expected result</th> 1374 </tr> 1375 <tr> 1376 <td>Default blend mode for 'background' shorthand</td> 1377 <td>Element with 1378 <ul> 1379 <li><code>background</code> property set to an image and a color</li> 1380 <li>No value explicitly set for <code>background-blend-mode</code> </li> 1381 </ul></td> 1382 <td> The computed value of <code>background-blend-mode</code> is 'normal' 1383 </td> 1384 </tr> 1385 </tbody></table> 1386 </section> 1387 <section id="background-blend-mode-for-an-element-with-background-position"> 1388 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-position"><span class="secno">4.3.6 </span><code>background-blend-mode</code> for an element with <code>background-position</code></h4> 1389 <table> 1390 <tbody><tr> 1391 <th>Test name</th> 1392 <th>Elements and styles</th> 1393 <th>Expected result</th> 1394 </tr> 1395 <tr> 1396 <td><code>background-position</code> percentage</td> 1397 <td>Element with 1398 <ul> 1399 <li><code>background-image</code> set to an <code><image></code></li> 1400 <li><code>background-color</code> set to a fully opaque color</li> 1401 <li><code>background-position</code> specified in percentage, such as 50% 50%</li> 1402 <li><code>background-blend-mode</code> other than normal</li> 1403 </ul> 1404 </td> 1405 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1406 The <code>background-image</code> is correctly positioned 1407 </td> 1408 </tr> 1409 </tbody></table> 1410 </section> 1411 <section id="background-blend-mode-for-an-element-with-background-size"> 1412 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-size"><span class="secno">4.3.7 </span><code>background-blend-mode</code> for an element with <code>background-size</code></h4> 1413 <table> 1414 <tbody><tr> 1415 <th>Test name</th> 1416 <th>Elements and styles</th> 1417 <th>Expected result</th> 1418 </tr> 1419 <tr> 1420 <td>Background size defined in pixels</td> 1421 <td>Element with 1422 <ul> 1423 <li><code>background-image</code> set to an <code><image></code></li> 1424 <li><code>background-color</code> set to a fully opaque color</li> 1425 <li><code>background-size</code> specified in pixels</li> 1426 <li><code>background-blend-mode</code> other than normal</li> 1427 </ul> 1428 </td> 1429 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1430 The <code>background-image</code> has the correct size 1431 </td> 1432 </tr> 1433 <tr> 1434 <td>Background size defined in percentage (second phase)</td> 1435 <td>Element with 1436 <ul> 1437 <li><code>background-image</code> set to an <code><image></code></li> 1438 <li><code>background-color</code> set to a fully opaque color</li> 1439 <li><code>background-size</code> specified in percentage</li> 1440 <li><code>background-blend-mode</code> other than normal</li> 1441 </ul> 1442 </td> 1443 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1444 The <code>background-image</code> has the correct size 1445 </td> 1446 </tr> 1447 <tr> 1448 <td>Background size cover</td> 1449 <td>Element with 1450 <ul> 1451 <li><code>background-image</code> set to an <code><image></code></li> 1452 <li><code>background-color</code> set to a fully opaque color</li> 1453 <li><code>background-size</code> set to <code>cover</code></li> 1454 <li><code>background-blend-mode</code> other than normal</li> 1455 </ul> 1456 </td> 1457 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1458 The <code>background-image</code> has the correct size 1459 </td> 1460 </tr> 1461 <tr> 1462 <td>Background size contain</td> 1463 <td>Element with 1464 <ul> 1465 <li><code>background-image</code> set to an <code><image></code></li> 1466 <li><code>background-color</code> set to a fully opaque color</li> 1467 <li><code>background-size</code> set to <code>contain</code></li> 1468 <li><code>background-blend-mode</code> other than normal</li> 1469 </ul> 1470 </td> 1471 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1472 The <code>background-image</code> has the correct size 1473 </td> 1474 </tr> 1475 </tbody></table> 1476 </section> 1477 <section id="background-blend-mode-for-an-element-with-background-repeat"> 1478 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-repeat"><span class="secno">4.3.8 </span><code>background-blend-mode</code> for an element with <code>background-repeat</code></h4> 1479 <table> 1480 <tbody><tr> 1481 <th>Test name</th> 1482 <th>Elements and styles</th> 1483 <th>Expected result</th> 1484 </tr> 1485 <tr> 1486 <td><code>background-repeat</code> set to no-repeat</td> 1487 <td>Element with 1488 <ul> 1489 <li><code>background-image</code> set to an <code><image></code></li> 1490 <li><code>background-color</code> set to a fully opaque color</li> 1491 <li><code>background-repeat</code> set to <code>no-repeat</code></li> 1492 <li><code>background-blend-mode</code> other than normal</li> 1493 </ul> 1494 </td> 1495 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1496 The <code>background-image</code> is not repeated 1497 </td> 1498 </tr> 1499 <tr> 1500 <td><code>background-repeat</code> set to space</td> 1501 <td>Element with 1502 <ul> 1503 <li><code>background-image</code> set to an <code><image></code></li> 1504 <li><code>background-color</code> set to a fully opaque color</li> 1505 <li><code>background-repeat</code> set to <code>space</code></li> 1506 <li><code>background-blend-mode</code> other than normal</li> 1507 </ul> 1508 </td> 1509 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1510 </td> 1511 </tr> 1512 <tr> 1513 <td><code>background-repeat</code> set to round</td> 1514 <td>Element with 1515 <ul> 1516 <li><code>background-image</code> set to an <code><image></code></li> 1517 <li><code>background-color</code> set to a fully opaque color</li> 1518 <li><code>background-repeat</code> set to <code>round</code></li> 1519 <li><code>background-blend-mode</code> other than normal</li> 1520 </ul> 1521 </td> 1522 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1523 </td> 1524 </tr> 1525 </tbody></table> 1526 </section> 1527 <section id="background-blend-mode-for-an-element-with-background-clip"> 1528 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-clip"><span class="secno">4.3.9 </span><code>background-blend-mode</code> for an element with <code>background-clip</code></h4> 1529 <table> 1530 <tbody><tr> 1531 <th>Test name</th> 1532 <th>Elements and styles</th> 1533 <th>Expected result</th> 1534 </tr> 1535 <tr> 1536 <td><code>background-clip</code> set to <code>padding-box</code></td> 1537 <td>Element with 1538 <ul> 1539 <li><code>background-image</code> set to an <code><image></code></li> 1540 <li><code>background-color</code> set to a fully opaque color</li> 1541 <li><code>background-clip</code> set to <code>padding-box</code></li> 1542 <li><code>background-blend-mode</code> other than normal</li> 1543 </ul> 1544 </td> 1545 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1546 No background is drawn below the border (background extends to the outside edge of the padding) 1547 </td> 1548 </tr> 1549 <tr> 1550 <td><code>background-clip</code> set to <code>content-box</code></td> 1551 <td>Element with 1552 <ul> 1553 <li><code>background-image</code> set to an <code><image></code></li> 1554 <li><code>background-color</code> set to a fully opaque color</li> 1555 <li><code>background-clip</code> set to <code>content-box</code></li> 1556 <li><code>background-blend-mode</code> other than normal</li> 1557 </ul> 1558 </td> 1559 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1560 The background is painted within (clipped to) the content box 1561 </td> 1562 </tr> 1563 </tbody></table> 1564 </section> 1565 <section id="background-blend-mode-for-an-element-with-background-origin"> 1566 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-origin"><span class="secno">4.3.10 </span><code>background-blend-mode</code> for an element with <code>background-origin</code></h4> 1567 <table> 1568 <tbody><tr> 1569 <th>Test name</th> 1570 <th>Elements and styles</th> 1571 <th>Expected result</th> 1572 </tr> 1573 <tr> 1574 <td><code>background-origin</code> set to <code>border-box</code></td> 1575 <td>Element with 1576 <ul> 1577 <li><code>background-image</code> set to an <code><image></code></li> 1578 <li><code>background-color</code> set to a fully opaque color</li> 1579 <li><code>background-origin</code> set to <code>border-box</code></li> 1580 <li><code>background-blend-mode</code> other than normal</li> 1581 </ul> 1582 </td> 1583 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1584 The background extends to the outside edge of the border (but underneath the border in z-ordering) 1585 </td> 1586 </tr> 1587 <tr> 1588 <td><code>background-origin</code> set to <code>content-box</code></td> 1589 <td>Element with 1590 <ul> 1591 <li><code>background-image</code> set to an <code><image></code></li> 1592 <li><code>background-color</code> set to a fully opaque color</li> 1593 <li><code>background-origin</code> set to <code>content-box</code></li> 1594 <li><code>background-blend-mode</code> other than normal</li> 1595 </ul> 1596 </td> 1597 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1598 The background is painted within (clipped to) the content box 1599 </td> 1600 </tr> 1601 </tbody></table> 1602 </section> 1603 <section id="background-blend-mode-for-an-element-with-background-attachement"> 1604 <h4 aria-level="3" role="heading" id="h4_background-blend-mode-for-an-element-with-background-attachement"><span class="secno">4.3.11 </span><code>background-blend-mode</code> for an element with <code>background-attachement</code></h4> 1605 <table> 1606 <tbody><tr> 1607 <th>Test name</th> 1608 <th>Elements and styles</th> 1609 <th>Expected result</th> 1610 </tr> 1611 <tr> 1612 <td><code>background-attachment</code> set to <code>fixed</code></td> 1613 <td>Element with 1614 <ul> 1615 <li><code>background-image</code> set to an <code><image></code></li> 1616 <li><code>background-color</code> set to a fully opaque color</li> 1617 <li><code>background-attachment</code> set to <code>fixed</code></li> 1618 <li><code>background-blend-mode</code> other than normal</li> 1619 </ul> 1620 </td> 1621 <td>The content of the <code>background-image</code> is mixed with the color of the <code>background-color</code> <br> 1622 The background image will not scroll with its containing element, instead remaining stationary within the viewport 1623 </td> 1624 </tr> 1625 <tr> 1626 <td>2 background images with <code>background-attachment</code> set to <code>fixed, scroll</code></td> 1627 <td>Element with 1628 <ul> 1629 <li><code>background-image</code> set to 2 <code><image></code>(s)</li> 1630 <li><code>background-attachment</code> set to <code>fixed, scroll</code></li> 1631 <li><code>background-blend-mode</code> other than normal</li> 1632 </ul> 1633 </td> 1634 <td>The background images will be mixed when they overlap while scrolling 1635 </td> 1636 </tr> 1637 </tbody></table> 1638 </section> 1639 </section> 1640 <section id="test-cases-for-isolation"> 1641 <h3 aria-level="2" role="heading" id="h3_test-cases-for-isolation"><span class="secno">4.4 </span>Test cases for <code>isolation</code></h3> 1642 <section id="an-element-with-isolation-isolate-creates-a-stacking-context"> 1643 <h4 aria-level="3" role="heading" id="h4_an-element-with-isolation-isolate-creates-a-stacking-context"><span class="secno">4.4.1 </span>An element with <code>isolation:isolate</code> creates a stacking context</h4> 1644 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#csscompositingrules_CSS">spec</a>: <q>For CSS, setting ‘isolation’ to ‘isolate’ will turn the element into a stacking context [CSS21].</q></p> 1645 <table> 1646 <tbody><tr> 1647 <th>Test name</th> 1648 <th>Elements and styles</th> 1649 <th>Expected result</th> 1650 </tr> 1651 <tr> 1652 <td>Isolation isolate</td> 1653 <td>Have an element with <code>isolation</code> set to <code>isolate</code></td> 1654 <td>The element creates a stacking context.</td> 1655 </tr> 1656 </tbody></table> 1657 </section> 1658 <section id="an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children"> 1659 <h4 aria-level="3" role="heading" id="h4_an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children"><span class="secno">4.4.2 </span>An element with <code>isolation:isolate</code> creates an isolated group for blended children</h4> 1660 <table> 1661 <tbody><tr> 1662 <th>Test name</th> 1663 <th>Elements and styles</th> 1664 <th>Expected result</th> 1665 </tr> 1666 <tr> 1667 <td>Isolation of blended child which overflows</td> 1668 <td>3 elements required: 1669 <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, 1670 <a href="#test_outline" title="child of the element [P]">[IN-P]</a> and 1671 <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 1672 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>) <br> 1673 [IN-P] - Intermediate child element between the parent [P] and the child [B]<br> 1674 This element has <code>isolation:isolate</code> set.<br> 1675 [B] - element with <code>mix-blend-mode</code> other than <code>normal</code> <br> 1676 The blending element [B] has content that lies outside the parent element. <br> 1677 </td> 1678 <td> 1679 The color of the child element [B] mixes with the color of the intermediate element [IN-P], where they overlap.<br> 1680 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 <code>body</code>. 1681 </td> 1682 </tr> 1683 <tr> 1684 <td>Isolation on intermediate element with transparent pixels</td> 1685 <td>3 elements required: 1686 <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, 1687 <a href="#test_outline" title="child of the element [P]">[IN-P]</a> and 1688 <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 1689 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>); the element <code>background-color</code> is other than <code>transparent</code><br> 1690 [IN-P] - Intermediate child element between the parent [P] and the child [B]<br> 1691 The intermediate element has text content, default value for <code>background-color</code> and <code>isolation:isolate</code> set<br> 1692 [B] - element with <code>mix-blend-mode</code> other than <code>normal 1693 </code></td><td> 1694 The color of the child element [B] mixes with the color of the intermediate element [IN-P], where they overlap.<br> 1695 There is no blending between the color of the parent element [P] and the color of the blended element [B]. 1696 </td> 1697 </tr> 1698 <tr> 1699 <td>Isolate inside a stacking context created by a 3d transform</td> 1700 <td> 1701 3 elements required: 1702 <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a>, 1703 <a href="#test_outline" title="child of the element [P]">[IN-P]</a> and 1704 <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 1705 [P] - parent element with a <code>3D transform</code> applied<br> 1706 [IN-P] - Intermediate child element between the parent [P] and the child [B]<br> 1707 The intermediate element has <code>isolation:isolate</code> set<br> 1708 [B] - element with <code>mix-blend-mode</code> other than <code>normal</code><br> 1709 </td> 1710 <td> 1711 The color of the child element [B] mixes with the color of the intermediate element [IN-P], where they overlap.<br> 1712 There is no blending between the color of the parent element [P] and the color of the blended element [B]. 1713 </td> 1714 </tr> 1715 </tbody></table> 1716 </section> 1717 <section id="an-element-with-isolation-auto-set-does-not-change-the-elements-existing-stacking-context-behavior"> 1718 <h4 aria-level="3" role="heading" id="h4_an-element-with-isolation-auto-set-does-not-change-the-elements-existing-stacking-context-behavior"><span class="secno">4.4.3 </span>An element with <code>isolation:auto</code> set does not change the elements existing stacking context behavior</h4> 1719 <table> 1720 <tbody><tr> 1721 <th>Test name</th> 1722 <th>Elements and styles</th> 1723 <th>Expected result</th> 1724 </tr> 1725 <tr> 1726 <td>Isolation auto</td> 1727 <td>Have an element with <code>isolation</code> explicitly set to <code>auto</code>, and no other style that would create a stacking context</td> 1728 <td>The element does not create a stacking context - the computed value of its <code>z-index</code> is value <code>auto</code></td> 1729 </tr> 1730 <tr> 1731 <td>Stacking context not affected by isolation</td> 1732 <td>2 elements required: 1733 <a href="#test_outline" title="parent element with a property that creates stacking context">[P]</a> and 1734 <a href="#test_outline" title="Element with mix-blend-mode property other than normal">[B]</a> <br> 1735 [P] - parent element with a property that creates a stacking context (e.g. <code>position:fixed</code>); This element has <code>isolation</code> explicitly set to <code>auto</code> <br> 1736 [B] - element with <code>mix-blend-mode</code> other than <code>normal</code> <br> 1737 The blending element [B] has content that lies outside the parent element. <br> 1738 Set the <code>background-color</code> of the <code>body</code> to a value other than default 1739 </td> 1740 <td>The color of the parent element mixes with the color of the child element. <br> 1741 The area of the child element outside of the parent element doesn't mix with the color of the <code>body</code>.<br> 1742 In other words, setting the <code>isolation</code> to <code>auto</code> does not affect the creation of a stacking context by other properties. 1743 </td> 1744 </tr> 1745 </tbody></table> 1746 </section> 1747 </section> 1748 <section id="test-cases-for-isolation-in-svg"> 1749 <h3 aria-level="2" role="heading" id="h3_test-cases-for-isolation-in-svg"><span class="secno">4.5 </span>Test cases for <code>isolation</code> in SVG</h3> 1750 <section id="in-svg-an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children"> 1751 <h4 aria-level="3" role="heading" id="h4_in-svg-an-element-with-isolation-isolate-creates-an-isolated-group-for-blended-children"><span class="secno">4.5.1 </span>In SVG, an element with <code>isolation:isolate</code> creates an isolated group for blended children</h4> 1752 <p>Refers to the following assertion in the <a href="https://drafts.fxtf.org/compositing-1/#isolation">spec</a>: <q>In SVG, this defines whether an element is isolated or not.</q></p> 1753 <table> 1754 <tbody><tr> 1755 <th>Test name</th> 1756 <th>Elements and styles</th> 1757 <th>Expected result</th> 1758 </tr> 1759 <tr> 1760 <td>Blending in an isolated group</td> 1761 <td>Set a background color for the SVG.<br> 1762 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1763 Apply <code>isolation:isolate</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1764 <td>The <code>rect</code> will not mix with the content behind it.</td> 1765 </tr> 1766 <tr> 1767 <td>Blending two elements in an isolated group</td> 1768 <td>Set a background color for the SVG.<br> 1769 Create a <code>group</code> element containing two overlapping <code>rect</code> elements, each filled with a different solid color.<br> 1770 Apply <code>isolation:isolate</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the second rect.</td> 1771 <td>Only the intersection of the <code>rect</code> elements should mix.</td> 1772 </tr> 1773 <tr> 1774 <td>Blending in an isolated group with 2D transform</td> 1775 <td>Set a background color for the SVG.<br> 1776 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1777 Apply <code>isolation:isolate</code> and 2D transform on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1778 <td>The <code>rect</code> will not mix with the content behind it.</td> 1779 </tr> 1780 <tr> 1781 <td>Set isolation on an element from JavaScript</td> 1782 <td>Set a background color for the SVG. 1783 <br>Create a <code>rect</code> element and fill it with a solid color and a <code>mix-blend-mode</code> other than <code>normal</code>. 1784 <br>Apply <code>isolation:isolate</code> on it from JavaScript.</td> 1785 <td>The <code>rect</code> will not mix with the content behind it.</td> 1786 </tr> 1787 </tbody></table> 1788 </section> 1789 <section id="in-svg-an-element-with-isolation-auto-set-does-not-change-the-rendering-behaviour"> 1790 <h4 aria-level="3" role="heading" id="h4_in-svg-an-element-with-isolation-auto-set-does-not-change-the-rendering-behaviour"><span class="secno">4.5.2 </span>In SVG, an element with <code>isolation:auto</code> set does not change the rendering behaviour</h4> 1791 <table> 1792 <tbody><tr> 1793 <th>Test name</th> 1794 <th>Elements and styles</th> 1795 <th>Expected result</th> 1796 </tr> 1797 <tr> 1798 <td>Blending a group with <code>isolation:auto</code></td> 1799 <td>Set a background color for the SVG.<br> 1800 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1801 Apply <code>isolation:auto</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1802 <td>The element will mix with the content behind it.</td> 1803 </tr> 1804 <tr> 1805 <td>Blending in a group with opacity</td> 1806 <td>Set a background color for the SVG.<br> 1807 Create a <code>group</code> element containing a <code>rect</code> element filled with a different solid color.<br> 1808 Apply <code>opacity</code> less than 1 and <code>isolation:auto</code> on the group and a <code>mix-blend-mode</code> other than <code>normal</code> on the <code>rect</code>.</td> 1809 <td>The <code>rect</code> will not mix with the content behind it.</td> 1810 </tr> 1811 </tbody></table> 1812 </section> 1813 </section> 1814 1815 1816 </section><div id="respec-ui" class="removeOnSave" style="position: fixed; top: 20px; right: 20px; width: 202px; text-align: right;"><button style="background-color: rgb(255, 255, 255); font-weight: bold; border: 1px solid rgb(204, 204, 204); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; background-position: initial initial; background-repeat: initial initial;">ReSpec</button><div style="background-color: rgb(255, 255, 255); border: 1px solid rgb(0, 0, 0); width: 200px; display: none; text-align: left; margin-top: 5px; margin-right: 5px; background-position: initial initial; background-repeat: initial initial;"><button style="background-color: rgb(255, 255, 255); border-style: none none solid; border-bottom-width: 1px; border-bottom-color: rgb(204, 204, 204); width: 100%; text-align: left; font-size: inherit; background-position: initial initial; background-repeat: initial initial;">Save Snapshot</button><button style="background-color: rgb(255, 255, 255); border-style: none none solid; border-bottom-width: 1px; border-bottom-color: rgb(204, 204, 204); width: 100%; text-align: left; font-size: inherit; background-position: initial initial; background-repeat: initial initial;">About ReSpec</button></div></div><section id="references" class="appendix" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_references"><span class="secno">A. </span>References</h2><section id="normative-references" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h3 aria-level="2" role="heading" id="h3_normative-references"><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-compositing-1">[compositing-1]</dt><dd rel="dcterms:requires">Nikos Andronikos; Rik Cabanier. <a href="http://www.w3.org/TR/compositing-1/"><cite>Compositing and Blending Level 1</cite></a>. 10 October 2013. W3C Last Call Working Draft. URL: <a href="http://www.w3.org/TR/compositing-1/">http://www.w3.org/TR/compositing-1/</a> 1817 </dd><dt id="bib-css3-transforms">[css3-transforms]</dt><dd rel="dcterms:requires">Simon Fraser; Dean Jackson; Edward O'Connor; Dirk Schulze; Aryeh Gregor. <a href="http://www.w3.org/TR/css3-transforms/"><cite>CSS Transforms</cite></a>. 11 September 2012. W3C Working Draft. URL: <a href="http://www.w3.org/TR/css3-transforms/">http://www.w3.org/TR/css3-transforms/</a> 1818 </dd></dl></section><section id="informative-references" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h3 aria-level="2" role="heading" id="h3_informative-references"><span class="secno">A.2 </span>Informative references</h3><dl class="bibliography" about=""><dt id="bib-webdriver">[webdriver]</dt><dd rel="dcterms:references">Simon Stewart; David Burns. <a href="http://www.w3.org/TR/webdriver/"><cite>WebDriver</cite></a>. 12 March 2013. W3C Working Draft. URL: <a href="http://www.w3.org/TR/webdriver/">http://www.w3.org/TR/webdriver/</a> 1819 </dd></dl></section></section></body></html>