https://bugs.webkit.org/show_bug.cgi?id=57736
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 22:33:32 +0000 (22:33 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 22:33:32 +0000 (22:33 +0000)
commit946b3adb868c0ec525cd25965baaaa82f6d2e4ea
treee3389d926723ca87c9d526938757e650affb7d92
parent20f198ba0e90ad8140b3fc0d988b8d75b98b371e
https://bugs.webkit.org/show_bug.cgi?id=57736

Reviewed by Dan Bernstein.

Crash on openstreetmap.org while using the map. Fix a bad interaction between the positioned movement layout
optimization and the simplified layout optimization that could lead to blocks remaining marked as dirty when
layout finished. This would eventually lead to an inability to properly determine the correct layout root and
would cause a deleted root to be used later on.

Added fast/block/positioning/complex-positioned-movement.html.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::scheduleRelayoutOfSubtree):
Add asserts to catch cases in the future where a layout root is set that has a dirty containing block.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
Change simplified layout so that the positioned movement optimization no longer clears the other layout
flags. This will ensure that we still lay out our descendants if they need it.

(WebCore::RenderBlock::layoutPositionedObjects):
Changed to clear our layout flags now if the positioned movement is successful, since tryLayoutDoingPositionedMovementOnly
no longer does the clear.

* rendering/RenderBox.h:
(WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
tryLayoutDoingPositionedMovementOnly now returns a boolean indicating success or failure.  On success it no longer
does setNeedsLayout(false), but instead will let the caller take care of it. This way the caller can still look at
the other flags in case other kinds of layout are still needed.

* rendering/RenderObject.h:
(WebCore::RenderObject::setNeedsPositionedMovementLayout):
(WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout):
Changed these methods to only set their respective flags and not to try to be clever about avoiding propagation.

LayoutTests:

* fast/block/positioning/complex-positioned-movement.html: Added.
* platform/mac/fast/block/positioning/complex-positioned-movement-expected.checksum: Added.
* platform/mac/fast/block/positioning/complex-positioned-movement-expected.png: Added.
* platform/mac/fast/block/positioning/complex-positioned-movement-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/block/positioning/complex-positioned-movement.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/block/positioning/complex-positioned-movement-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/block/positioning/complex-positioned-movement-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/block/positioning/complex-positioned-movement-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderObject.h