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

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

Issue 1278543002: Include the whole outline into visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
index 77c6656f3981fdf33291fa5d194d91a5ee82645a..9ccc684648b2101b27be4dabf5679df89e0ec2e4 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1492,6 +1492,11 @@ void LayoutBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
maxLogicalWidth = std::max(maxLogicalWidth, inlineMax);
}
+static bool isInlineWithOutlineAndContinuation(const LayoutObject& o)
+{
+ return o.isLayoutInline() && o.styleRef().hasOutline() && !o.isElementContinuation() && toLayoutInline(o).continuation();
+}
+
void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge)
{
LayoutFlowThread* flowThread = flowThreadContainingBlock();
@@ -1566,6 +1571,9 @@ void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& pa
dirtyLineBoxesForObject(o, layoutState.isFullLayout());
o->clearNeedsLayout();
}
+
+ if (isInlineWithOutlineAndContinuation(*o))
+ setContainsInlineWithOutlineAndContinuation(true);
}
for (size_t i = 0; i < replacedChildren.size(); i++)
@@ -1854,6 +1862,24 @@ void LayoutBlockFlow::addOverflowFromInlineChildren()
LayoutRect visualOverflow = curr->visualOverflowRect(curr->lineTop(), curr->lineBottom());
addContentsVisualOverflow(visualOverflow);
}
+
+ if (!containsInlineWithOutlineAndContinuation())
+ return;
+
+ // Add outline rects of continuations of descendant inlines into visual overflow of this block.
+ LayoutRect outlineBoundsOfAllContinuations;
+ for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
+ const LayoutObject& o = *walker.current();
+ if (!isInlineWithOutlineAndContinuation(o))
+ continue;
+
+ Vector<LayoutRect> outlineRects;
+ toLayoutInline(o).addOutlineRectsForContinuations(outlineRects, LayoutPoint());
+ LayoutRect outlineBounds = unionRect(outlineRects);
+ outlineBounds.inflate(o.styleRef().outlineOutsetExtent());
+ outlineBoundsOfAllContinuations.unite(outlineBounds);
+ }
+ addContentsVisualOverflow(outlineBoundsOfAllContinuations);
}
void LayoutBlockFlow::deleteEllipsisLineBoxes()
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698