-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathtest-plan.src.html
More file actions
1616 lines (1613 loc) · 89.7 KB
/
test-plan.src.html
File metadata and controls
1616 lines (1613 loc) · 89.7 KB
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
<!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>