Patch by Xianzhu Wang <wangxianzhu@chromium.org> on 2011-09-13
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2011 16:44:15 +0000 (16:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2011 16:44:15 +0000 (16:44 +0000)
commitbd5613fbdb2949bee95cf84aa4d145389963ad21
tree73e67d576b7714ca5ed81f23ffdd375d22e996d9
parent2c107fe2453cdb338095f87a50cb1ec772a2262e
Patch by Xianzhu Wang <wangxianzhu@chromium.org> on 2011-09-13
Reviewed by Darin Adler.

Source/WebCore:

Webkit wraps between hyphen-minus and numeric characters
https://bugs.webkit.org/show_bug.cgi?id=20677

Disallow wrapping between a hyphen-minus and a digit if the hyphen-minus
is not directly after a digit or a letter.

Test: fast/text/line-breaks-after-hyphen-before-number.html

* rendering/break_lines.cpp:
(WebCore::asciiLineBreakTable): Disabled line-breaking after '-' and before '.', '0'-'9'. Note: the change for '0'-'9' doesn't really matter because the case is handled hard-coded in shouldBreakAfter().
(WebCore::shouldBreakAfter): Changed line-breaking behavior after '-'.
(WebCore::nextBreakablePosition): Passes lastLastCh to shouldBreakAfter.

LayoutTests:

Webkit wraps between hyphen-minus and numeric characters
https://bugs.webkit.org/show_bug.cgi?id=20677

Disallow wrapping between a hyphen-minus and a digit if the hyphen-minus
is not directly after a digit or a letter.

* fast/text/line-breaks-after-hyphen-before-number-expected.txt: Added.
* fast/text/line-breaks-after-hyphen-before-number.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/line-breaks-after-hyphen-before-number-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/line-breaks-after-hyphen-before-number.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/break_lines.cpp