Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=90646
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 19:14:25 +0000 (19:14 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 19:14:25 +0000 (19:14 +0000)
commit26c56e48c9c2463e84f48d6831cf9bb7ed7b8f2e
tree009982e22fbbfd9f7dcf71c755a004961a8ef7f1
parent33044a928468db2ff3076245fb0ef68eaae7bcf7
Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=90646
<rdar://problem/11648478> 3-pass pagination slows down pagination

Improve the logical top estimate function for margin collapsing to be more accurate. In particular
make the basic case of <body><p> or <body><h1> no longer be wrong. This estimate being incorrect
is not a big deal most of the time, but when paginating it is a very big deal, since you have to
relayout everything whenever your vertical placement is wrong.

Improving the estimation exposed a bug in an existing layout test. I had to clean up the buggy
code written for negative margin-related float detection and fix an invalid layout test to
actually be correct.

Reviewed by Simon Fraser.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::marginBeforeEstimateForChild):
(WebCore):
(WebCore::RenderBlock::estimateLogicalTopPosition):
(WebCore::RenderBlock::marginValuesForChild):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=90646

Fix invalid layout test exposed by my changes to logical top estimation.

Reviewed by Simon Fraser.

* fast/block/float/previous-sibling-float-002-expected.html:
* fast/block/float/previous-sibling-float-002.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/block/float/previous-sibling-float-002-expected.html
LayoutTests/fast/block/float/previous-sibling-float-002.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBox.cpp