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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp

Issue 1792673005: Fix textpath is not displayed on use element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/text/textpath-reference-path-on-out-of-use-element-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
index 5562e3959948812d8387b6f8ccf2951aa0f331ac..261e9c4d7aff89e2b80a746a7afabd09d270c9cf 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
@@ -26,6 +26,13 @@
namespace blink {
+TreeScope& treeScopeForIdResolution(const SVGElement& element)
+{
+ if (SVGElement* correspondingElement = element.correspondingElement())
+ return correspondingElement->treeScope();
+ return element.treeScope();
+}
+
PathPositionMapper::PathPositionMapper(const Path& path)
: m_positionCalculator(path)
, m_pathLength(path.length())
@@ -61,7 +68,8 @@ PassOwnPtr<PathPositionMapper> LayoutSVGTextPath::layoutPath() const
{
const SVGTextPathElement& textPathElement = toSVGTextPathElement(*node());
Element* targetElement = SVGURIReference::targetElementFromIRIString(
- textPathElement.hrefString(), textPathElement.treeScope());
+ textPathElement.hrefString(), treeScopeForIdResolution(textPathElement));
+
if (!isSVGPathElement(targetElement))
return nullptr;
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/text/textpath-reference-path-on-out-of-use-element-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698