Skip to content

Commit 7e0bbd7

Browse files
committed
Bug 1923204 [wpt PR 48506] - Add a WPT test validating a canvas filter with a globalAlpha, a=testonly
Automatic update from web-platform-tests Add a WPT test validating a canvas filter with a globalAlpha The specification currently says that the globalAlpha should be applied on the result of the context's filter. This however leads to an unexpected behavior because if the filter is a drop-shadow, we can't see the shadow through the foreground even though the foreground is made transparent by the globalAlpha. This is not what Chrome and Firefox do. These browsers instead apply the globalAlpha on the source of the filter, therefore making the foreground transparent. The specification issue is addressed in: whatwg/html#10674 Change-Id: I3832c3cf6390933770a08669f62e9b1b29caccf8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904448 Reviewed-by: Aaron Krajeski <aaronhkchromium.org> Commit-Queue: Jean-Philippe Gravel <jpgravelchromium.org> Cr-Commit-Position: refs/heads/main{#1365599} -- wpt-commits: ac35e3fe543ee6266f40ed5a482bad80f7002e51 wpt-pr: 48506 UltraBlame original commit: c91aa8c57501776694dc4b4f7ba2a5c15e3d9188
1 parent 53fb112 commit 7e0bbd7

File tree

6 files changed

+1497
-0
lines changed

6 files changed

+1497
-0
lines changed
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
<
2+
!
3+
DOCTYPE
4+
html
5+
>
6+
<
7+
!
8+
-
9+
-
10+
DO
11+
NOT
12+
EDIT
13+
!
14+
This
15+
test
16+
has
17+
been
18+
generated
19+
by
20+
/
21+
html
22+
/
23+
canvas
24+
/
25+
tools
26+
/
27+
gentest
28+
.
29+
py
30+
.
31+
-
32+
-
33+
>
34+
<
35+
meta
36+
charset
37+
=
38+
"
39+
UTF
40+
-
41+
8
42+
"
43+
>
44+
<
45+
title
46+
>
47+
Canvas
48+
test
49+
:
50+
2d
51+
.
52+
filter
53+
.
54+
drop
55+
-
56+
shadow
57+
-
58+
globalAlpha
59+
<
60+
/
61+
title
62+
>
63+
<
64+
h1
65+
>
66+
2d
67+
.
68+
filter
69+
.
70+
drop
71+
-
72+
shadow
73+
-
74+
globalAlpha
75+
<
76+
/
77+
h1
78+
>
79+
<
80+
p
81+
class
82+
=
83+
"
84+
desc
85+
"
86+
>
87+
Tests
88+
the
89+
context
90+
drop
91+
-
92+
shadow
93+
filter
94+
with
95+
a
96+
globalAlpha
97+
<
98+
/
99+
p
100+
>
101+
<
102+
canvas
103+
id
104+
=
105+
"
106+
canvas
107+
"
108+
width
109+
=
110+
"
111+
100
112+
"
113+
height
114+
=
115+
"
116+
50
117+
"
118+
>
119+
<
120+
p
121+
class
122+
=
123+
"
124+
fallback
125+
"
126+
>
127+
FAIL
128+
(
129+
fallback
130+
content
131+
)
132+
<
133+
/
134+
p
135+
>
136+
<
137+
/
138+
canvas
139+
>
140+
<
141+
script
142+
>
143+
const
144+
canvas
145+
=
146+
document
147+
.
148+
getElementById
149+
(
150+
"
151+
canvas
152+
"
153+
)
154+
;
155+
const
156+
ctx
157+
=
158+
canvas
159+
.
160+
getContext
161+
(
162+
'
163+
2d
164+
'
165+
)
166+
;
167+
ctx
168+
.
169+
fillStyle
170+
=
171+
'
172+
rgba
173+
(
174+
255
175+
165
176+
0
177+
0
178+
.
179+
5
180+
)
181+
'
182+
;
183+
ctx
184+
.
185+
fillRect
186+
(
187+
20
188+
15
189+
60
190+
30
191+
)
192+
;
193+
ctx
194+
.
195+
fillStyle
196+
=
197+
'
198+
rgba
199+
(
200+
128
201+
0
202+
128
203+
0
204+
.
205+
5
206+
)
207+
'
208+
ctx
209+
.
210+
fillRect
211+
(
212+
10
213+
10
214+
60
215+
30
216+
)
217+
;
218+
<
219+
/
220+
script
221+
>

0 commit comments

Comments
 (0)