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

Unified Diff: Source/core/rendering/HitTestResult.cpp

Issue 15932012: HitTestResult::innerElement should check its parent node for rendering and styling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WIP2 Created 7 years, 7 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
« Source/core/dom/Document.cpp ('K') | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/HitTestResult.cpp
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index 384e6ddb4c82bec90a37491eea82a6b5e0cb85e8..300cf40d8c5cd6d6e3bc78344b48afcc2b5e0f47 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -26,6 +26,7 @@
#include "SVGNames.h"
#include "XLinkNames.h"
#include "core/dom/DocumentMarkerController.h"
+#include "core/dom/NodeRenderingTraversal.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/FrameSelection.h"
#include "core/html/HTMLAnchorElement.h"
@@ -472,11 +473,17 @@ Node* HitTestResult::targetNode() const
Element* HitTestResult::innerElement() const
{
- for (Node* node = m_innerNode.get(); node; node = node->parentNode()) {
+ Node* node = m_innerNode.get();
+ if (!node)
+ return 0;
+
+ if (node->isElementNode())
+ return toElement(node);
+
+ NodeRenderingTraversal::ParentDetails details;
+ for (node = NodeRenderingTraversal::parent(node, &details); node; node = node->parentOrShadowHostNode())
hayato 2013/06/03 09:03:47 Could you help me to understand why we don't alway
tasak 2013/06/03 11:18:25 Done. I guess, we need to check only parentNode t
if (node->isElementNode())
return toElement(node);
- }
-
return 0;
}
« Source/core/dom/Document.cpp ('K') | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698