RESOLVED FIXED 111675
When we set word-wrap: break-word and xml:space="preserve" to svg text element, the text is collapsed.
https://bugs.webkit.org/show_bug.cgi?id=111675
Summary When we set word-wrap: break-word and xml:space="preserve" to svg text elemen...
Yuki Sekiguchi
Reported 2013-03-06 21:01:31 PST
Created attachment 191909 [details] reproduced html content In the attached content, the text "abc" is SVG text and it have xml:space="preserve" attribute and is specified word-wrap: break-word. The text is collapsed. In the following spec, SVG don't perform automatic line break or word wrapping. http://www.w3.org/TR/SVG/text.html#Introduction > SVG performs no automatic line breaking or word wrapping. Therefore, I think the collapsing is illegal. Firefox don't collapse the text.
Attachments
reproduced html content (325 bytes, text/html)
2013-03-06 21:01 PST, Yuki Sekiguchi
no flags
Patch (4.39 KB, patch)
2013-03-06 21:15 PST, Yuki Sekiguchi
no flags
Patch (4.77 KB, patch)
2013-03-07 20:31 PST, Yuki Sekiguchi
no flags
Yuki Sekiguchi
Comment 1 2013-03-06 21:15:48 PST
Stephen Chenney
Comment 2 2013-03-07 07:12:39 PST
Comment on attachment 191912 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=191912&action=review Mostly fine. I have one nit with the code and a request for greater testing. > Source/WebCore/rendering/RenderBlockLineLayout.cpp:2841 > + breakWords = breakAll = false; I believe that WebKit style dictates that this be two lines, with one assignment on each line. > LayoutTests/svg/text/preserve-break-word-expected.html:6 > +<text x="100" y="100" style="word-wrap: break-word">abcdef</text> Can you remove the style on the <text>? As I understand your patch, the SVG should appear the same as something with no word-wrap defined. > LayoutTests/svg/text/preserve-break-word.html:6 > +<text x="100" y="100" style="word-wrap: break-word"><tspan xml:space="preserve">abc</tspan>def</text> Could you please provide 3 <text> nodes? One with word-wrap: break word, one with xml:space="preserve" and one with both (the line you have already is the one with both).
Yuki Sekiguchi
Comment 3 2013-03-07 20:31:33 PST
Yuki Sekiguchi
Comment 4 2013-03-07 20:42:42 PST
Hi Stephen, Thank you for reviewing. (In reply to comment #2) > > Source/WebCore/rendering/RenderBlockLineLayout.cpp:2841 > > + breakWords = breakAll = false; > > I believe that WebKit style dictates that this be two lines, with one assignment on each line. OK. I understand it. > > LayoutTests/svg/text/preserve-break-word-expected.html:6 > > +<text x="100" y="100" style="word-wrap: break-word">abcdef</text> > > Can you remove the style on the <text>? As I understand your patch, the SVG should appear the same as something with no word-wrap defined. Sorry. You are right. Fixed. > > LayoutTests/svg/text/preserve-break-word.html:6 > > +<text x="100" y="100" style="word-wrap: break-word"><tspan xml:space="preserve">abc</tspan>def</text> > > Could you please provide 3 <text> nodes? One with word-wrap: break word, one with xml:space="preserve" and one with both (the line you have already is the one with both). Added test case.
Stephen Chenney
Comment 5 2013-03-08 06:28:06 PST
Looks good. R=me.
WebKit Review Bot
Comment 6 2013-03-08 06:35:04 PST
Comment on attachment 192137 [details] Patch Clearing flags on attachment: 192137 Committed r145215: <http://trac.webkit.org/changeset/145215>
WebKit Review Bot
Comment 7 2013-03-08 06:35:07 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.