| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) con
st | 415 IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) con
st |
| 416 { | 416 { |
| 417 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); | 417 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); |
| 418 } | 418 } |
| 419 | 419 |
| 420 int ScrollableArea::lineStep(ScrollbarOrientation) const | 420 int ScrollableArea::lineStep(ScrollbarOrientation) const |
| 421 { | 421 { |
| 422 return pixelsPerLineStep(); | 422 return pixelsPerLineStep(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 int ScrollableArea::pageStep(ScrollbarOrientation orientation) const |
| 426 { |
| 427 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible
Height(); |
| 428 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging()
; |
| 429 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); |
| 430 |
| 431 return std::max(pageStep, 1); |
| 432 } |
| 433 |
| 425 int ScrollableArea::documentStep(ScrollbarOrientation orientation) const | 434 int ScrollableArea::documentStep(ScrollbarOrientation orientation) const |
| 426 { | 435 { |
| 427 return scrollSize(orientation); | 436 return scrollSize(orientation); |
| 428 } | 437 } |
| 429 | 438 |
| 430 float ScrollableArea::pixelStep(ScrollbarOrientation) const | 439 float ScrollableArea::pixelStep(ScrollbarOrientation) const |
| 431 { | 440 { |
| 432 return 1; | 441 return 1; |
| 433 } | 442 } |
| 434 | 443 |
| 435 } // namespace WebCore | 444 } // namespace WebCore |
| OLD | NEW |