Bug 1689799 - Ensure we move to the next path when displaying multiple adjacent textPaths try: -b do -p linux64 -u reftest -t none draft bug1689799
authorlongsonr <longsonr@gmail.com>
Sat, 30 Jan 2021 21:04:16 +0000
changeset 3478102 a50ee7db05d2ae5dee7609d75c847014da940cdb
parent 3465890 5dc361e890c3b80e8ed645d93461520aa1fbef30
child 3679749 dd766adfdea320a7e136035df87894d2eb1e5a92
push id648363
push userlongsonr@gmail.com
push dateSat, 30 Jan 2021 21:40:24 +0000
treeherdertry@a50ee7db05d2 [default view] [failures only]
bugs1689799, 1678756
milestone86.0a1
Bug 1689799 - Ensure we move to the next path when displaying multiple adjacent textPaths try: -b do -p linux64 -u reftest -t none Summary: reverts part of bug 1678756 Reviewers: emilio Tags: #secure-revision Bug #: 1689799 Differential Revision: https://phabricator.services.mozilla.com/D103558
layout/reftests/svg/text/reftest.list
layout/reftests/svg/text/textpath-multiple.svg
layout/svg/SVGTextFrame.cpp
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -114,16 +114,17 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-a.svg textpath-a-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-anchor-middle.svg textpath-anchor-middle-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-anchor-end.svg textpath-anchor-end-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-cluster.svg textpath-cluster-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-invalid-parent.svg textpath-invalid-parent-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-multiline.svg textpath-multiline-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-multiline-2.svg textpath-multiline-2-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-after.svg textpath-after-ref.svg # Bug 1392106
+random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-multiple.svg ../pass.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-after-anchor-end.svg textpath-after-anchor-end-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-reset-position.svg textpath-reset-position-ref.svg # Bug 1392106
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == textpath-inherit-position.svg textpath-inherit-position-ref.svg # Bug 1392106
 
 == textLength.svg textLength-ref.svg
 fuzzy-if(skiaContent,0-1,0-200) == textLength-2.svg textLength-2-ref.svg
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||/^Windows\x20NT\x206\.[12]/.test(http.oscpu),0-4,0-17) fuzzy-if(skiaContent,0-4,0-100) == textLength-3.svg textLength-3-ref.svg
 == textLength-4.svg textLength-4-ref.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text/textpath-multiple.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
+  <defs>
+    <path id="path1" d="M100,100 H300"/>
+    <path id="path2" d="M200,100 H300"/>
+  </defs>
+  <rect width="100%" height="100%" fill="lime"/>
+  <g font-size="50px">
+    <text fill="red"><textPath href="#path1">Text</textPath> <textPath href="#path2">Text</textPath></text>
+    <text fill="lime" stroke="lime" stroke-width="4px"><textPath href="#path1">Text</textPath><textPath href="#path2">Text</textPath></text>
+  </g>
+</svg>
+
+
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -4658,17 +4658,18 @@ void SVGTextFrame::DoTextPathLayout() {
         break;
       }
       it.Next();
     }
 
     bool skippedEndOfTextPath = false;
 
     // Loop for each character in the text path.
-    while (!it.AtEnd() && it.TextPathFrame()) {
+    while (!it.AtEnd() && it.TextPathFrame() &&
+           it.TextPathFrame()->GetContent() == textPath) {
       // The index of the cluster or ligature group's first character.
       uint32_t i = it.TextElementCharIndex();
 
       // The index of the next character of the cluster or ligature.
       // We track this as we loop over the characters below so that we
       // can detect undisplayed characters and append entries into
       // partialAdvances for them.
       uint32_t j = i + 1;