Changeset 163677 in webkit


Ignore:
Timestamp:
Feb 7, 2014 6:19:42 PM (10 years ago)
Author:
Simon Fraser
Message:

Encode requestedScrollPosition on ScrollingStateScrollingNodes to send to the UI process
https://bugs.webkit.org/show_bug.cgi?id=128416

Source/WebCore:

Reviewed by Tim Horton.

Change requestedScrollPosition() to be a FloatPoint, and export
ScrollingStateScrollingNode::setRequestedScrollPosition(WebCore::FloatPoint const&, bool)
for WK2.

  • WebCore.exp.in:
  • page/scrolling/ScrollingStateScrollingNode.cpp:

(WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):

  • page/scrolling/ScrollingStateScrollingNode.h:

Source/WebKit2:

Reviewed by Tim Horton.

Encode and decode requestedScrollPosition() and requestedScrollPositionRepresentsProgrammaticScroll(),
which can't use the macros because the setter takes both arguments.

The UI process needs this to notice programmatic scrolls.

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163675 r163677  
     12014-02-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Encode requestedScrollPosition on ScrollingStateScrollingNodes to send to the UI process
     4        https://bugs.webkit.org/show_bug.cgi?id=128416
     5
     6        Reviewed by Tim Horton.
     7       
     8        Change requestedScrollPosition() to be a FloatPoint, and export
     9        ScrollingStateScrollingNode::setRequestedScrollPosition(WebCore::FloatPoint const&, bool)
     10        for WK2.
     11
     12        * WebCore.exp.in:
     13        * page/scrolling/ScrollingStateScrollingNode.cpp:
     14        (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
     15        * page/scrolling/ScrollingStateScrollingNode.h:
     16
    1172014-02-07  Beth Dakin  <bdakin@apple.com>
    218
  • trunk/Source/WebCore/WebCore.exp.in

    r163654 r163677  
    30483048__ZN7WebCore27ScrollingStateScrollingNode25setWheelEventHandlerCountEj
    30493049__ZN7WebCore27ScrollingStateScrollingNode26setNonFastScrollableRegionERKNS_6RegionE
     3050__ZN7WebCore27ScrollingStateScrollingNode26setRequestedScrollPositionERKNS_10FloatPointEb
    30503051__ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE
    30513052__ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp

    r163231 r163677  
    187187}
    188188
    189 void ScrollingStateScrollingNode::setRequestedScrollPosition(const IntPoint& requestedScrollPosition, bool representsProgrammaticScroll)
     189void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& requestedScrollPosition, bool representsProgrammaticScroll)
    190190{
    191191    m_requestedScrollPosition = requestedScrollPosition;
     
    286286    if (m_requestedScrollPosition != IntPoint()) {
    287287        writeIndent(ts, indent + 1);
    288         ts << "(requested scroll position " << m_requestedScrollPosition.x() << " " << m_requestedScrollPosition.y() << ")\n";
     288        ts << "(requested scroll position " << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.x()) << " " << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.y()) << ")\n";
    289289    }
    290290
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h

    r163231 r163677  
    100100    void setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements);
    101101
    102     const IntPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
    103     void setRequestedScrollPosition(const IntPoint&, bool representsProgrammaticScroll);
    104 
     102    const FloatPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
     103    bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
     104    void setRequestedScrollPosition(const FloatPoint&, bool representsProgrammaticScroll);
     105   
    105106    int headerHeight() const { return m_headerHeight; }
    106107    void setHeaderHeight(int);
     
    126127#endif
    127128    void setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar);
    128 
    129     bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
    130129
    131130    virtual void dumpProperties(TextStream&, int indent) const override;
     
    157156    int m_headerHeight;
    158157    int m_footerHeight;
    159     IntPoint m_requestedScrollPosition;
     158    FloatPoint m_requestedScrollPosition;
    160159    bool m_requestedScrollPositionRepresentsProgrammaticScroll;
    161160};
  • trunk/Source/WebKit2/ChangeLog

    r163676 r163677  
     12014-02-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Encode requestedScrollPosition on ScrollingStateScrollingNodes to send to the UI process
     4        https://bugs.webkit.org/show_bug.cgi?id=128416
     5
     6        Reviewed by Tim Horton.
     7       
     8        Encode and decode requestedScrollPosition() and requestedScrollPositionRepresentsProgrammaticScroll(),
     9        which can't use the macros because the setter takes both arguments.
     10       
     11        The UI process needs this to notice programmatic scrolls.
     12
     13        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
     14        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
     15        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
     16
    1172014-02-07  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

    r163516 r163677  
    119119    SCROLLING_NODE_ENCODE(ScrollableAreaParams, scrollableAreaParameters)
    120120    SCROLLING_NODE_ENCODE_ENUM(BehaviorForFixedElements, scrollBehaviorForFixedElements)
    121     // FIXME: encode requestedScrollPosition?
     121    SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPosition)
     122    SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
    122123    SCROLLING_NODE_ENCODE(HeaderHeight, headerHeight)
    123124    SCROLLING_NODE_ENCODE(FooterHeight, footerHeight)
     
    155156    SCROLLING_NODE_DECODE(ScrollableAreaParams, ScrollableAreaParameters, setScrollableAreaParameters);
    156157    SCROLLING_NODE_DECODE_ENUM(BehaviorForFixedElements, ScrollBehaviorForFixedElements, setScrollBehaviorForFixedElements);
    157     // FIXME: decode requestedScrollPosition?
     158
     159    if (node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
     160        FloatPoint scrollPosition;
     161        if (!decoder.decode(scrollPosition))
     162            return false;
     163
     164        bool representsProgrammaticScroll;
     165        if (!decoder.decode(representsProgrammaticScroll))
     166            return false;
     167
     168        node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll);
     169    }
     170
    158171    SCROLLING_NODE_DECODE(HeaderHeight, int, setHeaderHeight);
    159172    SCROLLING_NODE_DECODE(FooterHeight, int, setFooterHeight);
Note: See TracChangeset for help on using the changeset viewer.