Changeset 194502 in webkit


Ignore:
Timestamp:
Jan 2, 2016 1:58:48 PM (8 years ago)
Author:
Simon Fraser
Message:

Some cleanup in ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=152649

Reviewed by Zalan Bujtas.
Source/WebCore:

Change ScrollAnimatorMac::adjustScrollPositionIfNecessary() and similar code in
ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary() to
constrain between minimumScrollPosition() and maximumScrollPosition(), rather than
rolling their own code.

This revealed several issues. First, RenderLayer::maximumScrollPosition() is
wrong when the layer has borders, because RenderLayer::visibleContentRectInternal()
seems to have incorrect logic. However, we can just remove it, and use the ScrollableArea
implementation.

Second, ScrollAnimatorMac::scrollToOffsetWithoutAnimation() was failing to do a
position/offset conversion, so do one. We're converting too much, and should probably
just change ScrollAnimator to do everything in terms of positions.

Third, ScrollAnimator::scroll() was clamping a scroll position as an offset
(detected by scrollbars/scroll-rtl-or-bt-layer.html), so fix that.

Remove ScrollController::absoluteScrollPosition() and overrides, since this was
confusingly named, and could just be removed.

Remove ScrollController::m_origOrigin which was assigned to, but never read.

Test: fast/scrolling/arrow-key-scroll-in-rtl-document.html: new

fast/dom/horizontal-scrollbar-in-rtl.html: progressed with these changes.

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition): Deleted.

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::scroll):
(WebCore::ScrollAnimator::notifyPositionChanged):

  • platform/ScrollableArea.h:

(WebCore::ScrollableArea::constrainScrollPosition):

  • platform/cocoa/ScrollController.h:
  • platform/cocoa/ScrollController.mm:

(WebCore::ScrollController::snapRubberBandTimerFired): Deleted.
(WebCore::ScrollController::snapRubberBand): Deleted.

  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(-[WebScrollAnimationHelperDelegate _immediateScrollToPoint:]):
(WebCore::ScrollAnimatorMac::scroll):
(WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorMac::adjustScrollPositionIfNecessary):
(WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollAnimatorMac::immediateScrollToPosition):
(WebCore::ScrollAnimatorMac::immediateScrollToPositionForScrollAnimation):
(WebCore::ScrollAnimatorMac::immediateScrollTo): Deleted.
(WebCore::ScrollAnimatorMac::immediateScrollToPointForScrollAnimation): Deleted.
(WebCore::ScrollAnimatorMac::absoluteScrollPosition): Deleted.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::visibleContentRectInternal):
(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::maximumScrollPosition): Deleted.

  • rendering/RenderLayer.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::minimumScrollPosition):
(WebCore::RenderListBox::maximumScrollPosition): RenderListBox scrolls by lines,
so it needs a custom implementation of this.

  • rendering/RenderListBox.h:

LayoutTests:

Added fast/scrolling/arrow-key-scroll-in-rtl-document.html to test for arrow
key scrolling in an RTL document, which an earlier version of the patch
regressed without detection.

  • fast/dom/horizontal-scrollbar-in-rtl-expected.txt:
  • fast/scrolling/arrow-key-scroll-in-rtl-document-expected.txt: Added.
  • fast/scrolling/arrow-key-scroll-in-rtl-document.html: Added.
Location:
trunk
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194500 r194502  
     12016-01-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Some cleanup in ScrollAnimator
     4        https://bugs.webkit.org/show_bug.cgi?id=152649
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        Added fast/scrolling/arrow-key-scroll-in-rtl-document.html to test for arrow
     9        key scrolling in an RTL document, which an earlier version of the patch
     10        regressed without detection.
     11
     12        * fast/dom/horizontal-scrollbar-in-rtl-expected.txt:
     13        * fast/scrolling/arrow-key-scroll-in-rtl-document-expected.txt: Added.
     14        * fast/scrolling/arrow-key-scroll-in-rtl-document.html: Added.
     15
    1162016-01-02  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-expected.txt

    r149088 r194502  
    44zoom in and out preserve scroll position: Success
    55resize preserves scroll position: Success
    6 KeyDown HOME move x-scroll position to right for RTL page: -1000
    7 KeyDown END move x-scroll position to right for RTL page: -1000
     6KeyDown HOME move x-scroll position to right for RTL page: 0
     7KeyDown END move x-scroll position to right for RTL page: 0
    88selectAll selects all document: Success
  • trunk/Source/WebCore/ChangeLog

    r194500 r194502  
     12016-01-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Some cleanup in ScrollAnimator
     4        https://bugs.webkit.org/show_bug.cgi?id=152649
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Change ScrollAnimatorMac::adjustScrollPositionIfNecessary() and similar code in
     9        ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary() to
     10        constrain between minimumScrollPosition() and maximumScrollPosition(), rather than
     11        rolling their own code.
     12       
     13        This revealed several issues. First, RenderLayer::maximumScrollPosition() is
     14        wrong when the layer has borders, because RenderLayer::visibleContentRectInternal()
     15        seems to have incorrect logic. However, we can just remove it, and use the ScrollableArea
     16        implementation.
     17       
     18        Second, ScrollAnimatorMac::scrollToOffsetWithoutAnimation() was failing to do a
     19        position/offset conversion, so do one. We're converting too much, and should probably
     20        just change ScrollAnimator to do everything in terms of positions.
     21       
     22        Third, ScrollAnimator::scroll() was clamping a scroll position as an offset
     23        (detected by scrollbars/scroll-rtl-or-bt-layer.html), so fix that.
     24       
     25        Remove ScrollController::absoluteScrollPosition() and overrides, since this was
     26        confusingly named, and could just be removed.
     27       
     28        Remove ScrollController::m_origOrigin which was assigned to, but never read.
     29
     30        Test: fast/scrolling/arrow-key-scroll-in-rtl-document.html: new
     31              fast/dom/horizontal-scrollbar-in-rtl.html: progressed with these changes.
     32
     33        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
     34        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     35        (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
     36        (WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition): Deleted.
     37        * platform/ScrollAnimator.cpp:
     38        (WebCore::ScrollAnimator::scroll):
     39        (WebCore::ScrollAnimator::notifyPositionChanged):
     40        * platform/ScrollableArea.h:
     41        (WebCore::ScrollableArea::constrainScrollPosition):
     42        * platform/cocoa/ScrollController.h:
     43        * platform/cocoa/ScrollController.mm:
     44        (WebCore::ScrollController::snapRubberBandTimerFired): Deleted.
     45        (WebCore::ScrollController::snapRubberBand): Deleted.
     46        * platform/mac/ScrollAnimatorMac.h:
     47        * platform/mac/ScrollAnimatorMac.mm:
     48        (-[WebScrollAnimationHelperDelegate _immediateScrollToPoint:]):
     49        (WebCore::ScrollAnimatorMac::scroll):
     50        (WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
     51        (WebCore::ScrollAnimatorMac::adjustScrollPositionIfNecessary):
     52        (WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
     53        (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
     54        (WebCore::ScrollAnimatorMac::immediateScrollToPositionForScrollAnimation):
     55        (WebCore::ScrollAnimatorMac::immediateScrollTo): Deleted.
     56        (WebCore::ScrollAnimatorMac::immediateScrollToPointForScrollAnimation): Deleted.
     57        (WebCore::ScrollAnimatorMac::absoluteScrollPosition): Deleted.
     58        * rendering/RenderLayer.cpp:
     59        (WebCore::RenderLayer::visibleContentRectInternal):
     60        (WebCore::RenderLayer::overhangAmount):
     61        (WebCore::RenderLayer::maximumScrollPosition): Deleted.
     62        * rendering/RenderLayer.h:
     63        * rendering/RenderListBox.cpp:
     64        (WebCore::RenderListBox::minimumScrollPosition):
     65        (WebCore::RenderListBox::maximumScrollPosition): RenderListBox scrolls by lines,
     66        so it needs a custom implementation of this.
     67        * rendering/RenderListBox.h:
     68
    1692016-01-02  Zalan Bujtas  <zalan@apple.com>
    270
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h

    r186469 r194502  
    5959    bool canScrollVertically() override;
    6060    bool shouldRubberBandInDirection(ScrollDirection) override;
    61     IntPoint absoluteScrollPosition() override;
    6261    void immediateScrollBy(const FloatSize&) override;
    6362    void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) override;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r194487 r194502  
    326326}
    327327
    328 IntPoint ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition()
    329 {
    330     return roundedIntPoint(scrollPosition());
    331 }
    332 
    333328void ScrollingTreeFrameScrollingNodeMac::immediateScrollBy(const FloatSize& delta)
    334329{
     
    351346void ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary()
    352347{
    353     FloatPoint currentScrollPosition = absoluteScrollPosition();
    354     FloatPoint minPosition = minimumScrollPosition();
    355     FloatPoint maxPosition = maximumScrollPosition();
    356 
    357     float nearestXWithinBounds = std::max(std::min(currentScrollPosition.x(), maxPosition.x()), minPosition.x());
    358     float nearestYWithinBounds = std::max(std::min(currentScrollPosition.y(), maxPosition.y()), minPosition.y());
    359 
    360     FloatPoint nearestPointWithinBounds(nearestXWithinBounds, nearestYWithinBounds);
    361     immediateScrollBy(nearestPointWithinBounds - currentScrollPosition);
     348    FloatPoint currentScrollPosition = scrollPosition();
     349    FloatPoint constainedPosition = currentScrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
     350    immediateScrollBy(constainedPosition - currentScrollPosition);
    362351}
    363352
  • trunk/Source/WebCore/platform/ScrollAnimator.cpp

    r189749 r194502  
    6464bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
    6565{
    66     float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
    67     float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_scrollableArea.scrollSize(orientation))), 0.0f);
    68     float delta = *currentPos - newPos;
    69     if (*currentPos == newPos)
     66    FloatPoint currentPosition(m_currentPosX, m_currentPosY);
     67    FloatSize delta;
     68    if (orientation == HorizontalScrollbar)
     69        delta.setWidth(step * multiplier);
     70    else
     71        delta.setHeight(step * multiplier);
     72
     73    FloatPoint newPosition = FloatPoint(currentPosition + delta).constrainedBetween(m_scrollableArea.minimumScrollPosition(), m_scrollableArea.maximumScrollPosition());
     74    if (currentPosition == newPosition)
    7075        return false;
    71     *currentPos = newPos;
    72 
    73     notifyPositionChanged(orientation == HorizontalScrollbar ? FloatSize(delta, 0) : FloatSize(0, delta));
    74 
     76
     77    // FIXME: m_currentPosX/Y should just be a FloatPoint.
     78    m_currentPosX = newPosition.x();
     79    m_currentPosY = newPosition.y();
     80
     81    notifyPositionChanged(newPosition - currentPosition);
    7582    return true;
    7683}
     
    195202{
    196203    UNUSED_PARAM(delta);
    197     m_scrollableArea.setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
     204    // FIXME: need to not map back and forth all the time.
     205    m_scrollableArea.setScrollOffsetFromAnimation(m_scrollableArea.scrollOffsetFromPosition(IntPoint(m_currentPosX, m_currentPosY)));
    198206}
    199207
  • trunk/Source/WebCore/platform/ScrollableArea.h

    r194487 r194502  
    189189    virtual ScrollPosition maximumScrollPosition() const;
    190190
     191    ScrollPosition constrainScrollPosition(const ScrollPosition& position) const
     192    {
     193        return position.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
     194    }
     195
    191196    ScrollOffset maximumScrollOffset() const;
    192197
  • trunk/Source/WebCore/platform/cocoa/ScrollController.h

    r186469 r194502  
    6161    virtual bool shouldRubberBandInDirection(ScrollDirection) = 0;
    6262
    63     // Return the absolute scroll position, not relative to the scroll origin.
    64     virtual WebCore::IntPoint absoluteScrollPosition() = 0;
    65 
    6663    virtual void immediateScrollBy(const FloatSize&) = 0;
    6764    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
     
    180177    CFTimeInterval m_startTime { 0 };
    181178    FloatSize m_startStretch;
    182     FloatPoint m_origOrigin;
    183179    FloatSize m_origVelocity;
    184180    RunLoop::Timer<ScrollController> m_snapRubberbandTimer;
  • trunk/Source/WebCore/platform/cocoa/ScrollController.mm

    r188641 r194502  
    350350                m_startTime = 0;
    351351                m_startStretch = FloatSize();
    352                 m_origOrigin = FloatPoint();
    353352                m_origVelocity = FloatSize();
    354353                return;
    355354            }
    356355
    357             m_origOrigin = m_client.absoluteScrollPosition() - m_startStretch;
    358356            m_origVelocity = m_momentumVelocity;
    359357
     
    388386            m_startTime = 0;
    389387            m_startStretch = FloatSize();
    390             m_origOrigin = FloatPoint();
    391388            m_origVelocity = FloatSize();
    392389        }
     
    452449    m_startTime = [NSDate timeIntervalSinceReferenceDate];
    453450    m_startStretch = FloatSize();
    454     m_origOrigin = FloatPoint();
    455451    m_origVelocity = FloatSize();
    456452
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h

    r191735 r194502  
    5353    virtual ~ScrollAnimatorMac();
    5454
    55     void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition);
     55    void immediateScrollToPositionForScrollAnimation(const FloatPoint& newPosition);
    5656    bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad; }
    5757
     
    135135    FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const;
    136136
    137     void immediateScrollTo(const FloatPoint&);
     137    void immediateScrollToPosition(const FloatPoint&);
    138138
    139139    bool isRubberBandInProgress() const override;
     
    149149    virtual bool canScrollVertically() override;
    150150    virtual bool shouldRubberBandInDirection(ScrollDirection) override;
    151     virtual WebCore::IntPoint absoluteScrollPosition() override;
    152151    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) override;
    153152    virtual void immediateScrollBy(const FloatSize&) override;
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r194448 r194502  
    3333#include "FloatPoint.h"
    3434#include "GraphicsLayer.h"
     35#include "Logging.h"
    3536#include "NSScrollerImpDetails.h"
    3637#include "PlatformWheelEvent.h"
     
    3940#include "ScrollbarTheme.h"
    4041#include "ScrollbarThemeMac.h"
     42#include "TextStream.h"
    4143#include "WebCoreSystemInterface.h"
    4244
     
    131133    if (!_animator)
    132134        return;
    133     _animator->immediateScrollToPointForScrollAnimation(newPosition);
     135    _animator->immediateScrollToPositionForScrollAnimation(newPosition);
    134136}
    135137
     
    701703        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
    702704
    703     float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
    704     float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_scrollableArea.scrollSize(orientation))), 0);
    705     if (currentPos == newPos)
     705    FloatPoint currentPosition(m_currentPosX, m_currentPosY);
     706    FloatSize delta;
     707    if (orientation == HorizontalScrollbar)
     708        delta.setWidth(step * multiplier);
     709    else
     710        delta.setHeight(step * multiplier);
     711
     712    FloatPoint newPosition = FloatPoint(currentPosition + delta).constrainedBetween(m_scrollableArea.minimumScrollPosition(), m_scrollableArea.maximumScrollPosition());
     713    if (currentPosition == newPosition)
    706714        return false;
    707715
    708     NSPoint newPoint;
    709716    if ([m_scrollAnimationHelper _isAnimating]) {
    710717        NSPoint targetOrigin = [m_scrollAnimationHelper targetOrigin];
    711         newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targetOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
    712     } else
    713         newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, m_currentPosY) : NSMakePoint(m_currentPosX, newPos);
    714 
    715     [m_scrollAnimationHelper scrollToPoint:newPoint];
     718        if (orientation == HorizontalScrollbar)
     719            newPosition.setY(targetOrigin.y);
     720        else
     721            newPosition.setX(targetOrigin.x);
     722    }
     723
     724    LOG_WITH_STREAM(Scrolling, stream << "ScrollAnimatorMac::scroll " << " from " << FloatPoint(m_currentPosX, m_currentPosY) << " to " << newPosition);
     725    [m_scrollAnimationHelper scrollToPoint:newPosition];
    716726    return true;
    717727}
    718728
     729// FIXME: Maybe this should take a position.
    719730void ScrollAnimatorMac::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
    720731{
    721732    [m_scrollAnimationHelper _stopRun];
    722     immediateScrollTo(offset);
     733    immediateScrollToPosition(ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin())));
    723734}
    724735
     
    728739        return position;
    729740
    730     float newX = std::max<float>(std::min<float>(position.x(), m_scrollableArea.totalContentsSize().width() - m_scrollableArea.visibleWidth()), 0);
    731     float newY = std::max<float>(std::min<float>(position.y(), m_scrollableArea.totalContentsSize().height() - m_scrollableArea.visibleHeight()), 0);
    732 
    733     return FloatPoint(newX, newY);
     741    return m_scrollableArea.constrainScrollPosition(ScrollPosition(position));
    734742}
    735743
     
    739747    m_scrollableArea.setConstrainsScrollingToContentEdge(true);
    740748
    741     IntPoint currentScrollPosition = absoluteScrollPosition();
    742     FloatPoint nearestPointWithinBounds = adjustScrollPositionIfNecessary(absoluteScrollPosition());
    743     immediateScrollBy(nearestPointWithinBounds - currentScrollPosition);
     749    ScrollPosition currentScrollPosition = m_scrollableArea.scrollPosition();
     750    ScrollPosition constainedPosition = m_scrollableArea.constrainScrollPosition(currentScrollPosition);
     751    immediateScrollBy(constainedPosition - currentScrollPosition);
    744752
    745753    m_scrollableArea.setConstrainsScrollingToContentEdge(currentlyConstrainsToContentEdge);
    746754}
    747755
    748 void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
     756void ScrollAnimatorMac::immediateScrollToPosition(const FloatPoint& newPosition)
    749757{
    750758    FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
     
    780788}
    781789
    782 void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
     790void ScrollAnimatorMac::immediateScrollToPositionForScrollAnimation(const FloatPoint& newPosition)
    783791{
    784792    ASSERT(m_scrollAnimationHelper);
    785     immediateScrollTo(newPosition);
     793    immediateScrollToPosition(newPosition);
    786794}
    787795
     
    12831291}
    12841292
    1285 IntPoint ScrollAnimatorMac::absoluteScrollPosition()
    1286 {
    1287     // FIXME: can this use m_scrollableArea.scrollPosition()?
    1288     return m_scrollableArea.scrollOffsetFromPosition(m_scrollableArea.visibleContentRect().location());
    1289 }
    1290 
    12911293void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
    12921294{
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r194496 r194502  
    27332733}
    27342734
    2735 ScrollPosition RenderLayer::maximumScrollPosition() const
    2736 {
    2737     // FIXME: m_scrollSize may not be up-to-date if m_scrollDimensionsDirty is true.
    2738     // FIXME: should be able to use the ScrollableArea implementation.
    2739     return scrollPositionFromOffset(roundedIntPoint(m_scrollSize) - visibleContentRectIncludingScrollbars(ContentsVisibleRect).size());
    2740 }
    2741 
    27422735IntRect RenderLayer::visibleContentRectInternal(VisibleContentRectIncludesScrollbars scrollbarInclusion, VisibleContentRectBehavior) const
    27432736{
     
    27462739        scrollbarSpace = scrollbarIntrusion();
    27472740   
     2741    // FIXME: This seems wrong: m_layerSize includes borders. Can we just use the ScrollableArea implementation?
    27482742    return IntRect(scrollPosition(), IntSize(std::max(0, m_layerSize.width() - scrollbarSpace.width()), std::max(0, m_layerSize.height() - scrollbarSpace.height())));
    27492743}
     
    27572751    IntSize stretch;
    27582752
    2759     // FIXME: use maximumScrollOffset()
     2753    // FIXME: use maximumScrollOffset(), or just move this to ScrollableArea.
    27602754    ScrollOffset scrollOffset = scrollOffsetFromPosition(scrollPosition());
    27612755    if (scrollOffset.y() < 0)
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r194478 r194502  
    867867
    868868    virtual ScrollPosition scrollPosition() const override { return m_scrollPosition; }
    869     virtual ScrollPosition maximumScrollPosition() const override;
    870869
    871870    virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r194496 r194502  
    609609}
    610610
     611ScrollPosition RenderListBox::minimumScrollPosition() const
     612{
     613    return { 0, 0 };
     614}
     615
     616ScrollPosition RenderListBox::maximumScrollPosition() const
     617{
     618    return { 0, numItems() - numVisibleItems() };
     619}
     620
    611621void RenderListBox::setScrollOffset(const ScrollOffset& offset)
    612622{
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r194487 r194502  
    113113    virtual int scrollPosition(Scrollbar*) const override;
    114114    virtual void setScrollOffset(const ScrollOffset&) override;
     115    virtual ScrollPosition minimumScrollPosition() const override;
     116    virtual ScrollPosition maximumScrollPosition() const override;
    115117    virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) override;
    116118    virtual bool isActive() const override;
Note: See TracChangeset for help on using the changeset viewer.