Changeset 116830 in webkit


Ignore:
Timestamp:
May 11, 2012 5:56:13 PM (12 years ago)
Author:
andersca@apple.com
Message:

Comcast website displays bottom of page when loaded
https://bugs.webkit.org/show_bug.cgi?id=86277
<rdar://problem/11426887>

Reviewed by Beth Dakin.

There were two bugs here. The first bug was that FrameView::setScrollPosition didn't end up calling into the scrolling coordinator
to update the scroll position. The second bug was that ScrollingTreeNodeMac::setScrollPosition didn't constrain the scroll position
to the edge of the page.

  • page/FrameView.cpp:

(WebCore::FrameView::setScrollPosition):
Call requestScrollPositionUpdate.

  • page/scrolling/ScrollingTree.cpp:
  • page/scrolling/ScrollingTree.h:

Remove setMainFrameScrollPosition, it is not called by anyone.

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

(WebCore::ScrollingTreeNodeMac::setScrollPosition):
Clamp to the page size and call setScrollPositionWithoutContentEdgeConstraints.

(WebCore::ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints):
Update the scroll layer position and call back to the main thread.

(WebCore::ScrollingTreeNodeMac::scrollBy):
Call setScrollPosition.

(WebCore::ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints):
Call setScrollPositionWithoutContentEdgeConstraints.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116828 r116830  
     12012-05-11  Anders Carlsson  <andersca@apple.com>
     2
     3        Comcast website displays bottom of page when loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=86277
     5        <rdar://problem/11426887>
     6
     7        Reviewed by Beth Dakin.
     8
     9        There were two bugs here. The first bug was that FrameView::setScrollPosition didn't end up calling into the scrolling coordinator
     10        to update the scroll position. The second bug was that ScrollingTreeNodeMac::setScrollPosition didn't constrain the scroll position
     11        to the edge of the page.
     12
     13        * page/FrameView.cpp:
     14        (WebCore::FrameView::setScrollPosition):
     15        Call requestScrollPositionUpdate.
     16
     17        * page/scrolling/ScrollingTree.cpp:
     18        * page/scrolling/ScrollingTree.h:
     19        Remove setMainFrameScrollPosition, it is not called by anyone.
     20
     21        * page/scrolling/mac/ScrollingTreeNodeMac.h:
     22        * page/scrolling/mac/ScrollingTreeNodeMac.mm:
     23        (WebCore::ScrollingTreeNodeMac::setScrollPosition):
     24        Clamp to the page size and call setScrollPositionWithoutContentEdgeConstraints.
     25
     26        (WebCore::ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints):
     27        Update the scroll layer position and call back to the main thread.
     28
     29        (WebCore::ScrollingTreeNodeMac::scrollBy):
     30        Call setScrollPosition.
     31
     32        (WebCore::ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints):
     33        Call setScrollPositionWithoutContentEdgeConstraints.
     34
    1352012-05-11  Gavin Barraclough  <barraclough@apple.com>
    236
  • trunk/Source/WebCore/page/FrameView.cpp

    r116687 r116830  
    17051705    TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
    17061706    m_maintainScrollPositionAnchor = 0;
     1707
     1708    if (requestScrollPositionUpdate(scrollPoint))
     1709        return;
     1710
    17071711    ScrollView::setScrollPosition(scrollPoint);
    17081712}
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r116824 r116830  
    9898}
    9999
    100 void ScrollingTree::setMainFrameScrollPosition(const IntPoint& scrollPosition)
    101 {
    102     ASSERT(ScrollingThread::isCurrentThread());
    103 
    104     m_rootNode->setScrollPosition(scrollPosition);
    105 }
    106 
    107100static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
    108101{
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r112707 r116830  
    7676    void handleWheelEvent(const PlatformWheelEvent&);
    7777
    78     void setMainFrameScrollPosition(const IntPoint&);
    79 
    8078    void invalidate();
    8179    void commitNewTreeState(PassOwnPtr<ScrollingTreeState>);
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h

    r109386 r116830  
    4646    virtual void update(ScrollingTreeState*) OVERRIDE;
    4747    virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
    48     virtual void setScrollPosition(const IntPoint&) OVERRIDE;
    4948
    5049    // ScrollElasticityController member functions.
     
    6362
    6463    IntPoint scrollPosition() const;
     64    void setScrollPosition(const IntPoint&);
     65    void setScrollPositionWithoutContentEdgeConstraints(const IntPoint&);
     66
    6567    void setScrollLayerPosition(const IntPoint&);
    6668
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm

    r116570 r116830  
    8686}
    8787
    88 void ScrollingTreeNodeMac::setScrollPosition(const IntPoint& scrollPosition)
    89 {
    90     updateMainFramePinState(scrollPosition);
    91 
    92     if (shouldUpdateScrollLayerPositionOnMainThread()) {
    93         m_probableMainThreadScrollPosition = scrollPosition;
    94         scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
    95         return;
    96     }
    97 
    98     setScrollLayerPosition(scrollPosition);
    99     scrollingTree()->updateMainFrameScrollPosition(scrollPosition);
    100 }
    101 
    10288bool ScrollingTreeNodeMac::allowsHorizontalStretching()
    10389{
     
    241227}
    242228
     229void ScrollingTreeNodeMac::setScrollPosition(const IntPoint& scrollPosition)
     230{
     231    IntPoint newScrollPosition = scrollPosition;
     232    newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
     233    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
     234
     235    setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
     236}
     237
     238void ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints(const IntPoint& scrollPosition)
     239{
     240    updateMainFramePinState(scrollPosition);
     241
     242    if (shouldUpdateScrollLayerPositionOnMainThread()) {
     243        m_probableMainThreadScrollPosition = scrollPosition;
     244        scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
     245        return;
     246    }
     247
     248    setScrollLayerPosition(scrollPosition);
     249    scrollingTree()->updateMainFrameScrollPosition(scrollPosition);
     250}
     251
    243252void ScrollingTreeNodeMac::setScrollLayerPosition(const IntPoint& position)
    244253{
     
    264273void ScrollingTreeNodeMac::scrollBy(const IntSize& offset)
    265274{
    266     IntPoint newScrollPosition = scrollPosition() + offset;
    267     newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
    268     newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
    269 
    270     setScrollPosition(newScrollPosition);
     275    setScrollPosition(scrollPosition() + offset);
    271276}
    272277
    273278void ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
    274279{
    275     setScrollPosition(scrollPosition() + offset);
     280    setScrollPositionWithoutContentEdgeConstraints(scrollPosition() + offset);
    276281}
    277282
Note: See TracChangeset for help on using the changeset viewer.