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)
commitfe520bec2e04a39cf6d7ac871894bc0d54b4dcfc
treea67ce7d460d31b4047497a6bffbfae24feb73bb2
parent5b83ebf37318d3603b95f10451a5f3018357209e
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: http://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