Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (r238524): SVG textPath cannot be rendered when <text> ele…
…ment is referred by <use> element https://bugs.webkit.org/show_bug.cgi?id=198280 Reviewed by Myles C. Maxfield. The bug was caused by targetElementFromIRIString looking for a matching element in the use element's UA shadow tree instead of the outer tree which defined the content of use element's shadow tree. Fixed the bug by looking for the matching element in the tree that contains the use element instead. * LayoutTests/svg/dom/use-element-reference-within-use-shadow-tree-expected.html: Added. * LayoutTests/svg/dom/use-element-reference-within-use-shadow-tree.html: Added. * Source/WebCore/svg/SVGURIReference.cpp: (WebCore::SVGURIReference::targetElementFromIRIString): Fixed the bug. Canonical link: https://commits.webkit.org/252547@main
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
LayoutTests/svg/dom/use-element-reference-within-use-shadow-tree-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 500" > | ||
<path id="MyPath" d="M 100 100 C 100 100 400 100 400 100" fill="none" stroke="green"/> | ||
<text id="MyText" font-size="20" fill="green"> | ||
<textPath xlink:href="#MyPath"> | ||
PASS | ||
</textPath> | ||
</text> | ||
</svg> |
16 changes: 16 additions & 0 deletions
16
LayoutTests/svg/dom/use-element-reference-within-use-shadow-tree.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 500" > | ||
<defs> | ||
<g id="g"> | ||
<defs> | ||
<path id="path" d="M 100 100 C 100 100 400 100 400 100" /> | ||
</defs> | ||
<text id="text" font-size="20" fill="green" > | ||
<textPath xlink:href="#path"> | ||
PASS | ||
</textPath> | ||
</text> | ||
</g> | ||
</defs> | ||
<use xlink:href="#path" fill="none" stroke="green"/> | ||
<use xlink:href="#g"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters