[LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 15:19:49 +0000 (15:19 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 15:19:49 +0000 (15:19 +0000)
commit9419893127923f351496d6ab33433afbdcfcdb8f
tree18ee97d0c3385b860eba459058771180377ed7c0
parent1652fab9db63b862598ea667ea46da880b1f74b4
[LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
https://bugs.webkit.org/show_bug.cgi?id=186052

Reviewed by Antti Koivisto.

With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
* layout/LayoutContext.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation
* layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
(WebCore::Display::Box::Style::Style):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Rect::operator LayoutRect const):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setHasValidMargin):
(WebCore::Display::Box::setHasValidBorder):
(WebCore::Display::Box::setHasValidPadding):
(WebCore::Display::Box::Rect::setHasValidPosition):
(WebCore::Display::Box::Rect::setHasValidSize):
(WebCore::Display::Box::Rect::setSize):
(WebCore::Display::Box::Rect::clone const):
(WebCore::Display::Box::setMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):
(WebCore::Display::Box::Rect::Rect): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/layout/LayoutContext.cpp
Source/WebCore/layout/LayoutContext.h
Source/WebCore/layout/Verification.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/displaytree/DisplayBox.cpp
Source/WebCore/layout/displaytree/DisplayBox.h