Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: LayoutTests/fast/canvas/canvas-filter-value.html

Issue 1194733002: Adding the 'filter' context attribute to 2D canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: applied corrections Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <script src="../../resources/js-test.js"></script>
2 <script>
3
4 var canvas = document.createElement('canvas');
5 var ctx = canvas.getContext('2d');
6
7 shouldBe('ctx.filter', '"none"');
8 ctx.filter = 'blur(5px)';
9 shouldBe('ctx.filter', '"blur(5px)"');
10
11 ctx.save();
12 ctx.filter = 'none';
13 shouldBe('ctx.filter', '"none"');
14 ctx.restore();
15 shouldBe('ctx.filter', '"blur(5px)"');
16
17 // Invalid filter should be ignored
18 ctx.filter = 'blur(10)';
19 shouldBe('ctx.filter', '"blur(5px)"');
20 ctx.filter = 'blur 10px';
21 shouldBe('ctx.filter', '"blur(5px)"');
22
23 ctx.filter = 'inherit';
24 shouldBe('ctx.filter', '"blur(5px)"');
25 ctx.filter = 'initial';
26 shouldBe('ctx.filter', '"blur(5px)"');
27
28 ctx.filter = '';
29 shouldBe('ctx.filter', '"blur(5px)"');
30 ctx.filter = null;
31 shouldBe('ctx.filter', '"blur(5px)"');
32 ctx.filter = undefined;
33 shouldBe('ctx.filter', '"blur(5px)"');
34
35 // verify that exact string is preserved
36 ctx.filter = 'blur( 5px)';
37 shouldBe('ctx.filter', '"blur( 5px)"');
38
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698