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