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

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
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..084bf3125facda179949a538cd29ca003a29af4e 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
@@ -60,8 +60,17 @@ bool LayoutSVGTextPath::isChildAllowed(LayoutObject* child, const ComputedStyle&
PassOwnPtr<PathPositionMapper> LayoutSVGTextPath::layoutPath() const
{
const SVGTextPathElement& textPathElement = toSVGTextPathElement(*node());
- Element* targetElement = SVGURIReference::targetElementFromIRIString(
- textPathElement.hrefString(), textPathElement.treeScope());
+ Element* targetElement;
+ if (textPathElement.inUseShadowTree()) {
fs 2016/03/14 12:54:10 I think we could simplify this a bit (and preferab
hyunjunekim2 2016/03/15 23:11:32 Done.
+ SVGElement* correspondingElement = textPathElement.correspondingElement();
+ if (correspondingElement && isSVGTextPathElement(correspondingElement)) {
+ targetElement = SVGURIReference::targetElementFromIRIString(
+ textPathElement.hrefString(), correspondingElement->treeScope());
+ }
+ } else {
+ targetElement = SVGURIReference::targetElementFromIRIString(
+ textPathElement.hrefString(), textPathElement.treeScope());
+ }
if (!isSVGPathElement(targetElement))
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698