Changeset 165666 in webkit


Ignore:
Timestamp:
Mar 14, 2014 6:03:02 PM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] background-attachment: fixed renders oddly, moves around
https://bugs.webkit.org/show_bug.cgi?id=130277
<rdar://problem/16332883>

Source/WebCore:

Reviewed by Tim Horton.

If we have a counter-scrolling layer (for a fixed background), move
it around when changing the viewport.

  • page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:

(WebCore::ScrollingTreeScrollingNodeIOS::updateForViewport):

Source/WebKit2:

Reviewed by Tim Horton.

Actually send scrolling and counter-scrolling layers to the UI process!

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:

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

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r165665 r165666  
     12014-03-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] background-attachment: fixed renders oddly, moves around
     4        https://bugs.webkit.org/show_bug.cgi?id=130277
     5        <rdar://problem/16332883>
     6
     7        Reviewed by Tim Horton.
     8
     9        If we have a counter-scrolling layer (for a fixed background), move
     10        it around when changing the viewport.
     11
     12        * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
     13        (WebCore::ScrollingTreeScrollingNodeIOS::updateForViewport):
     14
    1152014-03-14  Jae Hyun Park  <jaepark@webkit.org>
    216
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm

    r165652 r165666  
    133133{
    134134    ASSERT(!shouldUpdateScrollLayerPositionSynchronously());
    135     m_scrollLayer.get().position = CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y());
     135    [m_scrollLayer setPosition:CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y())];
    136136
    137137    ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     
    141141    // FIXME: scrollOffsetForFixedPosition() needs to do float math.
    142142    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
    143     if (m_counterScrollingLayer)
    144         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
     143
     144    [m_counterScrollingLayer setPosition:FloatPoint(scrollOffsetForFixedChildren)];
    145145
    146146    if (m_headerLayer || m_footerLayer) {
     
    153153
    154154        if (m_headerLayer)
    155             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, 0);
     155            [m_headerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, 0)];
    156156
    157157        if (m_footerLayer)
    158             m_footerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight());
     158            [m_footerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight())];
    159159    }
    160160   
     
    173173void ScrollingTreeScrollingNodeIOS::updateForViewport(const FloatRect& viewportRect, double scale)
    174174{
     175    [m_counterScrollingLayer setPosition:viewportRect.location()];
     176
    175177    if (!m_children)
    176178        return;
  • trunk/Source/WebKit2/ChangeLog

    r165663 r165666  
     12014-03-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] background-attachment: fixed renders oddly, moves around
     4        https://bugs.webkit.org/show_bug.cgi?id=130277
     5        <rdar://problem/16332883>
     6
     7        Reviewed by Tim Horton.
     8       
     9        Actually send scrolling and counter-scrolling layers to the UI process!
     10
     11        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
     12        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
     13        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
     14
    1152014-03-14  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

    r165493 r165666  
    123123    SCROLLING_NODE_ENCODE(HeaderHeight, headerHeight)
    124124    SCROLLING_NODE_ENCODE(FooterHeight, footerHeight)
     125
     126    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
     127        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
     128
     129    if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
     130        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
    125131}
    126132
     
    171177    SCROLLING_NODE_DECODE(HeaderHeight, int, setHeaderHeight);
    172178    SCROLLING_NODE_DECODE(FooterHeight, int, setFooterHeight);
     179
     180    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
     181        GraphicsLayer::PlatformLayerID layerID;
     182        if (!decoder.decode(layerID))
     183            return false;
     184        node.setScrolledContentsLayer(layerID);
     185    }
     186
     187    if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) {
     188        GraphicsLayer::PlatformLayerID layerID;
     189        if (!decoder.decode(layerID))
     190            return false;
     191        node.setCounterScrollingLayer(layerID);
     192    }
    173193
    174194    return true;
Note: See TracChangeset for help on using the changeset viewer.