Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1915803004: Remove LayoutFlowThread stuff from line layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: De-awesomeified the patch. We need this when not paginated too, since lineDelta may be non-zero. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index d04501abfbc1d46ae1278847fb2c8efbaef29a04..ec62c97eecfe87692ead5f08ab49bd496f63c7ef 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -23,7 +23,6 @@
#include "core/dom/AXObjectCache.h"
#include "core/layout/BidiRunForLine.h"
#include "core/layout/LayoutCounter.h"
-#include "core/layout/LayoutFlowThread.h"
#include "core/layout/LayoutListMarker.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutRubyRun.h"
@@ -1540,13 +1539,10 @@ static bool isInlineWithOutlineAndContinuation(const LayoutObject& o)
void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge)
{
- LayoutFlowThread* flowThread = flowThreadContainingBlock();
- bool clearLinesForPagination = firstLineBox() && flowThread && !flowThread->hasColumnSets();
-
// Figure out if we should clear out our line boxes.
// FIXME: Handle resize eventually!
- bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren || clearLinesForPagination;
- LineLayoutState layoutState(isFullLayout, paintInvalidationLogicalTop, paintInvalidationLogicalBottom, flowThread);
+ bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren;
+ LineLayoutState layoutState(isFullLayout, paintInvalidationLogicalTop, paintInvalidationLogicalBottom);
if (isFullLayout) {
// Ensure the old line boxes will be erased.
@@ -1805,35 +1801,31 @@ void LayoutBlockFlow::determineEndPosition(LineLayoutState& layoutState, RootInl
bool LayoutBlockFlow::checkPaginationAndFloatsAtEndLine(LineLayoutState& layoutState)
{
+ if (!m_floatingObjects || !layoutState.endLine())
+ return true;
+
LayoutUnit lineDelta = logicalHeight() - layoutState.endLineLogicalTop();
bool paginated = view()->layoutState() && view()->layoutState()->isPaginated();
- if (paginated && layoutState.flowThread()) {
+ if (paginated) {
// Check all lines from here to the end, and see if the hypothetical new position for the lines will result
// in a different available line width.
for (RootInlineBox* lineBox = layoutState.endLine(); lineBox; lineBox = lineBox->nextRootBox()) {
- if (paginated) {
- // This isn't the real move we're going to do, so don't update the line box's pagination
- // strut yet.
- LayoutUnit oldPaginationStrut = lineBox->paginationStrut();
- lineDelta -= oldPaginationStrut;
- adjustLinePositionForPagination(*lineBox, lineDelta);
- lineBox->setPaginationStrut(oldPaginationStrut);
- }
+ // This isn't the real move we're going to do, so don't update the line box's pagination
+ // strut yet.
+ LayoutUnit oldPaginationStrut = lineBox->paginationStrut();
+ lineDelta -= oldPaginationStrut;
+ adjustLinePositionForPagination(*lineBox, lineDelta);
+ lineBox->setPaginationStrut(oldPaginationStrut);
}
}
-
- if (!lineDelta || !m_floatingObjects)
+ if (!lineDelta)
return true;
// See if any floats end in the range along which we want to shift the lines vertically.
LayoutUnit logicalTop = std::min(logicalHeight(), layoutState.endLineLogicalTop());
- RootInlineBox* lastLine = layoutState.endLine();
- while (RootInlineBox* nextLine = lastLine->nextRootBox())
- lastLine = nextLine;
-
- LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue(lineDelta);
+ LayoutUnit logicalBottom = lastRootBox()->lineBottomWithLeading() + absoluteValue(lineDelta);
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
FloatingObjectSetIterator end = floatingObjectSet.end();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698