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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html

Issue 1815093002: Canvas2d: fix event.region being null on mouseleave/out events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html
index d970e7857abe97f2ed0ab2d10c0b72a8bfea84b7..93947520857f213c533063fd4073caec306cd470 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html
@@ -109,10 +109,8 @@ async_test(function() {
{ type: 'mousemove', target: button, region: 'button' },
{ type: 'mousedown', target: button, region: 'button' },
{ type: 'mouseup', target: button, region: 'button' },
- // TODO(zino): The expected value of region should be "button" instead of
- // null in case of mouseout/mouseleave. Please see http://crbug.com/592992.
- { type: 'mouseout', target: button, region: null },
- { type: 'mouseleave', target: button, region: null },
+ { type: 'mouseout', target: button, region: 'button' },
+ { type: 'mouseleave', target: button, region: 'button' },
{ type: 'touchstart', target: button, region: 'button' },
{ type: 'touchend', target: button, region: 'button' },
];
@@ -147,6 +145,53 @@ async_test(function() {
}, 'Rerouting mouse/touch event test');
async_test(function() {
+ context.rect(1, 1, 50, 50);
+ context.fill();
+ context.addHitRegion({ control: button });
+
+ var expected = [
+ { type: 'mouseover', target: button, region: null },
+ { type: 'mouseenter', target: button, region: null },
+ { type: 'mousemove', target: button, region: null },
+ { type: 'mousemove', target: button, region: null },
+ { type: 'mousedown', target: button, region: null },
+ { type: 'mouseup', target: button, region: null },
+ { type: 'mouseout', target: button, region: null },
+ { type: 'mouseleave', target: button, region: null },
+ { type: 'touchstart', target: button, region: null },
+ { type: 'touchend', target: button, region: null },
+ ];
+ var actual = [];
+
+ button.addEventListener('mouseover', e => actual.push(e));
+ button.addEventListener('mouseenter', e => actual.push(e));
+ button.addEventListener('mousemove', e => actual.push(e));
+ button.addEventListener('mousedown', e => actual.push(e));
+ button.addEventListener('mouseup', e => actual.push(e));
+ button.addEventListener('mouseout', e => actual.push(e));
+ button.addEventListener('mouseleave', e => actual.push(e));
+ button.addEventListener('touchstart', e => actual.push(e));
+ button.addEventListener('touchend', e => actual.push(e));
+
+ if (eventSender) {
+ eventSender.mouseMoveTo(0, 0);
+ eventSender.mouseMoveTo(10, 10);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseMoveTo(60, 60);
+
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(10, 10);
+ eventSender.touchStart();
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+ }
+
+ assert_event_array_equivalent(actual, expected);
+ this.done();
+}, 'Rerouting mouse/touch event test but the id of hit region is unset.');
+
+async_test(function() {
context.clearRect(0, 0, 400, 400);
context.rect(0, 0, 50, 50);
context.fill();
« 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