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

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

Issue 492053002: Use LayoutRect during addFocusRingRects to avoid loss of precision (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline (pixel tests about focus rings. 1-pixel width diff at the edge because of different rounding) Created 6 years, 3 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/RenderInline.h » ('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 314199b1681c16e14f4087c4de03d0f749804f6e..17aa703819cf24f7c7c8e1243a468105ecb884c0 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -573,10 +573,10 @@ FloatQuad RenderBox::absoluteContentQuad() const
return localToAbsoluteQuad(FloatRect(rect));
}
-void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject*) const
+void RenderBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject*) const
{
if (!size().isEmpty())
- rects.append(pixelSnappedIntRect(additionalOffset, size()));
+ rects.append(LayoutRect(additionalOffset, size()));
}
bool RenderBox::canResize() const
@@ -4194,15 +4194,15 @@ LayoutBoxExtent RenderBox::computeVisualEffectOverflowExtent() const
if (style()->hasOutline()) {
if (style()->outlineStyleIsAuto()) {
// The result focus ring rects are in coordinates of this object's border box.
- Vector<IntRect> focusRingRects;
+ Vector<LayoutRect> focusRingRects;
addFocusRingRects(focusRingRects, LayoutPoint(), this);
- IntRect rect = unionRect(focusRingRects);
+ LayoutRect rect = unionRect(focusRingRects);
int outlineSize = GraphicsContext::focusRingOutsetExtent(style()->outlineOffset(), style()->outlineWidth());
- top = std::max<LayoutUnit>(top, -rect.y() + outlineSize);
- right = std::max<LayoutUnit>(right, rect.maxX() - width() + outlineSize);
- bottom = std::max<LayoutUnit>(bottom, rect.maxY() - height() + outlineSize);
- left = std::max<LayoutUnit>(left, -rect.x() + outlineSize);
+ top = std::max(top, -rect.y() + outlineSize);
+ right = std::max(right, rect.maxX() - width() + outlineSize);
+ bottom = std::max(bottom, rect.maxY() - height() + outlineSize);
+ left = std::max(left, -rect.x() + outlineSize);
} else {
LayoutUnit outlineSize = style()->outlineSize();
top = std::max(top, outlineSize);
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698