The event.region(for canvas hit region) is always null in case of mouseout/mouseleave events.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/282ff5518bc121cfe77a29ddd2b9a465b74daf37 commit 282ff5518bc121cfe77a29ddd2b9a465b74daf37 Author: jinho.bang <jinho.bang@samsung.com> Date: Mon Apr 18 15:52:01 2016 Canvas2d: fix event.region being null on mouseleave/out events In the current implementation of canvas hit region, the event.region always has null in case of mouseleave/mouseout. Because the mouse cursor is already off boundary of hit region when mouseleave/mouseout event happens. To solve this problem, keeps the region in mouseenter/mouseover event and then takes the value in mouseout/mouseleave event. BUG= 592992 Review URL: https://codereview.chromium.org/1815093002 Cr-Commit-Position: refs/heads/master@{#387915} [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-event-test.html [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/core/html/HTMLCanvasElement.h [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/core/input/PointerEventManager.cpp [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp [modify] https://crrev.com/282ff5518bc121cfe77a29ddd2b9a465b74daf37/third_party/WebKit/Source/modules/canvas2d/HitRegion.h
The HitRegion feature was abandoned.
Comment 1 by jinho.b...@samsung.com
, Mar 8 2016