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

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

Issue 1278543002: Include the whole outline into visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Avoid the global map 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
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index f95d524d4328c364decb733f671c2be211446934..a1841e63cddfbc190c8cf302596007f75bfe1bf6 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -4105,23 +4105,15 @@ LayoutRectOutsets LayoutBox::computeVisualEffectOverflowOutsets() const
}
if (style()->hasOutline()) {
+ Vector<LayoutRect> outlineRects;
+ // The result rects are in coordinates of this object's border box.
+ addOutlineRects(outlineRects, LayoutPoint());
+ LayoutRect rect = unionRect(outlineRects);
int outlineOutset = style()->outlineOutsetExtent();
- if (style()->outlineStyleIsAuto()) {
- // The result focus ring rects are in coordinates of this object's border box.
- Vector<LayoutRect> focusRingRects;
- addOutlineRects(focusRingRects, LayoutPoint());
- LayoutRect rect = unionRect(focusRingRects);
-
- top = std::max(top, -rect.y() + outlineOutset);
- right = std::max(right, rect.maxX() - size().width() + outlineOutset);
- bottom = std::max(bottom, rect.maxY() - size().height() + outlineOutset);
- left = std::max(left, -rect.x() + outlineOutset);
- } else {
- top = std::max<LayoutUnit>(top, outlineOutset);
- right = std::max<LayoutUnit>(right, outlineOutset);
- bottom = std::max<LayoutUnit>(bottom, outlineOutset);
- left = std::max<LayoutUnit>(left, outlineOutset);
- }
+ top = std::max(top, -rect.y() + outlineOutset);
+ right = std::max(right, rect.maxX() - size().width() + outlineOutset);
+ bottom = std::max(bottom, rect.maxY() - size().height() + outlineOutset);
+ left = std::max(left, -rect.x() + outlineOutset);
}
return LayoutRectOutsets(top, right, bottom, left);

Powered by Google App Engine
This is Rietveld 408576698