Changeset 171250 in webkit


Ignore:
Timestamp:
Jul 18, 2014 5:00:52 PM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=135078

Source/WebCore:
<rdar://problem/17401823>

Reviewed by Tim Horton.

When the UI-side scrolling tree receives a requested scroll position update, it scrolls
the node (e.g. a frame) then traverses child nodes to update them, e.g. for fixed position.
However, we would always use a viewport rect for the main document (from the scrolling tree),
which is not appropriate for subframes. Subframes should just use their own visible
rect to position fixed children.

Test: platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html

  • page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:

(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):

Source/WebKit2:
<rdar://problem/17401823>

Reviewed by Tim Horton.

Fix the logging of requested scroll position and frame scale factor.

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:

(WebKit::RemoteScrollingTreeTextStream::dump):

LayoutTests:

Reviewed by Tim Horton.

Test with position:fixed inside an iframe that scrolls programmatically.

  • platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt: Added.
  • platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html: Added.
  • platform/mac-wk2/tiled-drawing/scrolling/frames/resources/autoscrolling-frame-with-fixed.html: Added.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r171242 r171250  
     12014-07-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
     4        https://bugs.webkit.org/show_bug.cgi?id=135078
     5
     6        Reviewed by Tim Horton.
     7       
     8        Test with position:fixed inside an iframe that scrolls programmatically.
     9
     10        * platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt: Added.
     11        * platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html: Added.
     12        * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/autoscrolling-frame-with-fixed.html: Added.
     13
    1142014-07-18  Alexey Proskuryakov  <ap@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r171246 r171250  
     12014-07-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
     4        https://bugs.webkit.org/show_bug.cgi?id=135078
     5        <rdar://problem/17401823>
     6
     7        Reviewed by Tim Horton.
     8       
     9        When the UI-side scrolling tree receives a requested scroll position update, it scrolls
     10        the node (e.g. a frame) then traverses child nodes to update them, e.g. for fixed position.
     11        However, we would always use a viewport rect for the main document (from the scrolling tree),
     12        which is not appropriate for subframes. Subframes should just use their own visible
     13        rect to position fixed children.
     14
     15        Test: platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html
     16
     17        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
     18        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
     19
    1202014-07-18  Beth Dakin  <bdakin@apple.com>
    221
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm

    r170196 r171250  
    171171        return;
    172172
    173     FloatRect fixedPositionRect = scrollingTree().fixedPositionRect();
    174    
     173
     174    FloatRect fixedPositionRect;
     175    if (!parent())
     176        fixedPositionRect = scrollingTree().fixedPositionRect();
     177    else
     178        fixedPositionRect = FloatRect(scrollOffset, scrollableAreaSize());
     179
    175180    for (auto& child : *m_children)
    176181        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
  • trunk/Source/WebKit2/ChangeLog

    r171240 r171250  
     12014-07-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
     4        https://bugs.webkit.org/show_bug.cgi?id=135078
     5        <rdar://problem/17401823>
     6
     7        Reviewed by Tim Horton.
     8       
     9        Fix the logging of requested scroll position and frame scale factor.
     10
     11        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
     12        (WebKit::RemoteScrollingTreeTextStream::dump):
     13
    1142014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

    r170541 r171250  
    582582        dumpProperty(ts, "scroll-origin", node.scrollOrigin());
    583583
    584     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
    585584    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
    586585        dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition());
     
    628627        dumpProperty(ts, "top-content-inset", node.topContentInset());
    629628
     629    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
     630        dumpProperty(ts, "frame-scale-factor", node.frameScaleFactor());
     631
    630632    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
    631633        dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
Note: See TracChangeset for help on using the changeset viewer.