[LFC] Add assertions for stale Display::Box geometry
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2018 02:09:16 +0000 (02:09 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2018 02:09:16 +0000 (02:09 +0000)
commit4535916dba01293cc46b1f750a2d19f6664adda6
tree80c96ed51cd969a6a01806fc81c64162ae4e4f2c
parent7ed2f63f7f7acffade0dc05673767a350794c930
[LFC] Add assertions for stale Display::Box geometry
https://bugs.webkit.org/show_bug.cgi?id=185357

Reviewed by Antti Koivisto.

Ensure that we don't access stale geometry of other boxes during layout.
For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)

* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::invalidateTop):
(WebCore::Display::Box::invalidateLeft):
(WebCore::Display::Box::invalidateWidth):
(WebCore::Display::Box::invalidateHeight):
(WebCore::Display::Box::hasValidPosition const):
(WebCore::Display::Box::hasValidSize const):
(WebCore::Display::Box::hasValidGeometry const):
(WebCore::Display::Box::invalidatePosition):
(WebCore::Display::Box::invalidateSize):
(WebCore::Display::Box::setHasValidPosition):
(WebCore::Display::Box::setHasValidSize):
(WebCore::Display::Box::setHasValidGeometry):
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::setRect):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):

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