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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after
4098 4098
4099 if (style()->hasBorderImageOutsets()) { 4099 if (style()->hasBorderImageOutsets()) {
4100 LayoutRectOutsets borderOutsets = style()->borderImageOutsets(); 4100 LayoutRectOutsets borderOutsets = style()->borderImageOutsets();
4101 top = std::max(top, borderOutsets.top()); 4101 top = std::max(top, borderOutsets.top());
4102 right = std::max(right, borderOutsets.right()); 4102 right = std::max(right, borderOutsets.right());
4103 bottom = std::max(bottom, borderOutsets.bottom()); 4103 bottom = std::max(bottom, borderOutsets.bottom());
4104 left = std::max(left, borderOutsets.left()); 4104 left = std::max(left, borderOutsets.left());
4105 } 4105 }
4106 4106
4107 if (style()->hasOutline()) { 4107 if (style()->hasOutline()) {
4108 Vector<LayoutRect> outlineRects;
4109 // The result rects are in coordinates of this object's border box.
4110 addOutlineRects(outlineRects, LayoutPoint());
4111 LayoutRect rect = unionRect(outlineRects);
4108 int outlineOutset = style()->outlineOutsetExtent(); 4112 int outlineOutset = style()->outlineOutsetExtent();
4109 if (style()->outlineStyleIsAuto()) { 4113 top = std::max(top, -rect.y() + outlineOutset);
4110 // The result focus ring rects are in coordinates of this object's b order box. 4114 right = std::max(right, rect.maxX() - size().width() + outlineOutset);
4111 Vector<LayoutRect> focusRingRects; 4115 bottom = std::max(bottom, rect.maxY() - size().height() + outlineOutset) ;
4112 addOutlineRects(focusRingRects, LayoutPoint()); 4116 left = std::max(left, -rect.x() + outlineOutset);
4113 LayoutRect rect = unionRect(focusRingRects);
4114
4115 top = std::max(top, -rect.y() + outlineOutset);
4116 right = std::max(right, rect.maxX() - size().width() + outlineOutset );
4117 bottom = std::max(bottom, rect.maxY() - size().height() + outlineOut set);
4118 left = std::max(left, -rect.x() + outlineOutset);
4119 } else {
4120 top = std::max<LayoutUnit>(top, outlineOutset);
4121 right = std::max<LayoutUnit>(right, outlineOutset);
4122 bottom = std::max<LayoutUnit>(bottom, outlineOutset);
4123 left = std::max<LayoutUnit>(left, outlineOutset);
4124 }
4125 } 4117 }
4126 4118
4127 return LayoutRectOutsets(top, right, bottom, left); 4119 return LayoutRectOutsets(top, right, bottom, left);
4128 } 4120 }
4129 4121
4130 void LayoutBox::addOverflowFromChild(LayoutBox* child, const LayoutSize& delta) 4122 void LayoutBox::addOverflowFromChild(LayoutBox* child, const LayoutSize& delta)
4131 { 4123 {
4132 // Never allow flow threads to propagate overflow up to a parent. 4124 // Never allow flow threads to propagate overflow up to a parent.
4133 if (child->isLayoutFlowThread()) 4125 if (child->isLayoutFlowThread())
4134 return; 4126 return;
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
4733 StyleImage* borderImage = style()->borderImage().image(); 4725 StyleImage* borderImage = style()->borderImage().image();
4734 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4726 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4735 } 4727 }
4736 4728
4737 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const 4729 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const
4738 { 4730 {
4739 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; 4731 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr;
4740 } 4732 }
4741 4733
4742 } // namespace blink 4734 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698