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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 176953008: Include the outline into the visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed dumb bug caught by Mac. Created 6 years, 9 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/rendering/RenderBox.h ('k') | Source/core/rendering/RenderDetailsMarker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 4b2f02d7664c8d86ef8f37b545f5686bf08c7de8..422a2f69df755cdab90d153c2245ccb667aaaa3c 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -314,6 +314,10 @@ void RenderBox::layout()
ASSERT(!child->needsLayout());
child = child->nextSibling();
}
+
+ m_overflow.clear();
+ addVisualEffectOverflow();
+
statePusher.pop();
invalidateBackgroundObscurationStatus();
clearNeedsLayout();
@@ -1656,11 +1660,6 @@ bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
if (contentsVisualOverflow.isEmpty())
return false;
- // FIXME: Get rid of this slop from here and elsewhere.
- // Instead, properly include the outline in visual overflow.
- if (RenderView* view = this->view())
- contentsVisualOverflow.inflate(view->maximalOutlineSize());
-
LayoutRect conservativeClipRect = clipRect;
if (hasBorderRadius)
conservativeClipRect.intersect(clipRoundedRect.radiusCenterRect());
@@ -2010,15 +2009,6 @@ LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject
r.move(v->layoutDelta());
}
- if (style()) {
- // We have to use maximalOutlineSize() because a child might have an outline
- // that projects outside of our overflowRect.
- if (v) {
- ASSERT(style()->outlineSize() <= v->maximalOutlineSize());
- r.inflate(v->maximalOutlineSize());
- }
- }
-
computeRectForRepaint(repaintContainer, r);
return r;
}
@@ -4160,7 +4150,7 @@ void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
void RenderBox::addVisualEffectOverflow()
{
- if (!style()->boxShadow() && !style()->hasBorderImageOutsets())
+ if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()->hasOutline())
return;
bool isFlipped = style()->isFlippedBlocksWritingMode();
@@ -4199,7 +4189,16 @@ void RenderBox::addVisualEffectOverflow()
overflowMaxY = max(overflowMaxY, borderBox.maxY() + ((!isFlipped || !isHorizontal) ? borderOutsets.bottom() : borderOutsets.top()));
}
- // Add in the final overflow with shadows and outsets combined.
+ if (style()->hasOutline()) {
+ LayoutUnit outlineSize = style()->outlineSize();
+
+ overflowMinX = min(overflowMinX, borderBox.x() - outlineSize);
+ overflowMaxX = max(overflowMaxX, borderBox.maxX() + outlineSize);
+ overflowMinY = min(overflowMinY, borderBox.y() - outlineSize);
+ overflowMaxY = max(overflowMaxY, borderBox.maxY() + outlineSize);
+ }
+
+ // Add in the final overflow with shadows, outsets and outline combined.
LayoutRect visualEffectOverflow(overflowMinX, overflowMinY, overflowMaxX - overflowMinX, overflowMaxY - overflowMinY);
addVisualOverflow(visualEffectOverflow);
}
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderDetailsMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698