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

Unified Diff: third_party/WebKit/Source/core/input/TouchEventManager.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/TouchEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
index 9fca18a95a4d5d3ac7968d5686257643c42f8736..61ebef8989021452b932a75a8e6e700476b0ee2a 100644
--- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
@@ -13,6 +13,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/Histogram.h"
@@ -250,10 +251,10 @@ void TouchEventManager::updateTargetAndRegionMapsForTouchStarts(
if (!node)
continue;
if (isHTMLCanvasElement(node)) {
- std::pair<Element*, String> regionInfo = toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
- if (regionInfo.first)
- node = regionInfo.first;
- touchInfo.region = regionInfo.second;
+ HitTestCanvasResult* hitTestCanvasResult = toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
+ if (hitTestCanvasResult->getControl())
+ node = hitTestCanvasResult->getControl();
+ touchInfo.region = hitTestCanvasResult->getId();
}
// Touch events should not go to text nodes.
if (node->isTextNode())

Powered by Google App Engine
This is Rietveld 408576698