Commit dad83b38 authored by mitz@apple.com's avatar mitz@apple.com

Source/WebCore: REGRESSION: Soft hyphen is not always rendered

https://bugs.webkit.org/show_bug.cgi?id=56017
        
Patch by David Sosby <dsosby@rim.com> on 2011-03-13
Reviewed by Dan Bernstein.

The check to flag a text block as hyphenated was only
occurring at break points in the line. If no break points
were found after the soft hyphen then the line would not
be flagged hyphenated. Adding a check for soft hyphen at
the end of the text run resolves the issue.

Test: fast/text/soft-hyphen-4.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::findNextLineBreak):

LayoutTests: Reviewed and tweaked by Dan Bernstein.

Patch by David Sosby <dsosby@rim.com> on 2011-03-13
REGRESSION: Soft hyphen is not always rendered
https://bugs.webkit.org/show_bug.cgi?id=56017
        
Adding new test that verifies soft hyphen is rendered
when it is the last breakable point in a line.

* fast/text/soft-hyphen-4-expected.checksum: Added.
* fast/text/soft-hyphen-4-expected.png: Added.
* fast/text/soft-hyphen-4-expected.txt: Added.
* fast/text/soft-hyphen-4.html: Added.



git-svn-id: svn://svn.chromium.org/blink/trunk@80984 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7c696820
2011-03-13 David Sosby <dsosby@rim.com>
Reviewed and tweaked by Dan Bernstein.
REGRESSION: Soft hyphen is not always rendered
https://bugs.webkit.org/show_bug.cgi?id=56017
Adding new test that verifies soft hyphen is rendered
when it is the last breakable point in a line.
* fast/text/soft-hyphen-4-expected.checksum: Added.
* fast/text/soft-hyphen-4-expected.png: Added.
* fast/text/soft-hyphen-4-expected.txt: Added.
* fast/text/soft-hyphen-4.html: Added.
2011-03-13 David Levin <levin@chromium.org> 2011-03-13 David Levin <levin@chromium.org>
Update some baselines due to r80868. Update some baselines due to r80868.
80450a5e533780e88f2317a56df11bbd
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x0
RenderBlock {DIV} at (0,0) size 344x104 [border: (3px solid #000000)]
RenderText {#text} at (7,7) size 330x36
text run at (7,7) width 330: "12345678901 anti\x{AD}"
text run at (7,25) width 144: "aliasing"
RenderBR {BR} at (151,39) size 0x0
RenderBR {BR} at (7,43) size 0x18
RenderText {#text} at (7,61) size 330x36
text run at (7,61) width 330: "12345678901 anti\x{AD}"
text run at (7,79) width 144: "aliasing"
RenderText {#text} at (0,0) size 0x0
RenderBlock {P} at (0,120) size 784x0
<html>
<head>
<style>
.testbox {
border: solid;
padding: 4px;
width: 330px;
font: 18px ahem;
text-align: justify;
-webkit-font-smoothing: none;
}
</style>
</head>
<body>
<p>
<!--In this test, the top-right boxes should be the same length-->
<div class="testbox">
12345678901 anti&shy;aliasing<br> <!--broken (no space after aliasing)-->
<br>
12345678901 anti&shy;aliasing <!--works (space after aliasing)-->
</div>
</p>
</body>
</html>
2011-03-13 David Sosby <dsosby@rim.com>
Reviewed by Dan Bernstein.
REGRESSION: Soft hyphen is not always rendered
https://bugs.webkit.org/show_bug.cgi?id=56017
The check to flag a text block as hyphenated was only
occurring at break points in the line. If no break points
were found after the soft hyphen then the line would not
be flagged hyphenated. Adding a check for soft hyphen at
the end of the text run resolves the issue.
Test: fast/text/soft-hyphen-4.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::findNextLineBreak):
2011-03-13 Dan Bernstein <mitz@apple.com> 2011-03-13 Dan Bernstein <mitz@apple.com>
Reviewed by Mark Rowe. Reviewed by Mark Rowe.
......
...@@ -1946,8 +1946,13 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool ...@@ -1946,8 +1946,13 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
tmpW += additionalTmpW; tmpW += additionalTmpW;
tmpW += inlineLogicalWidth(o, !appliedStartWidth, true); tmpW += inlineLogicalWidth(o, !appliedStartWidth, true);
if (canHyphenate && w + tmpW > width) { if (w + tmpW > width) {
if (canHyphenate)
tryHyphenating(t, f, style->locale(), style->hyphenationLimitBefore(), style->hyphenationLimitAfter(), lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated); tryHyphenating(t, f, style->locale(), style->hyphenationLimitBefore(), style->hyphenationLimitAfter(), lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated);
if (!hyphenated && lBreak.obj && lBreak.pos && lBreak.obj->isText() && toRenderText(lBreak.obj)->textLength() && toRenderText(lBreak.obj)->characters()[lBreak.pos - 1] == softHyphen && style->hyphens() != HyphensNone)
hyphenated = true;
if (hyphenated) if (hyphenated)
goto end; goto end;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment