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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-fallback-element-test.html

Issue 1692183002: Canvas2d: The control in hit region should be a canvas fallback element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('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>HitRegion Canvas Fallback Element Test</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="./resources/test-helpers.js"></script>
6 <canvas width="400" height="400">
7 <a id="a"></a>
8 <a id="a_with_image"><img></a>
9 <button id="button"></button>
10 <input id="checkbox" type="checkbox">
11 <input id="radio" type="radio">
12 <input id="input_button" type="button">
13 <input id="input_image_button" type="image">
14 <select id="empty_select"></select>
15 <select id="select_size_greater_than_1" size="2"></select>
16 <select id="select_multiple" multiple="multiple"></select>
17 <select>
18 <option id="option_with_select"></option>
19 </select>
20 <select multiple="multiple">
21 <option id="option_with_select_multiple"></option>
22 </select>
23 <select size="2">
24 <option id="option_with_select_size_greater_than_1"></option>
25 </select>
26 <p id="p"></p>
27 <p id="p_with_tabindex" tabindex="0"></p>
28 <table>
29 <caption></caption>
30 <thead><tr><th></th></tr></thead>
31 <tfoot><tr><td></td></tr></tfoot>
32 <tbody><tr><td></td></tr></tbody>
33 </table>
34 </canvas>
35 <button id="button_is_not_descendant_of_canvas"></button>
36 <style>
37
38 body {
39 margin : 0px;
40 padding : 0px;
41 }
42
43 </style>
44 <script>
45
46 function canvas_fallback_test(element, expected) {
47 test(function() {
48 var canvas = document.querySelector('canvas');
49 var context = canvas.getContext('2d');
50
51 context.clearRect(0, 0, 400, 400);
52 context.rect(0, 0, 100, 100);
53 if (expected) {
54 assert_throws(expected, function() {
55 context.addHitRegion({ control : element });
56 });
57 } else {
58 context.addHitRegion({ control : element });
59 }
60 }, element.id);
61 }
62
63 const NotSupportedError = { name : 'NotSupportedError' };
64
65 canvas_fallback_test(document.getElementById('button_is_not_descendant_of_canvas '), NotSupportedError);
66 canvas_fallback_test(document.querySelector('canvas'), NotSupportedError);
67 canvas_fallback_test(document.getElementById('a'));
68 canvas_fallback_test(document.getElementById('a_with_image'), NotSupportedError) ;
69 canvas_fallback_test(document.getElementById('button'));
70 canvas_fallback_test(document.getElementById('checkbox'));
71 canvas_fallback_test(document.getElementById('radio'));
72 canvas_fallback_test(document.getElementById('input_button'));
73 canvas_fallback_test(document.getElementById('input_image_button'), NotSupported Error);
74 canvas_fallback_test(document.getElementById('empty_select'), NotSupportedError) ;
75 canvas_fallback_test(document.getElementById('select_size_greater_than_1'));
76 canvas_fallback_test(document.getElementById('select_multiple'));
77 canvas_fallback_test(document.getElementById('option_with_select'), NotSupported Error);
78 canvas_fallback_test(document.getElementById('option_with_select_multiple'));
79 canvas_fallback_test(document.getElementById('option_with_select_size_greater_th an_1'));
80 canvas_fallback_test(document.getElementById('p'), NotSupportedError);
81 canvas_fallback_test(document.getElementById('p_with_tabindex'));
82 canvas_fallback_test(document.querySelector('canvas table'));
83 canvas_fallback_test(document.querySelector('canvas tr'));
84 canvas_fallback_test(document.querySelector('canvas th'));
85 canvas_fallback_test(document.querySelector('canvas td'));
86 canvas_fallback_test(document.querySelector('canvas thead'));
87 canvas_fallback_test(document.querySelector('canvas tfoot'));
88 canvas_fallback_test(document.querySelector('canvas tbody'));
89 canvas_fallback_test(document.querySelector('canvas caption'));
90
91 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698