[LFC] LayoutState should always be initialized with the initial containing block.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2018 23:25:13 +0000 (23:25 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2018 23:25:13 +0000 (23:25 +0000)
commit8d52e71a1120443fb8da5c380f69ec6c08cf97c0
tree4a1b3d973b4a417ef4c3df76cc5cbbfe57762931
parent352df25793df0a717afe71c0647c25d881a46a9a
[LFC] LayoutState should always be initialized with the initial containing block.
https://bugs.webkit.org/show_bug.cgi?id=191896

Reviewed by Antti Koivisto.

There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
first need to be laid out (partially at least e.g margin) in their parent formatting context.
Having a non-null parent formatting context as root could lead to undefined behaviour.

* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::initializeRoot): Deleted.
* layout/LayoutFormattingState.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/layout/LayoutFormattingState.cpp
Source/WebCore/layout/LayoutFormattingState.h
Source/WebCore/layout/Verification.cpp
Source/WebCore/page/FrameViewLayoutContext.cpp