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

Unified Diff: third_party/WebKit/Source/core/layout/HitTestResult.cpp

Issue 2752763002: Change the type of a SVG <use> element's shadow tree from "user agent" to "closed" (Closed)
Patch Set: Rebased and resolve a conflict in HitTestResult Created 3 years, 9 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/layout/HitTestResult.cpp
diff --git a/third_party/WebKit/Source/core/layout/HitTestResult.cpp b/third_party/WebKit/Source/core/layout/HitTestResult.cpp
index 54e7376ca94af767bf856b9dea0d2603b548c9f7..f3175535c5251fb743debb3cef5168c9c2f06d9e 100644
--- a/third_party/WebKit/Source/core/layout/HitTestResult.cpp
+++ b/third_party/WebKit/Source/core/layout/HitTestResult.cpp
@@ -169,7 +169,7 @@ LayoutObject* HitTestResult::layoutObject() const {
return m_innerNode ? m_innerNode->layoutObject() : 0;
}
-void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() {
+void HitTestResult::setToShadowHostIfInRestrictedShadowRoot() {
Node* node = innerNode();
if (!node)
return;
@@ -177,10 +177,14 @@ void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() {
ShadowRoot* containingShadowRoot = node->containingShadowRoot();
Element* shadowHost = nullptr;
+ // Consider a closed shadow tree of SVG's <use> element as a special
+ // case so that a toolip title in the shadow tree works.
while (containingShadowRoot &&
- containingShadowRoot->type() == ShadowRootType::UserAgent) {
+ (containingShadowRoot->type() == ShadowRootType::UserAgent ||
+ isSVGUseElement(containingShadowRoot->host()))) {
shadowHost = &containingShadowRoot->host();
containingShadowRoot = shadowHost->containingShadowRoot();
+ setInnerNode(node->ownerShadowHost());
}
if (shadowHost)
« no previous file with comments | « third_party/WebKit/Source/core/layout/HitTestResult.h ('k') | third_party/WebKit/Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698