Changeset 211379 in webkit


Ignore:
Timestamp:
Jan 30, 2017 11:46:40 AM (7 years ago)
Author:
Simon Fraser
Message:

Fixed elements should not rubber-band in WK2, nor remain at negative offsets
https://bugs.webkit.org/show_bug.cgi?id=167484
rdar://problem/29453068

Reviewed by Dean Jackson.
Source/WebCore:

There were various problems with the layout rect computation:

  1. It ignored the scrollBehaviorForFixedElements() which we use to avoid rubber-banding fixed elements in WK2, but allow in WK1, so make use of that.
  2. Sometimes layouts/paints of fixed elements would be triggered when coalesced calls to AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() failed to copy the layoutViewportOrigin to the scheduled update.
  3. The layout viewport could be left with a negative top/left after rubber-banding.

Also add a way to do unconstrained scrollTo(), so that a test can call window.scrollTo(-10, -10) to
simulate rubberbanding.

Tests: fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html

fast/visual-viewport/rubberbanding-viewport-rects.html

  • page/FrameView.cpp:

(WebCore::FrameView::computeLayoutViewportOrigin): Handle ScrollBehaviorForFixedElements, incorporating it
into logic that clamps layoutViewportOrigin between min/max when rubberbanding is not allowed, or not in progress.
(WebCore::FrameView::updateLayoutViewport): Pass in scrollBehaviorForFixedElements().
(WebCore::FrameView::visibleDocumentRect): The clamping here was preventing the visible rect from
escaping the document bounds, which caused fixed elements to bounce with rubber-banding, so remove the clamping,
and fix the logic to allow rubber-banding while taking headers and footers into account.

  • page/FrameView.h:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): layoutViewportOrigin has to
be pushed onto the scheduled update, just like scroll position.

  • page/scrolling/ScrollingTreeFrameScrollingNode.cpp:

(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): Pass in m_behaviorForFixed.

  • platform/ScrollView.cpp:

(WebCore::ScrollView::ScrollView):
(WebCore::ScrollView::adjustScrollPositionWithinRange):
(WebCore::ScrollView::setScrollOffset):

  • platform/ScrollView.h:

(WebCore::ScrollView::setAllowsUnclampedScrollPositionForTesting):
(WebCore::ScrollView::allowsUnclampedScrollPosition):

  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::setAllowUnclampedScrollPosition):

  • testing/InternalSettings.h:
  • testing/InternalSettings.idl:

Source/WebKit2:

Pass in StickToViewportBounds as we did before visual viewports.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::computeCustomFixedPositionRect):

LayoutTests:

Add two tests that use internals.settings.setAllowUnclampedScrollPosition(true) and then
over-scroll to simulator rubber-banding, dumping viewport rects.

setAllowUnclampedScrollPosition() only works in WebKit2, so skip the tests elsewhere.

  • TestExpectations:
  • fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
  • fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
  • fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html: Added.
  • fast/visual-viewport/rubberbanding-viewport-rects.html: Added.
  • platform/ios-simulator-wk2/TestExpectations:
  • platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
  • platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
  • platform/mac-wk2/TestExpectations:
Location:
trunk
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211375 r211379  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fixed elements should not rubber-band in WK2, nor remain at negative offsets
     4        https://bugs.webkit.org/show_bug.cgi?id=167484
     5        rdar://problem/29453068
     6
     7        Reviewed by Dean Jackson.
     8       
     9        Add two tests that use internals.settings.setAllowUnclampedScrollPosition(true) and then
     10        over-scroll to simulator rubber-banding, dumping viewport rects.
     11       
     12        setAllowUnclampedScrollPosition() only works in WebKit2, so skip the tests elsewhere.
     13
     14        * TestExpectations:
     15        * fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
     16        * fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
     17        * fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html: Added.
     18        * fast/visual-viewport/rubberbanding-viewport-rects.html: Added.
     19        * platform/ios-simulator-wk2/TestExpectations:
     20        * platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: Added.
     21        * platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-header-footer-expected.txt: Added.
     22        * platform/mac-wk2/TestExpectations:
     23
    1242017-01-30  Ryan Haddad  <ryanhaddad@apple.com>
    225
  • trunk/LayoutTests/TestExpectations

    r211349 r211379  
    8989# ApplePay is only available on iOS (greater than iOS 10) and macOS (greater than macOS 10.12) and only for WebKit2.
    9090http/tests/ssl/applepay/ [ Skip ]
     91
     92# Only WK2 allows unconstrained scrolling
     93fast/visual-viewport/rubberbanding-viewport-rects.html [ Skip ]
     94fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html  [ Skip ]
    9195
    9296#//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r210989 r211379  
    1717fast/media/mq-monochrome-live-update.html [ Pass ]
    1818fast/media/mq-prefers-reduced-motion-live-update.html [ Pass ]
     19
     20fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
     21fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html  [ Pass ]
    1922
    2023#//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r211234 r211379  
    2323
    2424[ Sierra+ ] http/tests/ssl/applepay/ [ Pass ]
     25
     26fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
     27fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html  [ Pass ]
    2528
    2629#//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/Source/WebCore/ChangeLog

    r211377 r211379  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fixed elements should not rubber-band in WK2, nor remain at negative offsets
     4        https://bugs.webkit.org/show_bug.cgi?id=167484
     5        rdar://problem/29453068
     6
     7        Reviewed by Dean Jackson.
     8
     9        There were various problems with the layout rect computation:
     10        1. It ignored the scrollBehaviorForFixedElements() which we use to avoid rubber-banding fixed
     11           elements in WK2, but allow in WK1, so make use of that.
     12        2. Sometimes layouts/paints of fixed elements would be triggered when coalesced calls to
     13           AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() failed to
     14           copy the layoutViewportOrigin to the scheduled update.
     15        3. The layout viewport could be left with a negative top/left after rubber-banding.
     16       
     17        Also add a way to do unconstrained scrollTo(), so that a test can call window.scrollTo(-10, -10) to
     18        simulate rubberbanding.
     19
     20        Tests: fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html
     21               fast/visual-viewport/rubberbanding-viewport-rects.html
     22
     23        * page/FrameView.cpp:
     24        (WebCore::FrameView::computeLayoutViewportOrigin): Handle ScrollBehaviorForFixedElements, incorporating it
     25        into logic that clamps layoutViewportOrigin between min/max when rubberbanding is not allowed, or not in progress.
     26        (WebCore::FrameView::updateLayoutViewport): Pass in scrollBehaviorForFixedElements().
     27        (WebCore::FrameView::visibleDocumentRect): The clamping here was preventing the visible rect from
     28        escaping the document bounds, which caused fixed elements to bounce with rubber-banding, so remove the clamping,
     29        and fix the logic to allow rubber-banding while taking headers and footers into account.
     30        * page/FrameView.h:
     31        * page/scrolling/AsyncScrollingCoordinator.cpp:
     32        (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): layoutViewportOrigin has to
     33        be pushed onto the scheduled update, just like scroll position.
     34        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
     35        (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): Pass in m_behaviorForFixed.
     36        * platform/ScrollView.cpp:
     37        (WebCore::ScrollView::ScrollView):
     38        (WebCore::ScrollView::adjustScrollPositionWithinRange):
     39        (WebCore::ScrollView::setScrollOffset):
     40        * platform/ScrollView.h:
     41        (WebCore::ScrollView::setAllowsUnclampedScrollPositionForTesting):
     42        (WebCore::ScrollView::allowsUnclampedScrollPosition):
     43        * testing/InternalSettings.cpp:
     44        (WebCore::InternalSettings::setAllowUnclampedScrollPosition):
     45        * testing/InternalSettings.h:
     46        * testing/InternalSettings.idl:
     47
    1482017-01-30  Wenson Hsieh  <wenson_hsieh@apple.com>
    249
  • trunk/Source/WebCore/page/FrameView.cpp

    r211082 r211379  
    18071807
    18081808// visualViewport and layoutViewport are both in content coordinates (unzoomed).
    1809 LayoutPoint FrameView::computeLayoutViewportOrigin(const LayoutRect& visualViewport, const LayoutPoint& stableLayoutViewportOriginMin, const LayoutPoint& stableLayoutViewportOriginMax, const LayoutRect& layoutViewport)
     1809LayoutPoint FrameView::computeLayoutViewportOrigin(const LayoutRect& visualViewport, const LayoutPoint& stableLayoutViewportOriginMin, const LayoutPoint& stableLayoutViewportOriginMax, const LayoutRect& layoutViewport, ScrollBehaviorForFixedElements fixedBehavior)
    18101810{
    18111811    LayoutPoint layoutViewportOrigin = layoutViewport.location();
     1812    bool allowRubberBanding = fixedBehavior == StickToViewportBounds;
    18121813
    18131814    if (visualViewport.width() > layoutViewport.width())
    18141815        layoutViewportOrigin.setX(visualViewport.x());
    18151816    else {
    1816         if (visualViewport.x() < layoutViewport.x() || visualViewport.x() < stableLayoutViewportOriginMin.x())
     1817        bool rubberbandingAtLeft = allowRubberBanding && visualViewport.x() < stableLayoutViewportOriginMin.x();
     1818        bool rubberbandingAtRight = allowRubberBanding && (visualViewport.maxX() - layoutViewport.width()) > stableLayoutViewportOriginMax.x();
     1819
     1820        if (visualViewport.x() < layoutViewport.x() || rubberbandingAtLeft)
    18171821            layoutViewportOrigin.setX(visualViewport.x());
    18181822
    1819         if (visualViewport.maxX() > layoutViewport.maxX() || (visualViewport.maxX() - layoutViewport.width()) > stableLayoutViewportOriginMax.x())
     1823        if (visualViewport.maxX() > layoutViewport.maxX() || rubberbandingAtRight)
    18201824            layoutViewportOrigin.setX(visualViewport.maxX() - layoutViewport.width());
     1825       
     1826        if (!rubberbandingAtLeft && layoutViewportOrigin.x() < stableLayoutViewportOriginMin.x())
     1827            layoutViewportOrigin.setX(stableLayoutViewportOriginMin.x());
     1828       
     1829        if (!rubberbandingAtRight && layoutViewportOrigin.x() > stableLayoutViewportOriginMax.x())
     1830            layoutViewportOrigin.setX(stableLayoutViewportOriginMax.x());
    18211831    }
    18221832
     
    18241834        layoutViewportOrigin.setY(visualViewport.y());
    18251835    else {
    1826         if (visualViewport.y() < layoutViewport.y() || visualViewport.y() < stableLayoutViewportOriginMin.y())
     1836        bool rubberbandingAtTop = allowRubberBanding && visualViewport.y() < stableLayoutViewportOriginMin.y();
     1837        bool rubberbandingAtBottom = allowRubberBanding && (visualViewport.maxY() - layoutViewport.height()) > stableLayoutViewportOriginMax.y();
     1838
     1839        if (visualViewport.y() < layoutViewport.y() || rubberbandingAtTop)
    18271840            layoutViewportOrigin.setY(visualViewport.y());
    18281841
    1829         if (visualViewport.maxY() > layoutViewport.maxY() || (visualViewport.maxY() - layoutViewport.height()) > stableLayoutViewportOriginMax.y())
     1842        if (visualViewport.maxY() > layoutViewport.maxY() || rubberbandingAtBottom)
    18301843            layoutViewportOrigin.setY(visualViewport.maxY() - layoutViewport.height());
     1844       
     1845        if (!rubberbandingAtTop && layoutViewportOrigin.y() < stableLayoutViewportOriginMin.y())
     1846            layoutViewportOrigin.setY(stableLayoutViewportOriginMin.y());
     1847       
     1848        if (!rubberbandingAtBottom && layoutViewportOrigin.y() > stableLayoutViewportOriginMax.y())
     1849            layoutViewportOrigin.setY(stableLayoutViewportOriginMax.y());
    18311850    }
    18321851
     
    18931912    LOG_WITH_STREAM(Scrolling, stream << "scroll positions: min: " << unscaledMinimumScrollPosition() << " max: "<< unscaledMaximumScrollPosition());
    18941913
    1895     LayoutPoint newLayoutViewportOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport);
     1914    LayoutPoint newLayoutViewportOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, scrollBehaviorForFixedElements());
    18961915    if (newLayoutViewportOrigin != m_layoutViewportOrigin) {
    18971916        setBaseLayoutViewportOrigin(newLayoutViewportOrigin);
     
    19351954LayoutRect FrameView::visibleDocumentRect(const FloatRect& visibleContentRect, float headerHeight, float footerHeight, const FloatSize& totalContentsSize, float pageScaleFactor)
    19361955{
     1956    float contentsHeight = totalContentsSize.height() - headerHeight - footerHeight;
     1957
     1958    float rubberBandTop = std::min<float>(visibleContentRect.y(), 0);
     1959    float visibleScaledDocumentTop = std::max<float>(visibleContentRect.y() - headerHeight, 0) + rubberBandTop;
     1960   
     1961    float rubberBandBottom = std::min<float>((totalContentsSize.height() - visibleContentRect.y()) - visibleContentRect.height(), 0);
     1962    float visibleScaledDocumentBottom = std::min<float>(visibleContentRect.maxY() - headerHeight, contentsHeight) + rubberBandBottom;
     1963
    19371964    FloatRect visibleDocumentRect = visibleContentRect;
    1938 
    1939     float contentsHeight = totalContentsSize.height() - headerHeight - footerHeight;
    1940 
    1941     float visibleScaledDocumentTop = std::max<float>(visibleContentRect.y() - headerHeight, 0);
    1942     float visibleScaledDocumentBottom = std::min<float>(visibleContentRect.maxY() - headerHeight, contentsHeight);
    1943 
    19441965    visibleDocumentRect.setY(visibleScaledDocumentTop);
    19451966    visibleDocumentRect.setHeight(std::max<float>(visibleScaledDocumentBottom - visibleScaledDocumentTop, 0));
    19461967    visibleDocumentRect.scale(1 / pageScaleFactor);
     1968   
    19471969    return LayoutRect(visibleDocumentRect);
    19481970}
  • trunk/Source/WebCore/page/FrameView.h

    r210797 r211379  
    305305    static LayoutPoint scrollPositionForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements, int headerHeight, int footerHeight);
    306306
    307     WEBCORE_EXPORT static LayoutPoint computeLayoutViewportOrigin(const LayoutRect& visualViewport, const LayoutPoint& stableLayoutViewportOriginMin, const LayoutPoint& stableLayoutViewportOriginMax, const LayoutRect& layoutViewport);
     307    WEBCORE_EXPORT static LayoutPoint computeLayoutViewportOrigin(const LayoutRect& visualViewport, const LayoutPoint& stableLayoutViewportOriginMin, const LayoutPoint& stableLayoutViewportOriginMax, const LayoutRect& layoutViewport, ScrollBehaviorForFixedElements fixedBehavior);
    308308
    309309    // These layers are positioned differently when there is a topContentInset, a header, or a footer. These value need to be computed
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r210560 r211379  
    270270        if (m_scheduledScrollUpdate.matchesUpdateType(scrollUpdate)) {
    271271            m_scheduledScrollUpdate.scrollPosition = scrollPosition;
     272            m_scheduledScrollUpdate.layoutViewportOrigin = layoutViewportOrigin;
    272273            return;
    273274        }
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp

    r210059 r211379  
    112112    LOG_WITH_STREAM(Scrolling, stream << "  scroll positions: min: " << minLayoutViewportOrigin() << " max: "<< maxLayoutViewportOrigin());
    113113
    114     LayoutPoint newLocation = FrameView::computeLayoutViewportOrigin(LayoutRect(visualViewport), LayoutPoint(minLayoutViewportOrigin()), LayoutPoint(maxLayoutViewportOrigin()), layoutViewport);
     114    LayoutPoint newLocation = FrameView::computeLayoutViewportOrigin(LayoutRect(visualViewport), LayoutPoint(minLayoutViewportOrigin()), LayoutPoint(maxLayoutViewportOrigin()), layoutViewport, m_behaviorForFixed);
    115115
    116116    if (layoutViewport.location() != newLocation) {
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r210758 r211379  
    4242
    4343ScrollView::ScrollView()
    44     : m_horizontalScrollbarMode(ScrollbarAuto)
    45     , m_verticalScrollbarMode(ScrollbarAuto)
    46     , m_horizontalScrollbarLock(false)
    47     , m_verticalScrollbarLock(false)
    48     , m_prohibitsScrolling(false)
    49     , m_canBlitOnScroll(true)
    50     , m_scrollbarsSuppressed(false)
    51     , m_inUpdateScrollbars(false)
    52     , m_updateScrollbarsPass(0)
    53     , m_drawPanScrollIcon(false)
    54     , m_useFixedLayout(false)
    55     , m_paintsEntireContents(false)
    56     , m_clipsRepaints(true)
    57     , m_delegatesScrolling(false)
    5844{
    5945}
     
    382368ScrollPosition ScrollView::adjustScrollPositionWithinRange(const ScrollPosition& scrollPoint) const
    383369{
    384     if (!constrainsScrollingToContentEdge())
     370    if (!constrainsScrollingToContentEdge() || m_allowsUnclampedScrollPosition)
    385371        return scrollPoint;
    386372
     
    419405void ScrollView::setScrollOffset(const ScrollOffset& offset)
    420406{
    421     LOG_WITH_STREAM(Scrolling, stream << "\nScrollView::setScrollOffset " << offset);
     407    LOG_WITH_STREAM(Scrolling, stream << "\nScrollView::setScrollOffset " << offset << " constrains " << constrainsScrollingToContentEdge());
    422408
    423409    IntPoint constrainedOffset = offset;
  • trunk/Source/WebCore/platform/ScrollView.h

    r210758 r211379  
    374374    WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset& oldOffset, const ScrollOffset& newOffset);
    375375
     376    void setAllowsUnclampedScrollPositionForTesting(bool allowsUnclampedScrollPosition) { m_allowsUnclampedScrollPosition = allowsUnclampedScrollPosition; }
     377    bool allowsUnclampedScrollPosition() const { return m_allowsUnclampedScrollPosition; }
     378
    376379protected:
    377380    ScrollView();
     
    434437    bool isScrollView() const final { return true; }
    435438
     439    HashSet<Ref<Widget>> m_children;
     440
    436441    RefPtr<Scrollbar> m_horizontalScrollbar;
    437442    RefPtr<Scrollbar> m_verticalScrollbar;
    438     ScrollbarMode m_horizontalScrollbarMode;
    439     ScrollbarMode m_verticalScrollbarMode;
    440 
    441     bool m_horizontalScrollbarLock;
    442     bool m_verticalScrollbarLock;
    443 
    444     bool m_prohibitsScrolling;
    445 
    446     HashSet<Ref<Widget>> m_children;
    447 
    448     // This bool is unused on Mac OS because we directly ask the platform widget
    449     // whether it is safe to blit on scroll.
    450     bool m_canBlitOnScroll;
     443    ScrollbarMode m_horizontalScrollbarMode { ScrollbarAuto };
     444    ScrollbarMode m_verticalScrollbarMode { ScrollbarAuto };
    451445
    452446#if PLATFORM(IOS)
     
    467461    std::optional<std::pair<ScrollOffset, ScrollOffset>> m_deferredScrollOffsets; // Needed for platform widget scrolling
    468462
    469     bool m_scrollbarsSuppressed;
    470 
    471     bool m_inUpdateScrollbars;
    472     unsigned m_updateScrollbarsPass;
    473 
    474463    IntPoint m_panScrollIconPoint;
    475     bool m_drawPanScrollIcon;
    476     bool m_useFixedLayout;
    477 
    478     bool m_paintsEntireContents;
    479     bool m_clipsRepaints;
    480     bool m_delegatesScrolling;
     464
     465    bool m_horizontalScrollbarLock { false };
     466    bool m_verticalScrollbarLock { false };
     467
     468    bool m_prohibitsScrolling { false };
     469    bool m_allowsUnclampedScrollPosition { false };
     470
     471    // This bool is unused on Mac OS because we directly ask the platform widget
     472    // whether it is safe to blit on scroll.
     473    bool m_canBlitOnScroll { true };
     474
     475    bool m_scrollbarsSuppressed { false };
     476
     477    bool m_inUpdateScrollbars { false };
     478    unsigned m_updateScrollbarsPass { 0 };
     479
     480    bool m_drawPanScrollIcon { false };
     481    bool m_useFixedLayout { false };
     482
     483    bool m_paintsEntireContents { false };
     484    bool m_clipsRepaints { true };
     485    bool m_delegatesScrolling { false };
     486
    481487
    482488    void init();
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r211341 r211379  
    641641}
    642642
     643ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUnclamped)
     644{
     645    if (!m_page || !m_page->mainFrame().view())
     646        return Exception { INVALID_ACCESS_ERR };
     647
     648    m_page->mainFrame().view()->setAllowsUnclampedScrollPositionForTesting(allowUnclamped);
     649    return { };
     650}
     651
    643652ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
    644653{
  • trunk/Source/WebCore/testing/InternalSettings.h

    r211341 r211379  
    8888    ExceptionOr<void> setShouldConvertPositionStyleOnCopy(bool);
    8989    ExceptionOr<void> setScrollingTreeIncludesFrames(bool);
     90    ExceptionOr<void> setAllowUnclampedScrollPosition(bool);
    9091    ExceptionOr<void> setAllowsInlineMediaPlayback(bool);
    9192    ExceptionOr<void> setAllowsInlineMediaPlaybackAfterFullscreen(bool);
  • trunk/Source/WebCore/testing/InternalSettings.idl

    r211341 r211379  
    7676    [MayThrowException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
    7777    [MayThrowException] void setScrollingTreeIncludesFrames(boolean enabled);
     78    [MayThrowException] void setAllowUnclampedScrollPosition(boolean allowUnclamped);
    7879
    7980    [MayThrowException] void setMinimumTimerInterval(unrestricted double intervalInSeconds);
  • trunk/Source/WebKit2/ChangeLog

    r211376 r211379  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fixed elements should not rubber-band in WK2, nor remain at negative offsets
     4        https://bugs.webkit.org/show_bug.cgi?id=167484
     5        rdar://problem/29453068
     6
     7        Reviewed by Dean Jackson.
     8
     9        Pass in StickToViewportBounds as we did before visual viewports.
     10
     11        * UIProcess/ios/WebPageProxyIOS.mm:
     12        (WebKit::WebPageProxy::computeCustomFixedPositionRect):
     13
    1142017-01-30  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r211356 r211379  
    269269    LayoutPoint layoutViewportOrigin;
    270270    if (isBelowMinimumScale)
    271         layoutViewportOrigin = FrameView::computeLayoutViewportOrigin(enclosingLayoutRect(constrainedUnobscuredRect), m_minStableLayoutViewportOrigin, m_maxStableLayoutViewportOrigin, enclosingLayoutRect(layoutViewportRect));
     271        layoutViewportOrigin = FrameView::computeLayoutViewportOrigin(enclosingLayoutRect(constrainedUnobscuredRect), m_minStableLayoutViewportOrigin, m_maxStableLayoutViewportOrigin, enclosingLayoutRect(layoutViewportRect), StickToViewportBounds);
    272272    else
    273         layoutViewportOrigin = FrameView::computeLayoutViewportOrigin(enclosingLayoutRect(unobscuredContentRectRespectingInputViewBounds), m_minStableLayoutViewportOrigin, m_maxStableLayoutViewportOrigin, enclosingLayoutRect(layoutViewportRect));
     273        layoutViewportOrigin = FrameView::computeLayoutViewportOrigin(enclosingLayoutRect(unobscuredContentRectRespectingInputViewBounds), m_minStableLayoutViewportOrigin, m_maxStableLayoutViewportOrigin, enclosingLayoutRect(layoutViewportRect), StickToViewportBounds);
    274274
    275275    if (constraint == UnobscuredRectConstraint::ConstrainedToDocumentRect) {
Note: See TracChangeset for help on using the changeset viewer.