RenderObject::flowThreadState should follow containing block instead of parent.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2016 03:08:52 +0000 (03:08 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2016 03:08:52 +0000 (03:08 +0000)
commitcb087471a41a63cce46337e8f7a70eddd8424607
tree8833841cf5966c96484927bb8fb0c6735a3d729a
parenta03ada0b053f12766485fd141cb631e1a314d901
RenderObject::flowThreadState should follow containing block instead of parent.
https://bugs.webkit.org/show_bug.cgi?id=164629

Reviewed by Simon Fraser.

Currently every descendant of a region/multicolumn container is considered to be part of the
flowthread including out-of-flow renderers. They all have the InsideFlowThread flag set.
However since out-of-flow renderers are not really part of the flowthread layout context,
whenever the layout code actually checks for their flowthread containers, we return nullptr and
try to handle this seemingly defective state gracefully (that is, flag indicates "inside the flow thread" state,
but there's no flow tread container).

This patch fixes this confused state by setting the RenderObject::flowThreadState flag based on
the containing block's state instead of the parent's.

Not testable, since we seem to manage out-of-flow elements just fine even
when they have the InsideFlowThread flag set.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::adjustFlowThreadStateIncludingDescendants): This is an iterative DFS pre-order traversal so
we set the flow state first on containers.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFlowThreadState):
(WebCore::RenderObject::initializeFlowThreadStateOnInsertion):
* rendering/RenderObject.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h