[LFC][Floating] Decouple the incoming floats and floats already placed in the list
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 15:12:24 +0000 (15:12 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 15:12:24 +0000 (15:12 +0000)
commita394310fad3b272ddda59c8f930da3ed1bcdd056
tree2c7d6cfcdfde7fba89a55c8d4175239e449fd357
parent9bbca3f0933c213eee71c203fefcf1b69374e6df
[LFC][Floating] Decouple the incoming floats and floats already placed in the list
https://bugs.webkit.org/show_bug.cgi?id=188886

Reviewed by Antti Koivisto.

This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.

1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
2. Use the existing FloatState::FloatItem class for placed floats.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutUnits.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/displaytree/DisplayBox.h:
* layout/floats/FloatBox.cpp: Added.
(WebCore::Layout::FloatBox::FloatBox):
(WebCore::Layout::FloatBox::initializePosition):
(WebCore::Layout::FloatBox::isLeftAligned const):
(WebCore::Layout::FloatBox::setLeft):
(WebCore::Layout::FloatBox::setTopLeft):
(WebCore::Layout::FloatBox::resetVertically):
(WebCore::Layout::FloatBox::resetHorizontally):
(WebCore::Layout::FloatBox::topLeftInContainingBlock const):
* layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
(WebCore::Layout::FloatBox::top const):
(WebCore::Layout::FloatBox::left const):
(WebCore::Layout::FloatBox::marginTop const):
(WebCore::Layout::FloatBox::marginLeft const):
(WebCore::Layout::FloatBox::marginBottom const):
(WebCore::Layout::FloatBox::marginRight const):
(WebCore::Layout::FloatBox::rectWithMargin const):
(WebCore::Layout::FloatBox::setTop):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::verticalPosition const):
(WebCore::Layout::begin):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::horiztonalPosition const):
(WebCore::Layout::FloatingPair::bottom const):
(WebCore::Layout::Iterator::Iterator):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
(WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
(WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
(WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
(WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::root const):
(WebCore::Layout::FloatingState::layoutContext const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/layout/LayoutUnits.h
Source/WebCore/layout/displaytree/DisplayBox.h
Source/WebCore/layout/floats/FloatBox.cpp [new file with mode: 0644]
Source/WebCore/layout/floats/FloatBox.h [new file with mode: 0644]
Source/WebCore/layout/floats/FloatingContext.cpp
Source/WebCore/layout/floats/FloatingContext.h
Source/WebCore/layout/floats/FloatingState.h