WebKit Bugzilla
Attachment 372755 Details for
Bug 199152
: [iOS] Scrolling on an enlarged Facebook video gets locked on the main frame
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
main-frame-bounce.patch (text/plain), 11.41 KB, created by
Antti Koivisto
on 2019-06-24 07:08:08 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-06-24 07:08:08 PDT
Size:
11.41 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 246632) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,22 @@ >+2019-06-24 Antti Koivisto <antti@apple.com> >+ >+ [iOS] Scrolling on an enlarged Facebook video gets locked on the main frame >+ https://bugs.webkit.org/show_bug.cgi?id=199152 >+ <rdar://problem/51376074> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * page/scrolling/ScrollingTree.cpp: >+ (WebCore::ScrollingTree::commitTreeState): >+ (WebCore::ScrollingTree::updateLargestNonMainScrollableArea): >+ >+ Find out the size of the largest scrollable area during commit. >+ >+ * page/scrolling/ScrollingTree.h: >+ (WebCore::ScrollingTree::largestNonMainScrollableAreaSize const): >+ * page/scrolling/ScrollingTreeScrollingNode.cpp: >+ (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): >+ > 2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Remove support for GTK2 plugins >Index: Source/WebCore/page/scrolling/ScrollingTree.cpp >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingTree.cpp (revision 246632) >+++ Source/WebCore/page/scrolling/ScrollingTree.cpp (working copy) >@@ -171,6 +171,8 @@ void ScrollingTree::commitTreeState(std: > m_overflowRelatedNodesMap.clear(); > m_positionedNodesWithRelatedOverflow.clear(); > >+ m_largestNonMainScrollableAreaSize = { }; >+ > // orphanNodes keeps child nodes alive while we rebuild child lists. > OrphanScrollingNodeMap orphanNodes; > updateTreeFromStateNode(rootNode, orphanNodes, unvisitedNodes); >@@ -454,6 +456,18 @@ void ScrollingTree::clearLatchedNode() > m_treeState.latchedNodeID = 0; > } > >+void ScrollingTree::updateLargestNonMainScrollableArea(ScrollingTreeScrollingNode& scrollingNode) >+{ >+ if (!scrollingNode.parent()) >+ return; >+ if (!scrollingNode.canHaveScrollbars()) >+ return; >+ auto scrollableAreaSize = scrollingNode.scrollableAreaSize(); >+ if (scrollableAreaSize.area() <= m_largestNonMainScrollableAreaSize.area()) >+ return; >+ m_largestNonMainScrollableAreaSize = scrollableAreaSize; >+} >+ > String ScrollingTree::scrollingTreeAsText(ScrollingStateTreeAsTextBehavior behavior) > { > TextStream ts(TextStream::LineMode::MultipleLine); >Index: Source/WebCore/page/scrolling/ScrollingTree.h >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingTree.h (revision 246632) >+++ Source/WebCore/page/scrolling/ScrollingTree.h (working copy) >@@ -156,6 +156,9 @@ public: > > HashSet<ScrollingNodeID>& positionedNodesWithRelatedOverflow() { return m_positionedNodesWithRelatedOverflow; } > >+ FloatSize largestNonMainScrollableAreaSize() const { return m_largestNonMainScrollableAreaSize; } >+ void updateLargestNonMainScrollableArea(ScrollingTreeScrollingNode&); >+ > WEBCORE_EXPORT String scrollingTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal); > > protected: >@@ -181,6 +184,8 @@ private: > RelatedNodesMap m_overflowRelatedNodesMap; > HashSet<ScrollingNodeID> m_positionedNodesWithRelatedOverflow; > >+ FloatSize m_largestNonMainScrollableAreaSize; >+ > struct TreeState { > ScrollingNodeID latchedNodeID { 0 }; > EventTrackingRegions eventTrackingRegions; >Index: Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (revision 246632) >+++ Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (working copy) >@@ -104,6 +104,8 @@ void ScrollingTreeScrollingNode::commitS > if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) > m_scrolledContentsLayer = state.scrolledContentsLayer(); > #endif >+ >+ scrollingTree().updateLargestNonMainScrollableArea(*this); > } > > void ScrollingTreeScrollingNode::commitStateAfterChildren(const ScrollingStateNode& stateNode) >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 246731) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,39 @@ >+2019-06-24 Antti Koivisto <antti@apple.com> >+ >+ [iOS] Scrolling on an enlarged Facebook video gets locked on the main frame >+ https://bugs.webkit.org/show_bug.cgi?id=199152 >+ <rdar://problem/51376074> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Scrollable content on the page consists is in overflow scrollers, the main frame is not scrollable. However we still enable >+ vertical rubberbanding in the main frame. >+ >+ Any swipe the reaches the end of a scrolled content ends up rubberbanding the main view. When rubberbanding is in progress >+ other scrollers don't receive swipes, further attempts just keep the main view in in rubberbanding state. This >+ makes scrolling feel glitchy (rubberbanding is only observable in the scrollbar since no content moves). >+ >+ This patch disables rubberbanding in non-scrollable main frame if it contains a scrollable element that covers at least >+ 50% of the view. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _didCommitLayerTree:]): >+ >+ Enable rubberbanding as needed. >+ >+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: >+ (WebKit::RemoteScrollingCoordinatorProxy::hasLargeNonMainScrollableArea const): >+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: >+ * UIProcess/ios/WKScrollView.h: >+ * UIProcess/ios/WKScrollView.mm: >+ (-[WKScrollView initWithFrame:]): >+ (-[WKScrollView _setAlwaysBounceVerticalInternal:]): >+ >+ Have a separate internal bit so clients can still disable rubberbanding completely. >+ >+ (-[WKScrollView setAlwaysBounceVertical:]): >+ (-[WKScrollView _updateAlwaysBounceVertical]): >+ > 2019-06-23 Dan Bernstein <mitz@apple.com> > > Platform font class gets needlessly initialized in the Networking process >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 246632) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -2016,6 +2016,8 @@ - (void)_didCommitLayerTree:(const WebKi > bool hasDockedInputView = !CGRectIsEmpty(_inputViewBounds); > bool isZoomed = layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor(); > [_scrollView _setScrollEnabledInternal:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame() || hasDockedInputView || isZoomed]; >+ // Bounce captures scrolling when in progress. Disable bouncing of non-scrollable main content if there are other significant scrollable elements on the page. >+ [_scrollView _setAlwaysBounceVerticalInternal:!_page->scrollingCoordinatorProxy()->hasLargeNonMainScrollableArea()]; > #endif > if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor()) { > LOG_WITH_STREAM(VisibleRects, stream << " updating scroll view with pageScaleFactor " << layerTreeTransaction.pageScaleFactor()); >Index: Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (revision 246632) >+++ Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (working copy) >@@ -246,6 +246,18 @@ bool RemoteScrollingCoordinatorProxy::ha > return rootNode && rootNode->canHaveScrollbars(); > } > >+bool RemoteScrollingCoordinatorProxy::hasLargeNonMainScrollableArea() const >+{ >+ auto* rootNode = m_scrollingTree->rootNode(); >+ if (!rootNode) >+ return false; >+ >+ auto rootScrollableAreaSize = rootNode->scrollableAreaSize(); >+ auto largestNonMainScrollableAreaSize = m_scrollingTree->largestNonMainScrollableAreaSize(); >+ // A more fancy approach would be to count the total area covered by subscrollers. >+ return largestNonMainScrollableAreaSize.area() => rootScrollableAreaSize.area() / 2; >+} >+ > #if ENABLE(POINTER_EVENTS) > OptionSet<TouchAction> RemoteScrollingCoordinatorProxy::activeTouchActionsForTouchIdentifier(unsigned touchIdentifier) const > { >Index: Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (revision 246632) >+++ Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (working copy) >@@ -85,6 +85,7 @@ public: > bool propagatesMainFrameScrolls() const { return m_propagatesMainFrameScrolls; } > bool hasFixedOrSticky() const { return m_scrollingTree->hasFixedOrSticky(); } > bool hasScrollableMainFrame() const; >+ bool hasLargeNonMainScrollableArea() const; > > #if PLATFORM(IOS_FAMILY) > WebCore::FloatRect currentLayoutViewport() const; >Index: Source/WebKit/UIProcess/ios/WKScrollView.h >=================================================================== >--- Source/WebKit/UIProcess/ios/WKScrollView.h (revision 246632) >+++ Source/WebKit/UIProcess/ios/WKScrollView.h (working copy) >@@ -36,6 +36,7 @@ > - (void)_setContentSizePreservingContentOffsetDuringRubberband:(CGSize)contentSize; > - (void)_setScrollEnabledInternal:(BOOL)enabled; > - (void)_setZoomEnabledInternal:(BOOL)enabled; >+- (void)_setAlwaysBounceVerticalInternal:(BOOL)enabled; > > #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 > @property (nonatomic, assign, readonly) BOOL _contentInsetAdjustmentBehaviorWasExternallyOverridden; >Index: Source/WebKit/UIProcess/ios/WKScrollView.mm >=================================================================== >--- Source/WebKit/UIProcess/ios/WKScrollView.mm (revision 246632) >+++ Source/WebKit/UIProcess/ios/WKScrollView.mm (working copy) >@@ -134,6 +134,8 @@ - (id)forwardingTargetForSelector:(SEL)a > BOOL _scrollEnabledInternal; > BOOL _zoomEnabledByClient; > BOOL _zoomEnabledInternal; >+ BOOL _alwaysBounceVerticalEnabledByClient; >+ BOOL _alwaysBounceVerticalEnabledInternal; > } > > - (id)initWithFrame:(CGRect)frame >@@ -147,8 +149,9 @@ - (id)initWithFrame:(CGRect)frame > _scrollEnabledInternal = YES; > _zoomEnabledByClient = YES; > _zoomEnabledInternal = YES; >+ _alwaysBounceVerticalEnabledByClient = YES; >+ [self _setAlwaysBounceVerticalInternal:YES]; > >- self.alwaysBounceVertical = YES; > self.directionalLockEnabled = YES; > [self _setIndicatorInsetAdjustmentBehavior:UIScrollViewIndicatorInsetAdjustmentAlways]; > >@@ -397,6 +400,23 @@ - (void)_updateZoomability > [super setZoomEnabled:(_zoomEnabledByClient && _zoomEnabledInternal)]; > } > >+- (void)_setAlwaysBounceVerticalInternal:(BOOL)value >+{ >+ _alwaysBounceVerticalEnabledByClient = value; >+ [self _updateAlwaysBounceVertical]; >+} >+ >+- (void)setAlwaysBounceVertical:(BOOL)value >+{ >+ _alwaysBounceVerticalEnabledInternal = value; >+ [self _updateAlwaysBounceVertical]; >+} >+ >+- (void)_updateAlwaysBounceVertical >+{ >+ [super setAlwaysBounceVertical:(_alwaysBounceVerticalEnabledByClient && _alwaysBounceVerticalEnabledInternal)]; >+} >+ > #if PLATFORM(WATCHOS) > > - (void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199152
:
372755
|
372757
|
372758
|
372767