Unexpected word wrapping for wrapped content then raw content.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2013 12:47:52 +0000 (12:47 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2013 12:47:52 +0000 (12:47 +0000)
commitcb240de6cbe865eb02139c173aed72b9e1584893
tree7cadc6c9bc418c24f6c417a2e18b8e500ba02b0b
parentb93214501ab8b39cd02fb777a914ca7841b18dcd
Unexpected word wrapping for wrapped content then raw content.
https://bugs.webkit.org/show_bug.cgi?id=121130

Reviewed by Darin Adler.

When deciding whether a line is considered empty, we need to check if the current
object is fully responsible for the currently uncommitted width. It helps differentiating
<span></span><span>abcd</span> from <span>a</span><span>bcd</span>, where in the first
case when we hit the second <span> the line is still considered empty, as opposed to the
second example.
This patch introduces a map to keep track of the uncommitted widths.

Source/WebCore:

Test: fast/css/unexpected-word-wrapping-with-non-empty-spans.html

* rendering/LineWidth.cpp:
(WebCore::LineWidth::uncommittedWidthForObject):
(WebCore::LineWidth::addUncommittedWidth):
* rendering/LineWidth.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineBreaker::nextSegmentBreak):

LayoutTests:

* fast/css/unexpected-word-wrapping-with-non-empty-spans-expected.html: Added.
* fast/css/unexpected-word-wrapping-with-non-empty-spans.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/unexpected-word-wrapping-with-non-empty-spans-expected.html [new file with mode: 0644]
LayoutTests/fast/css/unexpected-word-wrapping-with-non-empty-spans.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/LineWidth.cpp
Source/WebCore/rendering/LineWidth.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp