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

Unified Diff: third_party/WebKit/Source/core/dom/Document.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
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | 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/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 758cfb9ed5c23e015338da211994c7ad1189cdfa..f8d81f74113d91ab2d04a58971a36c4c6f6bf22a 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -181,6 +181,7 @@
#include "core/inspector/InspectorTraceEvents.h"
#include "core/inspector/InstanceCounters.h"
#include "core/inspector/MainThreadDebugger.h"
+#include "core/layout/HitTestCanvasResult.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutPart.h"
#include "core/layout/LayoutView.h"
@@ -3182,10 +3183,11 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r
if (isHTMLCanvasElement(result.innerNode())) {
PlatformMouseEvent eventWithRegion = event;
- std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.innerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
- if (regionInfo.first)
- result.setInnerNode(regionInfo.first);
- eventWithRegion.setRegion(regionInfo.second);
+ HitTestCanvasResult* hitTestCanvasResult = toHTMLCanvasElement(result.innerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
+ if (hitTestCanvasResult->getControl()) {
+ result.setInnerNode(hitTestCanvasResult->getControl());
+ }
+ eventWithRegion.setRegion(hitTestCanvasResult->getId());
return MouseEventWithHitTestResults(eventWithRegion, result);
}
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698