Crash when flowing a fixed positioned element into a region.
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 14:31:19 +0000 (14:31 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 14:31:19 +0000 (14:31 +0000)
commit00e803787c9ee2158538e6f9a4ee3b57592573ce
treea313132a317894c2e012fcadc7c3f8b685963dd6
parent1d43ae4815fca705e9a46dd61f6807ae867cb408
Crash when flowing a fixed positioned element into a region.
https://bugs.webkit.org/show_bug.cgi?id=88133

Reviewed by Julien Chaffraix and Abhishek Arya.

Source/WebCore:

When a fixed positioned element is collected into a named flow, we have to make sure
that such element has the RenderFlowThread as containing block instead of RenderView,
so that the fixed positioned element is laid out properly.
Making the RenderFlowThread the top most containing block for named flow elements required the
modification of RenderLayer::convertToLayerCoords so that the fixed positioned elements inside the
named flow take the same code path as the absolute positioned elements inside the named flow.
I also added a method, checkBlockPositionedObjectsNeedLayout, in order to verify that a block
that is ending its layout, setNeedsLayout(false), has all the positioned children laid out.
This way, we will hit an assertion if an out-of-flow positioned child inside a RenderFlowThread
is not laid out after the RenderFlowThread is laid out.

Tests: fast/regions/absolute-pos-elem-in-named-flow.html
       fast/regions/absolute-pos-elem-in-region.html
       fast/regions/fixed-pos-elem-in-named-flow.html
       fast/regions/fixed-pos-elem-in-named-flow2.html
       fast/regions/fixed-pos-elem-in-region.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::convertToLayerCoords):
* rendering/RenderObject.cpp:
(WebCore):
(WebCore::RenderObject::checkBlockPositionedObjectsNeedLayout):
(WebCore::RenderObject::containingBlock):
(WebCore::RenderObject::container):
* rendering/RenderObject.h:
(RenderObject):
(WebCore::RenderObject::setNeedsLayout):

LayoutTests:

When a fixed positioned element is collected into a named flow, we have to make sure
that such element has the RenderFlowThread as containing block instead of RenderView,
so that the fixed positioned element is laid out properly.

* fast/regions/absolute-pos-elem-in-named-flow-expected.txt: Added.
* fast/regions/absolute-pos-elem-in-named-flow.html: Added.
* fast/regions/absolute-pos-elem-in-region-expected.html: Added.
* fast/regions/absolute-pos-elem-in-region.html: Added.
* fast/regions/fixed-pos-elem-in-named-flow-expected.txt: Added.
* fast/regions/fixed-pos-elem-in-named-flow.html: Added.
* fast/regions/fixed-pos-elem-in-named-flow2-expected.txt: Added.
* fast/regions/fixed-pos-elem-in-named-flow2.html: Added.
* fast/regions/fixed-pos-elem-in-region-expected.html: Added.
* fast/regions/fixed-pos-elem-in-region.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/absolute-pos-elem-in-named-flow-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/absolute-pos-elem-in-named-flow.html [new file with mode: 0644]
LayoutTests/fast/regions/absolute-pos-elem-in-region-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/absolute-pos-elem-in-region.html [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-named-flow-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-named-flow.html [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-named-flow2-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-named-flow2.html [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-region-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/fixed-pos-elem-in-region.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h