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

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

Issue 2249853007: "Inline" auto-positioned out-of-flow objects are affected by pagination struts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 c6214833bd25037fd853e2d1d382ab4a323a9e61..6fbb5add9ed7578db1685cbe1a2846776f04e3ef 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -873,6 +873,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
}
ASSERT(endOfLine != resolver.position());
+ RootInlineBox* lineBox = nullptr;
// This is a short-cut for empty lines.
if (layoutState.lineInfo().isEmpty()) {
@@ -901,7 +902,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
// inline flow boxes.
LayoutUnit oldLogicalHeight = logicalHeight();
- RootInlineBox* lineBox = createLineBoxesFromBidiRuns(resolver.status().context->level(), bidiRuns, endOfLine, layoutState.lineInfo(), verticalPositionCache, trailingSpaceRun, wordMeasurements);
+ lineBox = createLineBoxesFromBidiRuns(resolver.status().context->level(), bidiRuns, endOfLine, layoutState.lineInfo(), verticalPositionCache, trailingSpaceRun, wordMeasurements);
bidiRuns.deleteRuns();
resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced by an ASSERT (or just removed).
@@ -946,8 +947,17 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
}
if (!paginationStrutFromDeletedLine) {
- for (size_t i = 0; i < lineBreaker.positionedObjects().size(); ++i)
- setStaticPositions(LineLayoutBlockFlow(this), LineLayoutBox(lineBreaker.positionedObjects()[i]), DoNotIndentText);
+ for (const auto& positionedObject : lineBreaker.positionedObjects()) {
+ if (positionedObject.style()->isOriginalDisplayInlineType()) {
+ // Auto-positioend "inline" out-of-flow objects have already been positioned,
+ // but if we're paginated, we need to update their position now, since the line
+ // they "belong" to may have been pushed by a pagination strut.
+ if (paginated && lineBox)
+ positionedObject.layer()->setStaticBlockPosition(lineBox->lineTopWithLeading());
+ continue;
+ }
+ setStaticPositions(LineLayoutBlockFlow(this), positionedObject, DoNotIndentText);
+ }
if (!layoutState.lineInfo().isEmpty())
layoutState.lineInfo().setFirstLine(false);

Powered by Google App Engine
This is Rietveld 408576698