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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 m_innerPossiblyPseudoNode->getPseudoId() == PseudoIdBefore) 162 m_innerPossiblyPseudoNode->getPseudoId() == PseudoIdBefore)
163 return mostForwardCaretPosition( 163 return mostForwardCaretPosition(
164 Position(m_innerNode, PositionAnchorType::BeforeChildren)); 164 Position(m_innerNode, PositionAnchorType::BeforeChildren));
165 return layoutObject->positionForPoint(localPoint()); 165 return layoutObject->positionForPoint(localPoint());
166 } 166 }
167 167
168 LayoutObject* HitTestResult::layoutObject() const { 168 LayoutObject* HitTestResult::layoutObject() const {
169 return m_innerNode ? m_innerNode->layoutObject() : 0; 169 return m_innerNode ? m_innerNode->layoutObject() : 0;
170 } 170 }
171 171
172 void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() { 172 void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() {
fs 2017/03/15 13:34:45 Maybe the method name should be updated to reflect
hayato 2017/03/16 03:57:33 Done
173 if (Node* node = innerNode()) { 173 if (Node* node = innerNode()) {
174 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { 174 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) {
175 if (containingShadowRoot->type() == ShadowRootType::UserAgent) 175 if (containingShadowRoot->type() == ShadowRootType::UserAgent) {
176 setInnerNode(node->ownerShadowHost()); 176 setInnerNode(node->ownerShadowHost());
177 } else if (containingShadowRoot->type() == ShadowRootType::Closed &&
178 isSVGUseElement(containingShadowRoot->host())) {
179 // Consider a closed shadow tree of SVG's <use> element as a special
180 // case. A toolip does not work in svg's <use> element without this.
fs 2017/03/15 13:34:45 Nit: tooltip, also svg's -> SVG's (for consistency
hayato 2017/03/16 03:57:33 Done. I have rewritten it to drop the repetition.
181 setInnerNode(node->ownerShadowHost());
182 }
177 } 183 }
178 } 184 }
179 } 185 }
180 186
181 HTMLAreaElement* HitTestResult::imageAreaForImage() const { 187 HTMLAreaElement* HitTestResult::imageAreaForImage() const {
182 ASSERT(m_innerNode); 188 ASSERT(m_innerNode);
183 HTMLImageElement* imageElement = nullptr; 189 HTMLImageElement* imageElement = nullptr;
184 if (isHTMLImageElement(m_innerNode)) { 190 if (isHTMLImageElement(m_innerNode)) {
185 imageElement = toHTMLImageElement(m_innerNode); 191 imageElement = toHTMLImageElement(m_innerNode);
186 } else if (m_innerNode->isInShadowTree()) { 192 } else if (m_innerNode->isInShadowTree()) {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 else if (isHTMLMapElement(m_innerNode)) 509 else if (isHTMLMapElement(m_innerNode))
504 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); 510 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement();
505 511
506 if (!imageMapImageElement) 512 if (!imageMapImageElement)
507 return m_innerNode.get(); 513 return m_innerNode.get();
508 514
509 return imageMapImageElement; 515 return imageMapImageElement;
510 } 516 }
511 517
512 } // namespace blink 518 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGElement.cpp » ('j') | third_party/WebKit/Source/core/svg/SVGElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698