| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |