| 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 } | 415 } |
| 416 | 416 |
| 417 void ScrollableArea::cancelProgrammaticScrollAnimation() | 417 void ScrollableArea::cancelProgrammaticScrollAnimation() |
| 418 { | 418 { |
| 419 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram
maticScrollAnimator()) | 419 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram
maticScrollAnimator()) |
| 420 programmaticScrollAnimator->cancelAnimation(); | 420 programmaticScrollAnimator->cancelAnimation(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl
usion) const | 423 IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl
usion) const |
| 424 { | 424 { |
| 425 int verticalScrollbarWidth = 0; | |
| 426 int horizontalScrollbarHeight = 0; | |
| 427 | |
| 428 if (scrollbarInclusion == IncludeScrollbars) { | |
| 429 if (Scrollbar* verticalBar = verticalScrollbar()) | |
| 430 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? vertic
alBar->width() : 0; | |
| 431 if (Scrollbar* horizontalBar = horizontalScrollbar()) | |
| 432 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? h
orizontalBar->height() : 0; | |
| 433 } | |
| 434 | |
| 435 return IntRect(scrollPosition().x(), | 425 return IntRect(scrollPosition().x(), |
| 436 scrollPosition().y(), | 426 scrollPosition().y(), |
| 437 std::max(0, visibleWidth() + verticalScrollbarWidth), | 427 std::max(0, visibleWidth()), |
| 438 std::max(0, visibleHeight() + horizontalScrollbarHeight)); | 428 std::max(0, visibleHeight())); |
| 439 } | 429 } |
| 440 | 430 |
| 441 IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) con
st | 431 IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) con
st |
| 442 { | 432 { |
| 443 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); | 433 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); |
| 444 } | 434 } |
| 445 | 435 |
| 446 int ScrollableArea::lineStep(ScrollbarOrientation) const | 436 int ScrollableArea::lineStep(ScrollbarOrientation) const |
| 447 { | 437 { |
| 448 return pixelsPerLineStep(); | 438 return pixelsPerLineStep(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 461 { | 451 { |
| 462 return scrollSize(orientation); | 452 return scrollSize(orientation); |
| 463 } | 453 } |
| 464 | 454 |
| 465 float ScrollableArea::pixelStep(ScrollbarOrientation) const | 455 float ScrollableArea::pixelStep(ScrollbarOrientation) const |
| 466 { | 456 { |
| 467 return 1; | 457 return 1; |
| 468 } | 458 } |
| 469 | 459 |
| 470 } // namespace blink | 460 } // namespace blink |
| OLD | NEW |