When we set word-wrap: break-word and xml:space="preserve" to svg text element, the...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2013 14:32:54 +0000 (14:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2013 14:32:54 +0000 (14:32 +0000)
commitfa37cdd43e8d6cc2a01e198a814001eda8108890
treeaf451a900edf582a63afa027aa725e8c845ace5f
parent77acbd6a6d235030cedb9cfdc4bcadb047b3ea2c
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

Patch by Yuki Sekiguchi <yuki.sekiguchi@access-company.com> on 2013-03-08
Reviewed by Stephen Chenney.

Source/WebCore:

RenderSVGText define its size when it laid out its first line at SVGRootInlineBox::computePerCharacterLayoutInformation().

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.
However, when we set word-wrap: break-word and xml:space="preserve" to svg text element, RenderBlock::LineBreaker::nextLineBreak() breaks the text.
This make single character lines and make RenderSVGText narrow.

We must ignore word-wrap property to make the text a single line.

We always disable break words and break all in nextLineBreak() when the object is SVGInlineText.

Test: svg/text/preserve-break-word.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextSegmentBreak): Disable break words and break all when we process SVG Text.

LayoutTests:

Test combination of xml:space="preserve" and word-wrap: break-word to SVG Text.
These text should not be collapsed.

* svg/text/preserve-break-word-expected.html: Added.
* svg/text/preserve-break-word.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/text/preserve-break-word-expected.html [new file with mode: 0644]
LayoutTests/svg/text/preserve-break-word.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp