Changeset 200161 in webkit


Ignore:
Timestamp:
Apr 27, 2016 4:51:40 PM (8 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
https://bugs.webkit.org/show_bug.cgi?id=157107
rdar://problem/25943577

Reviewed by Tim Horton.
Source/WebCore:

Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.

  • page/FrameView.cpp:

(WebCore::FrameView::adjustTiledBackingScrollability):

  • page/Page.h:

(WebCore::Page::enclosedInScrollableAncestorView):
(WebCore::Page::setEnclosedInScrollableAncestorView):
(WebCore::Page::enclosedInScrollView): Deleted.
(WebCore::Page::setEnclosedInScrollView): Deleted.

Source/WebKit2:

We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
and that UIScrollView actually scrolls. This avoids falling back to small tiles in
MobileSafari.

Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.

  • Shared/VisibleContentRectUpdateInfo.cpp:

(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):

  • Shared/VisibleContentRectUpdateInfo.h:

(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
(WebKit::operator==):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.

  • UIProcess/API/Cocoa/WKWebView.mm:

(scrollViewCanScroll):
(-[WKWebView _updateContentRectsWithState:]):

  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentView.mm:

(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200159 r200161  
     12016-04-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
     4        https://bugs.webkit.org/show_bug.cgi?id=157107
     5        rdar://problem/25943577
     6
     7        Reviewed by Tim Horton.
     8
     9        Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
     10
     11        * page/FrameView.cpp:
     12        (WebCore::FrameView::adjustTiledBackingScrollability):
     13        * page/Page.h:
     14        (WebCore::Page::enclosedInScrollableAncestorView):
     15        (WebCore::Page::setEnclosedInScrollableAncestorView):
     16        (WebCore::Page::enclosedInScrollView): Deleted.
     17        (WebCore::Page::setEnclosedInScrollView): Deleted.
     18
    1192016-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
    220
  • trunk/Source/WebCore/page/FrameView.cpp

    r200116 r200161  
    24882488#if PLATFORM(IOS)
    24892489    if (Page* page = frame().page())
    2490         clippedByAncestorView |= page->enclosedInScrollView();
     2490        clippedByAncestorView |= page->enclosedInScrollableAncestorView();
    24912491#endif
    24922492
  • trunk/Source/WebCore/page/Page.h

    r199955 r200161  
    300300    void setObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
    301301   
    302     bool enclosedInScrollView() const { return m_enclosedInScrollView; }
    303     void setEnclosedInScrollView(bool f) { m_enclosedInScrollView = f; }
     302    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
     303    void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
    304304#endif
    305305
     
    613613    // This is only used for history scroll position restoration.
    614614    FloatSize m_obscuredInset;
    615     bool m_enclosedInScrollView { false };
     615    bool m_enclosedInScrollableAncestorView { false };
    616616#endif
    617617
  • trunk/Source/WebKit2/ChangeLog

    r200157 r200161  
     12016-04-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
     4        https://bugs.webkit.org/show_bug.cgi?id=157107
     5        rdar://problem/25943577
     6
     7        Reviewed by Tim Horton.
     8       
     9        We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
     10        and that UIScrollView actually scrolls. This avoids falling back to small tiles in
     11        MobileSafari.
     12
     13        Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
     14
     15        * Shared/VisibleContentRectUpdateInfo.cpp:
     16        (WebKit::VisibleContentRectUpdateInfo::encode):
     17        (WebKit::VisibleContentRectUpdateInfo::decode):
     18        * Shared/VisibleContentRectUpdateInfo.h:
     19        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
     20        (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
     21        (WebKit::operator==):
     22        (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
     23        * UIProcess/API/Cocoa/WKWebView.mm:
     24        (scrollViewCanScroll):
     25        (-[WKWebView _updateContentRectsWithState:]):
     26        * UIProcess/ios/WKContentView.h:
     27        * UIProcess/ios/WKContentView.mm:
     28        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
     29        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
     30        * WebProcess/WebPage/ios/WebPageIOS.mm:
     31        (WebKit::WebPage::updateVisibleContentRects):
     32
    1332016-04-26  Ada Chan  <adachan@apple.com>
    234
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp

    r199259 r200161  
    4747    encoder << m_isChangingObscuredInsetsInteractively;
    4848    encoder << m_allowShrinkToFit;
    49     encoder << m_enclosedInScrollView;
     49    encoder << m_enclosedInScrollableAncestorView;
    5050}
    5151
     
    8080    if (!decoder.decode(result.m_allowShrinkToFit))
    8181        return false;
    82     if (!decoder.decode(result.m_enclosedInScrollView))
     82    if (!decoder.decode(result.m_enclosedInScrollableAncestorView))
    8383        return false;
    8484
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h

    r199259 r200161  
    4242    VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
    4343        const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect,
    44         const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollView,
     44        const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
    4545        double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
    4646        : m_exposedContentRect(exposedContentRect)
     
    5858        , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
    5959        , m_allowShrinkToFit(allowShrinkToFit)
    60         , m_enclosedInScrollView(enclosedInScrollView)
     60        , m_enclosedInScrollableAncestorView(enclosedInScrollableAncestorView)
    6161    {
    6262    }
     
    7272    bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
    7373    bool allowShrinkToFit() const { return m_allowShrinkToFit; }
    74     bool enclosedInScrollView() const { return m_enclosedInScrollView; }
     74    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
    7575
    7676    double timestamp() const { return m_timestamp; }
     
    9999    bool m_isChangingObscuredInsetsInteractively { false };
    100100    bool m_allowShrinkToFit { false };
    101     bool m_enclosedInScrollView { false };
     101    bool m_enclosedInScrollableAncestorView { false };
    102102};
    103103
     
    115115        && a.inStableState() == b.inStableState()
    116116        && a.allowShrinkToFit() == b.allowShrinkToFit()
    117         && a.enclosedInScrollView() == b.enclosedInScrollView();
     117        && a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView();
    118118}
    119119
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r200116 r200161  
    19871987}
    19881988
     1989static bool scrollViewCanScroll(UIScrollView *scrollView)
     1990{
     1991    if (!scrollView)
     1992        return NO;
     1993
     1994    UIEdgeInsets contentInset = scrollView.contentInset;
     1995    CGSize contentSize = scrollView.contentSize;
     1996    CGSize boundsSize = scrollView.bounds.size;
     1997
     1998    return (contentSize.width + contentInset.left + contentInset.right) > boundsSize.width
     1999        || (contentSize.height + contentInset.top + contentInset.bottom) > boundsSize.height;
     2000}
     2001
    19892002- (void)_updateContentRectsWithState:(BOOL)inStableState
    19902003{
     
    20432056        inStableState:inStableState
    20442057        isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively
    2045         enclosedInScrollView:[self _scroller] != nil];
     2058        enclosedInScrollableAncestorView:scrollViewCanScroll([self _scroller])];
    20462059}
    20472060
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.h

    r199259 r200161  
    7373    inStableState:(BOOL)isStableState
    7474    isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
    75     enclosedInScrollView:(BOOL)enclosedInScrollView;
     75    enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView;
    7676
    7777- (void)didFinishScrolling;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r199259 r200161  
    357357
    358358- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
    359     obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively enclosedInScrollView:(BOOL)enclosedInScrollView
     359    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView
    360360{
    361361    auto drawingArea = _page->drawingArea();
     
    382382        isChangingObscuredInsetsInteractively,
    383383        _webView._allowsViewportShrinkToFit,
    384         enclosedInScrollView,
     384        enclosedInScrollableAncestorView,
    385385        timestamp,
    386386        velocityData.horizontalVelocity,
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r200098 r200161  
    29682968    frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
    29692969    m_page->setObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
    2970     m_page->setEnclosedInScrollView(visibleContentRectUpdateInfo.enclosedInScrollView());
     2970    m_page->setEnclosedInScrollableAncestorView(visibleContentRectUpdateInfo.enclosedInScrollableAncestorView());
    29712971
    29722972    double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
Note: See TracChangeset for help on using the changeset viewer.