| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 } | 472 } |
| 473 | 473 |
| 474 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const { | 474 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const { |
| 475 return toIntSize(-scrollOrigin()); | 475 return toIntSize(-scrollOrigin()); |
| 476 } | 476 } |
| 477 | 477 |
| 478 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { | 478 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { |
| 479 IntSize contentSize; | 479 IntSize contentSize; |
| 480 IntSize visibleSize; | 480 IntSize visibleSize; |
| 481 if (box().hasOverflowClip()) { | 481 if (box().hasOverflowClip()) { |
| 482 contentSize = | 482 contentSize = contentsSize(); |
| 483 IntSize(pixelSnappedScrollWidth(), pixelSnappedScrollHeight()); | |
| 484 visibleSize = | 483 visibleSize = |
| 485 pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); | 484 pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); |
| 486 | 485 |
| 487 // TODO(skobes): We should really ASSERT that contentSize >= visibleSize | 486 // TODO(skobes): We should really ASSERT that contentSize >= visibleSize |
| 488 // when we are not the root layer, but we can't because contentSize is | 487 // when we are not the root layer, but we can't because contentSize is |
| 489 // based on stale layout overflow data (http://crbug.com/576933). | 488 // based on stale layout overflow data (http://crbug.com/576933). |
| 490 contentSize = contentSize.expandedTo(visibleSize); | 489 contentSize = contentSize.expandedTo(visibleSize); |
| 491 } | 490 } |
| 492 return toIntSize(-scrollOrigin() + (contentSize - visibleSize)); | 491 return toIntSize(-scrollOrigin() + (contentSize - visibleSize)); |
| 493 } | 492 } |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 | 1964 |
| 1966 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 1965 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 1967 clampScrollableAreas() { | 1966 clampScrollableAreas() { |
| 1968 for (auto& scrollableArea : *s_needsClamp) | 1967 for (auto& scrollableArea : *s_needsClamp) |
| 1969 scrollableArea->clampScrollOffsetsAfterLayout(); | 1968 scrollableArea->clampScrollOffsetsAfterLayout(); |
| 1970 delete s_needsClamp; | 1969 delete s_needsClamp; |
| 1971 s_needsClamp = nullptr; | 1970 s_needsClamp = nullptr; |
| 1972 } | 1971 } |
| 1973 | 1972 |
| 1974 } // namespace blink | 1973 } // namespace blink |
| OLD | NEW |