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

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2229743003: add HitTestCanvasResult Class instend of std::pair<Element*, String> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add HitTestCanvasResult Class instend of std::pair<Element*, String> Created 4 years, 4 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
Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index d6d09a42fbc9600e38c306ffd99c946dc606bf9e..446af06ceb533ac6c6355da509b139e620ea5a19 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -12,6 +12,7 @@
#include "core/html/HTMLCanvasElement.h"
#include "core/input/EventHandler.h"
#include "core/input/TouchActionUtil.h"
+#include "core/layout/HitTestCanvasResult.h"
#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
#include "platform/PlatformTouchEvent.h"
@@ -424,10 +425,10 @@ void PointerEventManager::dispatchTouchPointerEvents(
if (node) {
touchInfo.targetFrame = node->document().frame();
if (isHTMLCanvasElement(node)) {
- std::pair<Element*, String> regionInfo = toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists(hitTestTesult.pointInInnerNodeFrame());
- if (regionInfo.first)
- node = regionInfo.first;
- touchInfo.region = regionInfo.second;
+ HitTestCanvasResult* hitTestCanvasResult = toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists(hitTestTesult.pointInInnerNodeFrame());
+ if (hitTestCanvasResult->getControl())
+ node = hitTestCanvasResult->getControl();
+ touchInfo.region = hitTestCanvasResult->getId();
}
// TODO(crbug.com/612456): We need to investigate whether pointer
// events should go to text nodes or not. If so we need to

Powered by Google App Engine
This is Rietveld 408576698