Skip to content

Commit 5132841

Browse files
committed
[SVG text] Enable the SVG 2 text layout algorithm by default
https://bugs.webkit.org/show_bug.cgi?id=327912 rdar://problem/190288583 Reviewed by Alan Baradlay. Turn on SVG2TextLayoutAlgorithmEnabled. Test changes: - svg/batik/text/xmlSpace.svg: a collapsible space that follows a preserved space is now kept, as the line layout decides whitespace. This matches Chrome and Firefox. - svg/batik/text/textLayout.svg: spacingAndGlyphs with word-spacing now dumps the stretched positions of each word instead of unstretched positions under a single transform. The rendering is the same. - svg/batik/text/textLength.svg: spacingAndGlyphs with text-anchor now dumps the start of the stretched text, for example 225 - 50 / 2 = 200 for textLength="50" at x="225", instead of the unstretched anchored position under a transform. The rendering is the same. - svg/custom/glyph-transformation-with-hkern.svg, svg/text/font-size-below-point-five.svg, svg/zoom/page/zoom-mask-with-percentages.svg: 0.01px width differences. - GTK and WPE: 1px text box size differences in svg/ text tests. - WPT textLength-list-x-spacingAndGlyphs.svg: fix the test. It expected the explicit x positions to move with the glyph stretching. That is wrong per spec, which applies absolute positions after textLength, and Chrome and Firefox fail the test on wpt.fyi. The test and the reference now expect each glyph to stretch in place at its x position. What the test is about, textLength applying across the whole element instead of to each chunk (webkit.org/b/61855), is not affected. - mozilla/svg/text/textLength-5.svg and WPT textLength-list-y-spacing.svg now pass. * LayoutTests/TestExpectations: textLength-5.svg and textLength-list-y-spacing.svg pass. * LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textLength-list-x-spacingAndGlyphs-expected.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textLength-list-x-spacingAndGlyphs-ref.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textLength-list-x-spacingAndGlyphs.svg: * LayoutTests/platform/glib/svg/W3C-I18N/g-dirLTR-ubNone-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/g-dirLTR-ubOverride-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/g-dirRTL-ubNone-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/g-dirRTL-ubOverride-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/text-dirLTR-ubNone-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/text-dirLTR-ubOverride-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/text-dirRTL-ubNone-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/text-dirRTL-ubOverride-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirLTR-ubEmbed-in-rtl-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirLTR-ubNone-in-rtl-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirLTR-ubOverride-in-default-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirLTR-ubOverride-in-ltr-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirLTR-ubOverride-in-rtl-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirNone-ubOverride-in-default-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirNone-ubOverride-in-ltr-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirNone-ubOverride-in-rtl-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubEmbed-in-default-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubEmbed-in-ltr-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubNone-in-default-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubNone-in-ltr-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubOverride-in-default-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubOverride-in-ltr-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-dirRTL-ubOverride-in-rtl-context-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-direction-ltr-expected.txt: * LayoutTests/platform/glib/svg/W3C-I18N/tspan-direction-rtl-expected.txt: * LayoutTests/platform/glib/svg/W3C-SVG-1.1/animate-elem-06-t-expected.txt: * LayoutTests/platform/glib/svg/W3C-SVG-1.1/text-text-01-b-expected.txt: * LayoutTests/platform/glib/svg/batik/text/textAnchor-expected.txt: * LayoutTests/platform/glib/svg/batik/text/textLayout-expected.txt: * LayoutTests/platform/glib/svg/batik/text/textLength-expected.txt: * LayoutTests/platform/glib/svg/batik/text/xmlSpace-expected.txt: * LayoutTests/platform/glib/svg/carto.net/window-expected.txt: * LayoutTests/platform/glib/svg/custom/tref-update-expected.txt: * LayoutTests/platform/glib/svg/text/font-size-below-point-five-expected.txt: * LayoutTests/platform/glib/svg/text/select-textLength-spacing-stretch-1-expected.txt: * LayoutTests/platform/glib/svg/text/select-textLength-spacing-stretch-2-expected.txt: * LayoutTests/platform/glib/svg/text/select-textLength-spacing-stretch-3-expected.txt: * LayoutTests/platform/glib/svg/text/select-textLength-spacing-stretch-4-expected.txt: * LayoutTests/platform/glib/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.txt: * LayoutTests/platform/glib/svg/text/select-x-list-with-tspans-4-expected.txt: * LayoutTests/platform/glib/svg/text/text-align-01-b-expected.txt: * LayoutTests/platform/glib/svg/text/text-align-02-b-expected.txt: * LayoutTests/platform/glib/svg/text/text-align-04-b-expected.txt: * LayoutTests/platform/glib/svg/text/text-align-06-b-expected.txt: * LayoutTests/platform/glib/svg/text/text-text-05-t-expected.txt: * LayoutTests/platform/glib/svg/transforms/text-with-pattern-inside-transformed-html-expected.txt: * LayoutTests/platform/glib/svg/transforms/text-with-pattern-with-svg-transform-expected.txt: * LayoutTests/platform/ios/svg/batik/text/textLength-expected.txt: * LayoutTests/platform/ios/svg/text/font-size-below-point-five-expected.txt: * LayoutTests/platform/mac/svg/batik/text/textLayout-expected.txt: * LayoutTests/platform/mac/svg/batik/text/textLength-expected.txt: * LayoutTests/platform/mac/svg/batik/text/xmlSpace-expected.txt: * LayoutTests/platform/mac/svg/text/font-size-below-point-five-expected.txt: * LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.txt: * LayoutTests/platform/wpe/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.txt: * LayoutTests/svg/custom/glyph-transformation-with-hkern-expected.txt: * LayoutTests/svg/text/textLength-spacing-absolute-positions.html: The flag is on by default now. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Canonical link: https://commits.webkit.org/324088@main
1 parent d22fe75 commit 5132841

62 files changed

Lines changed: 272 additions & 272 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎LayoutTests/TestExpectations‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,6 @@ webkit.org/b/139186 imported/mozilla/svg/text/ignore-text-align-2.svg [ ImageOnl
30173017
webkit.org/b/139192 imported/mozilla/svg/smil/transform/rotate-angle-4.svg [ ImageOnlyFailure ]
30183018
webkit.org/b/139192 imported/mozilla/svg/smil/transform/rotate-angle-5.svg [ ImageOnlyFailure ]
30193019
webkit.org/b/131354 imported/mozilla/svg/blend-difference-stacking.html [ ImageOnlyFailure ]
3020-
webkit.org/b/139210 imported/mozilla/svg/text/textLength-5.svg [ ImageOnlyFailure ]
30213020
webkit.org/b/139210 imported/mozilla/svg/text/textLength-6.svg [ ImageOnlyFailure ]
30223021
webkit.org/b/139237 imported/mozilla/svg/filters/feComposite-1.svg [ ImageOnlyFailure ]
30233022
webkit.org/b/139258 imported/mozilla/svg/text-layout-05.svg [ ImageOnlyFailure ]
@@ -3064,11 +3063,6 @@ imported/w3c/web-platform-tests/svg/text/reftests/text-shape-inside-002.svg [ Im
30643063
imported/w3c/web-platform-tests/svg/text/reftests/text-xml-space-001.svg [ ImageOnlyFailure ]
30653064
imported/w3c/web-platform-tests/svg/text/reftests/text-font-face-load-image.html [ Skip ]
30663065

3067-
# webkit.org/b/61855: textLength with lengthAdjust="spacing" and a list-valued
3068-
# x/y attribute still produces per-chunk div-by-zero and silently drops
3069-
# textLength. Pinned here until the spacing-mode follow-up patch lands.
3070-
imported/w3c/web-platform-tests/svg/text/reftests/textLength-list-y-spacing.svg [ ImageOnlyFailure ]
3071-
30723066
imported/w3c/web-platform-tests/svg/animations/scripted/syncbase-after-removal.html [ Skip ]
30733067
imported/w3c/web-platform-tests/svg/animations/media-fragment-override-animation.html [ ImageOnlyFailure ]
30743068
imported/w3c/web-platform-tests/svg/interact/use-instance-hover.html [ ImageOnlyFailure ]
Lines changed: 10 additions & 10 deletions
Loading
Lines changed: 10 additions & 10 deletions
Loading

‎LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textLength-list-x-spacingAndGlyphs.svg‎

Lines changed: 9 additions & 8 deletions
Loading

‎LayoutTests/platform/glib/svg/W3C-I18N/g-dirLTR-ubNone-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ layer at (0,0) size 800x600
99
chunk 1 (middle anchor) text run 1 at (91.47,150.00) startOffset 0 endOffset 4 width 45.00: "W3C "
1010
chunk 1 (middle anchor) text run 1 at (136.47,150.00) startOffset 0 endOffset 12 width 100.20 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
1111
chunk 1 (middle anchor) text run 1 at (236.67,150.00) startOffset 0 endOffset 15 width 131.86: " dirLTR ubNone!"
12-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
13-
RenderSVGInlineText {#text} at (0,0) size 84x12
12+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
13+
RenderSVGInlineText {#text} at (0,0) size 85x12
1414
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1515
RenderSVGImage {image} at (100,300) size 584x65
1616
RenderSVGContainer {g} at (16,557) size 76x12

‎LayoutTests/platform/glib/svg/W3C-I18N/g-dirLTR-ubOverride-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ layer at (0,0) size 800x600
99
chunk 1 (middle anchor) text run 1 at (78.57,150.00) startOffset 0 endOffset 4 width 45.00: "W3C "
1010
chunk 1 (middle anchor) text run 1 at (123.57,150.00) startOffset 0 endOffset 12 width 100.20 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
1111
chunk 1 (middle anchor) text run 1 at (223.77,150.00) startOffset 0 endOffset 19 width 157.66: " dirLTR ubOverride!"
12-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
13-
RenderSVGInlineText {#text} at (0,0) size 84x12
12+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
13+
RenderSVGInlineText {#text} at (0,0) size 85x12
1414
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1515
RenderSVGImage {image} at (100,300) size 584x65
1616
RenderSVGContainer {g} at (16,557) size 76x12

‎LayoutTests/platform/glib/svg/W3C-I18N/g-dirRTL-ubNone-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ layer at (0,0) size 800x600
1010
chunk 1 (middle anchor) text run 1 at (96.10,150.00) startOffset 0 endOffset 13 width 122.61: "dirRTL ubNone"
1111
chunk 1 (middle anchor) text run 1 at (218.70,150.00) startOffset 0 endOffset 14 width 109.80 RTL: " \x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} "
1212
chunk 1 (middle anchor) text run 1 at (328.50,150.00) startOffset 0 endOffset 3 width 40.20: "W3C"
13-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
14-
RenderSVGInlineText {#text} at (0,0) size 84x12
13+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
14+
RenderSVGInlineText {#text} at (0,0) size 85x12
1515
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1616
RenderSVGImage {image} at (100,300) size 584x65
1717
RenderSVGContainer {g} at (16,557) size 76x12

‎LayoutTests/platform/glib/svg/W3C-I18N/g-dirRTL-ubOverride-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ layer at (0,0) size 800x600
1010
chunk 1 (middle anchor) text run 1 at (83.20,150.00) startOffset 0 endOffset 17 width 148.41: "dirRTL ubOverride"
1111
chunk 1 (middle anchor) text run 1 at (231.60,150.00) startOffset 0 endOffset 14 width 109.80 RTL: " \x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} "
1212
chunk 1 (middle anchor) text run 1 at (341.40,150.00) startOffset 0 endOffset 3 width 40.20: "W3C"
13-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
14-
RenderSVGInlineText {#text} at (0,0) size 84x12
13+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
14+
RenderSVGInlineText {#text} at (0,0) size 85x12
1515
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1616
RenderSVGImage {image} at (100,300) size 584x65
1717
RenderSVGContainer {g} at (16,557) size 76x12

‎LayoutTests/platform/glib/svg/W3C-I18N/text-dirLTR-ubNone-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ layer at (0,0) size 800x600
88
chunk 1 (middle anchor) text run 1 at (91.47,150.00) startOffset 0 endOffset 4 width 45.00: "W3C "
99
chunk 1 (middle anchor) text run 1 at (136.47,150.00) startOffset 0 endOffset 12 width 100.20 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
1010
chunk 1 (middle anchor) text run 1 at (236.67,150.00) startOffset 0 endOffset 15 width 131.86: " dirLTR ubNone!"
11-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
12-
RenderSVGInlineText {#text} at (0,0) size 84x12
11+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
12+
RenderSVGInlineText {#text} at (0,0) size 85x12
1313
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1414
RenderSVGImage {image} at (100,300) size 584x65
1515
RenderSVGContainer {g} at (16,557) size 76x12

‎LayoutTests/platform/glib/svg/W3C-I18N/text-dirLTR-ubOverride-expected.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ layer at (0,0) size 800x600
66
RenderSVGText {text} at (80,133) size 300x21 contains 1 chunk(s)
77
RenderSVGInlineText {#text} at (0,0) size 300x20
88
chunk 1 (middle anchor) text run 1 at (80.37,150.00) startOffset 0 endOffset 35 width 299.26: "W3C \x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} dirLTR ubOverride!"
9-
RenderSVGText {text} at (20,171) size 84x12 contains 1 chunk(s)
10-
RenderSVGInlineText {#text} at (0,0) size 84x12
9+
RenderSVGText {text} at (20,171) size 85x12 contains 1 chunk(s)
10+
RenderSVGInlineText {#text} at (0,0) size 85x12
1111
chunk 1 text run 1 at (20.00,180.00) startOffset 0 endOffset 18 width 84.00: "Reference graphic:"
1212
RenderSVGImage {image} at (100,300) size 584x65
1313
RenderSVGContainer {g} at (16,557) size 76x12

0 commit comments

Comments
 (0)