LEFT | RIGHT |
(no file at all) | |
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, 2014-2016 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011, 2014-2016 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 bool ScrollableArea::isPinnedVerticallyInDirection(int verticalScrollDelta) cons
t | 584 bool ScrollableArea::isPinnedVerticallyInDirection(int verticalScrollDelta) cons
t |
585 { | 585 { |
586 if (verticalScrollDelta < 0 && isVerticalScrollerPinnedToMinimumPosition()) | 586 if (verticalScrollDelta < 0 && isVerticalScrollerPinnedToMinimumPosition()) |
587 return true; | 587 return true; |
588 if (verticalScrollDelta > 0 && isVerticalScrollerPinnedToMaximumPosition()) | 588 if (verticalScrollDelta > 0 && isVerticalScrollerPinnedToMaximumPosition()) |
589 return true; | 589 return true; |
590 return false; | 590 return false; |
591 } | 591 } |
592 #endif // PLATFORM(IOS) | 592 #endif // PLATFORM(IOS) |
593 | 593 |
594 int ScrollableArea::horizontalScrollbarIntrusion() const | 594 int ScrollableArea::horizontalScrollbarIntrusion(IntrusionIncludesPlatformWidget
Scrollbars) const |
595 { | 595 { |
596 return verticalScrollbar() ? verticalScrollbar()->occupiedWidth() : 0; | 596 return verticalScrollbar() ? verticalScrollbar()->occupiedWidth() : 0; |
597 } | 597 } |
598 | 598 |
599 int ScrollableArea::verticalScrollbarIntrusion() const | 599 int ScrollableArea::verticalScrollbarIntrusion(IntrusionIncludesPlatformWidgetSc
rollbars) const |
600 { | 600 { |
601 return horizontalScrollbar() ? horizontalScrollbar()->occupiedHeight() : 0; | 601 return horizontalScrollbar() ? horizontalScrollbar()->occupiedHeight() : 0; |
602 } | 602 } |
603 | 603 |
604 IntSize ScrollableArea::scrollbarIntrusion() const | 604 IntSize ScrollableArea::scrollbarIntrusion(IntrusionIncludesPlatformWidgetScroll
bars intrusionIncludesPlatformWidgetScrollbars) const |
605 { | 605 { |
606 return { horizontalScrollbarIntrusion(), verticalScrollbarIntrusion() }; | 606 return { horizontalScrollbarIntrusion(intrusionIncludesPlatformWidgetScrollb
ars), verticalScrollbarIntrusion(intrusionIncludesPlatformWidgetScrollbars) }; |
607 } | 607 } |
608 | 608 |
609 ScrollPosition ScrollableArea::scrollPosition() const | 609 ScrollPosition ScrollableArea::scrollPosition() const |
610 { | 610 { |
611 // FIXME: This relationship seems to be inverted. Scrollbars should be 'view
', not 'model', and should get their values from us. | 611 // FIXME: This relationship seems to be inverted. Scrollbars should be 'view
', not 'model', and should get their values from us. |
612 int x = horizontalScrollbar() ? horizontalScrollbar()->value() : 0; | 612 int x = horizontalScrollbar() ? horizontalScrollbar()->value() : 0; |
613 int y = verticalScrollbar() ? verticalScrollbar()->value() : 0; | 613 int y = verticalScrollbar() ? verticalScrollbar()->value() : 0; |
614 return IntPoint(x, y); | 614 return IntPoint(x, y); |
615 } | 615 } |
616 | 616 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 } else { | 747 } else { |
748 // Within the bounds of the scrollable area. | 748 // Within the bounds of the scrollable area. |
749 if (maximum > 0) | 749 if (maximum > 0) |
750 doubleValue = currentPosition / maximum; | 750 doubleValue = currentPosition / maximum; |
751 else | 751 else |
752 doubleValue = 0; | 752 doubleValue = 0; |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 } // namespace WebCore | 756 } // namespace WebCore |
LEFT | RIGHT |