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

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

Issue 14677012: Made Blink tooltip ShadowDOM-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/rendering/HitTestResult.cpp
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index 7b0694461feee95e26ae01e508e2d19c008bc7d1..7da6a3a5260606d241f1e00694ada3e79ee81203 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -24,6 +24,7 @@
#include "HTMLNames.h"
#include "core/dom/DocumentMarkerController.h"
+#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/html/HTMLAnchorElement.h"
@@ -112,16 +113,34 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
return *this;
}
-void HitTestResult::setToNonShadowAncestor()
+void HitTestResult::setToNodesInDocumentTreeScope()
dglazkov 2013/05/13 16:11:42 It's not necessarily document tree scope, right? Y
{
- Node* node = innerNode();
- if (node)
+ if (Node* node = innerNode()) {
node = node->document()->ancestorInThisScope(node);
Hajime Morrita 2013/05/14 00:13:53 This asks document()->ancestorInThisScope(), which
- setInnerNode(node);
- node = innerNonSharedNode();
- if (node)
+ setInnerNode(node);
+ }
+
+ if (Node* node = innerNonSharedNode()) {
node = node->document()->ancestorInThisScope(node);
- setInnerNonSharedNode(node);
+ setInnerNonSharedNode(node);
+ }
+}
+
+void HitTestResult::setToShadowHostIfInUserAgentShadowRoot()
+{
+ if (Node* node = innerNode()) {
+ if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) {
+ if (containingShadowRoot->type() == ShadowRoot::UserAgentShadowRoot)
+ setInnerNode(node->shadowHost());
+ }
+ }
+
+ if (Node* node = innerNonSharedNode()) {
+ if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) {
+ if (containingShadowRoot->type() == ShadowRoot::UserAgentShadowRoot)
+ setInnerNonSharedNode(node->shadowHost());
+ }
+ }
}
void HitTestResult::setInnerNode(Node* n)
« LayoutTests/fast/dom/shadow/tooltips-in-shadow.html ('K') | « Source/core/rendering/HitTestResult.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698