Skip to content
Permalink
Browse files
Don't auto-wrap 'svg:text'
Don't auto-wrap 'svg:text'
https://bugs.webkit.org/show_bug.cgi?id=249300

Reviewed by Simon Fraser.

This patch is to align Webkit with Gecko / Firefox and Blink / Chromium.

Merge - https://src.chromium.org/viewvc/blink?revision=196298&view=revision

Even if an explicit 'white-space' property overrides the presentation
attribute style (from 'xml:space'), auto-wrap should still be disabled.

* Source/WebCore/rendering/line/BreakingContext.h:
(BreakingContext::initializeForCurrentObject):
(1) Add bool 'isSVGText'
(2) Use 'isSVGText" for m_autoWrap to disable on SVG Text
(3) Update 'm_preservesNewline' to use new bool 'isSVGText'
* LayoutTests/svg/text/white-space-no-autowrap.html: Add Test Case
* LayoutTests/svg/text/white-space-no-autowrap-expected.html: Add Test Case Expectation
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-001-expected.txt: Updated Test Expectations
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-003-expected.txt: Ditto
* LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-002-expected.txt: Ditto
* LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-001-expected.txt: Ditto
* LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-002-expected.txt: Ditto
* LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/text/reftests/text-multiline-003-expected.txt: Ditto
* LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/text/reftest/text-multiline-001-expected.txt: Ditto
* LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/text/reftest/text-multiline-002-expected.txt: Ditto
* LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/text/reftest/text-multiline-003-expected.txt: Ditto

Canonical link: https://commits.webkit.org/257993@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Dec 16, 2022
1 parent cf7c7c3 commit f89806418b17c817c6be33774b1394a1fd846a06
Show file tree
Hide file tree
Showing 12 changed files with 614 additions and 664 deletions.
@@ -1,37 +1,19 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (133,167) size 534x230
RenderSVGRoot {svg} at (14,167) size 765x230
RenderSVGContainer {g} at (0,0) size 0x0
RenderSVGContainer {g} at (133,167) size 534x230
RenderSVGContainer {g} at (133,167) size 43x30
RenderSVGText {text} at (80,100) size 45x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 159x18
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 5 width 44.40: "Lorem"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 5 width 42.60: "ipsum"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 5 width 34.80: "dolor"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 3 width 16.20: "sit"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 5 width 40.20: "amet,"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 22 width 158.40: "consecteturadipisicing"
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 5 width 25.20: "elit,"
RenderSVGContainer {g} at (378,267) size 44x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,60.00)}]
RenderSVGText {text} at (227,100) size 45x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 159x18
chunk 1 (middle anchor) text run 1 at (217.80,114.80) startOffset 0 endOffset 5 width 44.40: "Lorem"
chunk 1 (middle anchor) text run 1 at (218.70,114.80) startOffset 0 endOffset 5 width 42.60: "ipsum"
chunk 1 (middle anchor) text run 1 at (222.60,114.80) startOffset 0 endOffset 5 width 34.80: "dolor"
chunk 1 (middle anchor) text run 1 at (231.90,114.80) startOffset 0 endOffset 3 width 16.20: "sit"
chunk 1 (middle anchor) text run 1 at (219.90,114.80) startOffset 0 endOffset 5 width 40.20: "amet,"
chunk 1 (middle anchor) text run 1 at (160.80,114.80) startOffset 0 endOffset 22 width 158.40: "consecteturadipisicing"
chunk 1 (middle anchor) text run 1 at (227.40,114.80) startOffset 0 endOffset 5 width 25.20: "elit,"
RenderSVGContainer {g} at (624,367) size 43x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,120.00)}]
RenderSVGText {text} at (374,100) size 46x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 83x18
chunk 1 (end anchor) text run 1 at (355.60,114.80) startOffset 0 endOffset 5 width 44.40: "Lorem"
chunk 1 (end anchor) text run 1 at (357.40,114.80) startOffset 0 endOffset 5 width 42.60: "ipsum"
chunk 1 (end anchor) text run 1 at (365.20,114.80) startOffset 0 endOffset 5 width 34.80: "dolor"
chunk 1 (end anchor) text run 1 at (383.80,114.80) startOffset 0 endOffset 3 width 16.20: "sit"
chunk 1 (end anchor) text run 1 at (359.80,114.80) startOffset 0 endOffset 5 width 40.20: "amet,"
chunk 1 (end anchor) text run 1 at (317.20,114.80) startOffset 0 endOffset 11 width 82.80: "consectetur"
chunk 1 (end anchor) text run 1 at (324.40,114.80) startOffset 0 endOffset 11 width 75.60: "adipisicing"
chunk 1 (end anchor) text run 1 at (374.80,114.80) startOffset 0 endOffset 5 width 25.20: "elit,"
RenderSVGContainer {g} at (14,167) size 765x230
RenderSVGContainer {g} at (133,167) size 646x30
RenderSVGText {text} at (80,100) size 387x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 387x18
chunk 1 text run 1 at (80.00,114.80) startOffset 0 endOffset 56 width 387.00: "Lorem ipsum dolor sit amet, consecteturadipisicing elit,"
RenderSVGContainer {g} at (77,267) size 646x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,60.00)}]
RenderSVGText {text} at (46,100) size 388x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 387x18
chunk 1 (middle anchor) text run 1 at (46.50,114.80) startOffset 0 endOffset 56 width 387.00: "Lorem ipsum dolor sit amet, consecteturadipisicing elit,"
RenderSVGContainer {g} at (14,367) size 653x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,120.00)}]
RenderSVGText {text} at (8,100) size 392x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 392x18
chunk 1 (end anchor) text run 1 at (8.80,114.80) startOffset 0 endOffset 40 width 286.20: "Lorem ipsum dolor sit amet, consectetur "
chunk 1 (end anchor) text run 1 at (295.00,114.80) startOffset 0 endOffset 17 width 105.00: "adipisicing elit,"
@@ -1,30 +1,18 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (133,167) size 534x230
RenderSVGRoot {svg} at (0,167) size 800x230
RenderSVGContainer {g} at (0,0) size 0x0
RenderSVGContainer {g} at (133,167) size 534x230
RenderSVGContainer {g} at (525,167) size 142x30
RenderSVGText {text} at (315,100) size 79x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 105x18
chunk 1 text run 1 at (322.00,114.80) startOffset 0 endOffset 12 width 78.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646}"
chunk 1 text run 1 at (319.60,114.80) startOffset 0 endOffset 10 width 80.40 RTL: "\x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646}"
chunk 1 text run 1 at (350.80,114.80) startOffset 0 endOffset 6 width 49.20 RTL: "\x{643}\x{644} \x{647}\x{630}\x{647}"
chunk 1 text run 1 at (295.00,114.80) startOffset 0 endOffset 15 width 105.00 RTL: "\x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629}"
chunk 1 text run 1 at (315.40,114.80) startOffset 0 endOffset 11 width 84.60 RTL: "\x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"
RenderSVGContainer {g} at (329,267) size 142x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,60.00)}]
RenderSVGText {text} at (197,100) size 79x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 105x18
chunk 1 (middle anchor) text run 1 at (201.00,114.80) startOffset 0 endOffset 12 width 78.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646}"
chunk 1 (middle anchor) text run 1 at (199.80,114.80) startOffset 0 endOffset 10 width 80.40 RTL: "\x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646}"
chunk 1 (middle anchor) text run 1 at (215.40,114.80) startOffset 0 endOffset 6 width 49.20 RTL: "\x{643}\x{644} \x{647}\x{630}\x{647}"
chunk 1 (middle anchor) text run 1 at (187.50,114.80) startOffset 0 endOffset 15 width 105.00 RTL: "\x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629}"
chunk 1 (middle anchor) text run 1 at (197.70,114.80) startOffset 0 endOffset 11 width 84.60 RTL: "\x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"
RenderSVGContainer {g} at (133,367) size 142x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,120.00)}]
RenderSVGText {text} at (80,100) size 78x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 105x18
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 12 width 78.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646}"
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 10 width 80.40 RTL: "\x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646}"
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 6 width 49.20 RTL: "\x{643}\x{644} \x{647}\x{630}\x{647}"
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 15 width 105.00 RTL: "\x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629}"
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 11 width 84.60 RTL: "\x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"
RenderSVGContainer {g} at (0,167) size 800x230
RenderSVGContainer {g} at (0,167) size 667x30
RenderSVGText {text} at (-14,100) size 414x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 414x18
chunk 1 text run 1 at (-14.00,114.80) startOffset 0 endOffset 58 width 414.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646} \x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646} \x{643}\x{644} \x{647}\x{630}\x{647} \x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629} \x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"
RenderSVGContainer {g} at (55,267) size 690x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,60.00)}]
RenderSVGText {text} at (33,100) size 414x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 414x18
chunk 1 (middle anchor) text run 1 at (33.00,114.80) startOffset 0 endOffset 58 width 414.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646} \x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646} \x{643}\x{644} \x{647}\x{630}\x{647} \x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629} \x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"
RenderSVGContainer {g} at (133,367) size 667x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,120.00)}]
RenderSVGText {text} at (80,100) size 414x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 414x18
chunk 1 (end anchor) text run 1 at (80.00,114.80) startOffset 0 endOffset 58 width 414.00 RTL: "\x{644}\x{643}\x{646} \x{644}\x{627} \x{628}\x{62F} \x{623}\x{646} \x{623}\x{648}\x{636}\x{62D} \x{644}\x{643} \x{623}\x{646} \x{643}\x{644} \x{647}\x{630}\x{647} \x{627}\x{644}\x{623}\x{641}\x{643}\x{627}\x{631}\x{627}\x{644}\x{645}\x{63A}\x{644}\x{648}\x{637}\x{629} \x{62D}\x{648}\x{644} \x{627}\x{633}\x{62A}\x{646}\x{643}\x{627}\x{631}"

0 comments on commit f898064

Please sign in to comment.