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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-whitespace-parsing.html

Issue 2560993003: Fix the parsing of colors used as canvas styles to ignore whitespace (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test whitespace parsing on canvas attributes that invoke the CSS parser</ title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 var ctx;
8 function whiteSpaceTest(attribute, input, output) {
9 var canvas = document.createElement('canvas');
10 ctx = canvas.getContext('2d');
11 eval('ctx.' + attribute + ' = "' + input + '"');
12 assert_equals(eval('ctx.' + attribute), output);
13 }
14
15 generate_tests(whiteSpaceTest, [
16 ['', 'fillStyle', ' red', '#ff0000'],
17 ['', 'fillStyle', 'red ', '#ff0000'],
18 ['', 'fillStyle', '\tred', '#ff0000'],
19 ['', 'fillStyle', 'red\t', '#ff0000'],
20 ['', 'fillStyle', ' #f00', '#ff0000'],
21 ['', 'fillStyle', '#f00 ', '#ff0000'],
22 ['', 'fillStyle', '\t#f00', '#ff0000'],
23 ['', 'fillStyle', '#f00\t', '#ff0000'],
24 ['', 'fillStyle', ' rgb(255, 0, 0)', '#ff0000'],
25 ['', 'fillStyle', 'rgb(255,0,0) ', '#ff0000'],
26 ['', 'fillStyle', 'invalid', '#000000'], // Sanity check
27 ['', 'strokeStyle', ' red', '#ff0000'],
28 ['', 'strokeStyle', 'red ', '#ff0000'],
29 ['', 'strokeStyle', '\tred', '#ff0000'],
30 ['', 'strokeStyle', 'red\t', '#ff0000'],
31 ['', 'strokeStyle', 'invalid', '#000000'], // Sanity check
32 // The filter attribute is different: it does not get re-serialized
33 ['', 'filter', ' blur(5px)', ' blur(5px)'],
34 ['', 'filter', 'blur(5px) ', 'blur(5px) '],
35 ['', 'filter', 'blur( 5px)', 'blur( 5px)'],
36 ['', 'filter', '\tblur(5px)', '\tblur(5px)'],
37 ['', 'filter', 'blur(5px)\t', 'blur(5px)\t'],
38 ['', 'filter', 'invalid', 'none'], // Sanity check
39 ]);
40
41 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698