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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 #include "core/html/parser/HTMLDocumentParser.h" 174 #include "core/html/parser/HTMLDocumentParser.h"
175 #include "core/html/parser/HTMLParserIdioms.h" 175 #include "core/html/parser/HTMLParserIdioms.h"
176 #include "core/html/parser/NestingLevelIncrementer.h" 176 #include "core/html/parser/NestingLevelIncrementer.h"
177 #include "core/html/parser/TextResourceDecoder.h" 177 #include "core/html/parser/TextResourceDecoder.h"
178 #include "core/input/EventHandler.h" 178 #include "core/input/EventHandler.h"
179 #include "core/inspector/ConsoleMessage.h" 179 #include "core/inspector/ConsoleMessage.h"
180 #include "core/inspector/InspectorInstrumentation.h" 180 #include "core/inspector/InspectorInstrumentation.h"
181 #include "core/inspector/InspectorTraceEvents.h" 181 #include "core/inspector/InspectorTraceEvents.h"
182 #include "core/inspector/InstanceCounters.h" 182 #include "core/inspector/InstanceCounters.h"
183 #include "core/inspector/MainThreadDebugger.h" 183 #include "core/inspector/MainThreadDebugger.h"
184 #include "core/layout/HitTestCanvasResult.h"
184 #include "core/layout/HitTestResult.h" 185 #include "core/layout/HitTestResult.h"
185 #include "core/layout/LayoutPart.h" 186 #include "core/layout/LayoutPart.h"
186 #include "core/layout/LayoutView.h" 187 #include "core/layout/LayoutView.h"
187 #include "core/layout/TextAutosizer.h" 188 #include "core/layout/TextAutosizer.h"
188 #include "core/layout/api/LayoutViewItem.h" 189 #include "core/layout/api/LayoutViewItem.h"
189 #include "core/layout/compositing/PaintLayerCompositor.h" 190 #include "core/layout/compositing/PaintLayerCompositor.h"
190 #include "core/loader/CookieJar.h" 191 #include "core/loader/CookieJar.h"
191 #include "core/loader/DocumentLoader.h" 192 #include "core/loader/DocumentLoader.h"
192 #include "core/loader/FrameFetchContext.h" 193 #include "core/loader/FrameFetchContext.h"
193 #include "core/loader/FrameLoader.h" 194 #include "core/loader/FrameLoader.h"
(...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after
3175 return MouseEventWithHitTestResults(event, HitTestResult(request, Layout Point())); 3176 return MouseEventWithHitTestResults(event, HitTestResult(request, Layout Point()));
3176 3177
3177 HitTestResult result(request, documentPoint); 3178 HitTestResult result(request, documentPoint);
3178 layoutViewItem().hitTest(result); 3179 layoutViewItem().hitTest(result);
3179 3180
3180 if (!request.readOnly()) 3181 if (!request.readOnly())
3181 updateHoverActiveState(request, result.innerElement()); 3182 updateHoverActiveState(request, result.innerElement());
3182 3183
3183 if (isHTMLCanvasElement(result.innerNode())) { 3184 if (isHTMLCanvasElement(result.innerNode())) {
3184 PlatformMouseEvent eventWithRegion = event; 3185 PlatformMouseEvent eventWithRegion = event;
3185 std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.inne rNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); 3186 HitTestCanvasResult* hitTestCanvasResult = toHTMLCanvasElement(result.in nerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
3186 if (regionInfo.first) 3187 if (hitTestCanvasResult->getControl()) {
3187 result.setInnerNode(regionInfo.first); 3188 result.setInnerNode(hitTestCanvasResult->getControl());
3188 eventWithRegion.setRegion(regionInfo.second); 3189 }
3190 eventWithRegion.setRegion(hitTestCanvasResult->getId());
3189 return MouseEventWithHitTestResults(eventWithRegion, result); 3191 return MouseEventWithHitTestResults(eventWithRegion, result);
3190 } 3192 }
3191 3193
3192 return MouseEventWithHitTestResults(event, result); 3194 return MouseEventWithHitTestResults(event, result);
3193 } 3195 }
3194 3196
3195 // DOM Section 1.1.1 3197 // DOM Section 1.1.1
3196 bool Document::childTypeAllowed(NodeType type) const 3198 bool Document::childTypeAllowed(NodeType type) const
3197 { 3199 {
3198 switch (type) { 3200 switch (type) {
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
6038 } 6040 }
6039 6041
6040 void showLiveDocumentInstances() 6042 void showLiveDocumentInstances()
6041 { 6043 {
6042 WeakDocumentSet& set = liveDocumentSet(); 6044 WeakDocumentSet& set = liveDocumentSet();
6043 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6045 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6044 for (Document* document : set) 6046 for (Document* document : set)
6045 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6047 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6046 } 6048 }
6047 #endif 6049 #endif
OLDNEW
« 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