https://bugs.webkit.org/show_bug.cgi?id=68922
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 20:39:57 +0000 (20:39 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 20:39:57 +0000 (20:39 +0000)
commit5950bd4280be41dcc5b5f034456df3f5cab6093b
tree6b827b49419dc59d65a27ffc04d41c1fd22afd27
parenta1f1ea30438703171139e596291fd622a2046e9d
https://bugs.webkit.org/show_bug.cgi?id=68922

Source/WebCore:

Paginated floats should not grow the height of a block when they don't end
up being tied to a line. Floats encountered in skipLeadingWhitespace that
paginate can't immediately grow the height of the block, since there may not
end up being any actual line content. We only want to push the height of the
block down if we have actual line content that we want to keep with the
float.

Make positionNewFloatOnLine check if the line is empty or not, and if it is,
it just puts the desired pagination strut into LineInfo. If and when actual
line content is encountered and setEmpty becomes false, we'll grow the block
height then.

Reviewed by Dan Bernstein.

Added fast/multicol/float-paginate-empty-lines.html and
fast/regions/webkit-flow-double-pagination-float-push.html.

* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::LineWidth):
(WebCore::LineWidth::fitsOnLine):
(WebCore::LineWidth::currentWidth):
(WebCore::LineWidth::uncommittedWidth):
(WebCore::LineWidth::committedWidth):
(WebCore::LineWidth::availableWidth):
(WebCore::LineWidth::addUncommittedWidth):
(WebCore::LineWidth::commit):
(WebCore::LineWidth::computeAvailableWidthFromLeftAndRight):
(WebCore::LineWidth::updateAvailableWidth):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
(WebCore::LineWidth::applyOverhang):
(WebCore::LineWidth::fitBelowFloats):
(WebCore::LineInfo::LineInfo):
(WebCore::LineInfo::floatPaginationStrut):
(WebCore::LineInfo::setEmpty):
(WebCore::LineInfo::setFloatPaginationStrut):
(WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
(WebCore::RenderBlock::LineBreaker::nextLineBreak):
(WebCore::RenderBlock::positionNewFloatOnLine):

LayoutTests:

Paginated floats should not grow the height of a block when they don't end
up being tied to a line.

Reviewed by Dan Bernstein.

* fast/multicol/float-paginate-empty-lines.html: Added.
* fast/regions/webkit-flow-double-pagination-float-push.html: Added.
* platform/mac/fast/multicol/float-paginate-empty-lines-expected.png: Added.
* platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.png: Added.
* platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/multicol/float-paginate-empty-lines.html [new file with mode: 0644]
LayoutTests/fast/regions/webkit-flow-double-pagination-float-push.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/float-paginate-empty-lines-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp