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

Side by Side Diff: Source/WebCore/rendering/RenderLayer.cpp

Issue 10908086: Merge 127520 - REGRESSION(r120832): RenderLayer::clampScrollOffset doesn't properly clamp (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 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 unified diff | Download patch
« no previous file with comments | « ManualTests/select-menu-list-wrongly-positioned.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 } 1618 }
1619 1619
1620 IntSize RenderLayer::clampScrollOffset(const IntSize& scrollOffset) const 1620 IntSize RenderLayer::clampScrollOffset(const IntSize& scrollOffset) const
1621 { 1621 {
1622 RenderBox* box = renderBox(); 1622 RenderBox* box = renderBox();
1623 ASSERT(box); 1623 ASSERT(box);
1624 1624
1625 int maxX = scrollWidth() - box->pixelSnappedClientWidth(); 1625 int maxX = scrollWidth() - box->pixelSnappedClientWidth();
1626 int maxY = scrollHeight() - box->pixelSnappedClientHeight(); 1626 int maxY = scrollHeight() - box->pixelSnappedClientHeight();
1627 1627
1628 int x = min(max(scrollOffset.width(), 0), maxX); 1628 int x = max(min(scrollOffset.width(), maxX), 0);
1629 int y = min(max(scrollOffset.height(), 0), maxY); 1629 int y = max(min(scrollOffset.height(), maxY), 0);
1630 return IntSize(x, y); 1630 return IntSize(x, y);
1631 } 1631 }
1632 1632
1633 void RenderLayer::scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClampi ng clamp) 1633 void RenderLayer::scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClampi ng clamp)
1634 { 1634 {
1635 IntSize newScrollOffset = clamp == ScrollOffsetClamped ? clampScrollOffset(s crollOffset) : scrollOffset; 1635 IntSize newScrollOffset = clamp == ScrollOffsetClamped ? clampScrollOffset(s crollOffset) : scrollOffset;
1636 if (newScrollOffset != this->scrollOffset()) 1636 if (newScrollOffset != this->scrollOffset())
1637 scrollToOffsetWithoutAnimation(toPoint(newScrollOffset)); 1637 scrollToOffsetWithoutAnimation(toPoint(newScrollOffset));
1638 } 1638 }
1639 1639
(...skipping 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after
5123 } 5123 }
5124 } 5124 }
5125 5125
5126 void showLayerTree(const WebCore::RenderObject* renderer) 5126 void showLayerTree(const WebCore::RenderObject* renderer)
5127 { 5127 {
5128 if (!renderer) 5128 if (!renderer)
5129 return; 5129 return;
5130 showLayerTree(renderer->enclosingLayer()); 5130 showLayerTree(renderer->enclosingLayer());
5131 } 5131 }
5132 #endif 5132 #endif
OLDNEW
« no previous file with comments | « ManualTests/select-menu-list-wrongly-positioned.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698