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

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: 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 73f1c21301bedf73500055e394d7bbb91b92e568..0f7a9d9f906cc2f05d1ad3ed27d89e3b1d8e6380 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -180,6 +180,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"
@@ -3176,10 +3177,12 @@ 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());
+ result.setHitCanvasRegion(hitTestCanvasResult);
zino 2016/08/19 18:00:07 Do we really need this? HitTestResult only has set
Hwanseung Lee 2016/08/20 06:03:54 Done.
return MouseEventWithHitTestResults(eventWithRegion, result);
}

Powered by Google App Engine
This is Rietveld 408576698