With word-break: break-all, words do not break correctly before a surrogate pair
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jun 2011 16:09:33 +0000 (16:09 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jun 2011 16:09:33 +0000 (16:09 +0000)
commitfe8d85d7d2109777b9bcbef91057fa6332f317f5
treea67ce7d460d31b4047497a6bffbfae24feb73bb2
parent4201f20b295d91dece2b99f45a9c68079a25fd50
With word-break: break-all, words do not break correctly before a surrogate pair
https://bugs.webkit.org/show_bug.cgi?id=63401

Reviewed by Darin Adler.

Source/WebCore:

The code to check for mid-word breaks accumulates width one character at a time. It was actually
measuring the two parts of the surrogate pair individually, so they appeared to have zero width.
Fixed by checking for surrogate pairs and measuring the pair as one unit.

Test: fast/text/midword-break-before-surrogate-pair.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak):

LayoutTests:

* fast/text/midword-break-before-surrogate-pair.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/midword-break-before-surrogate-pair.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp