WebKit Bugzilla
Attachment 358567 Details for
Bug 193215
: Cannot scroll for 5 seconds after swiping back on quoteunquoteapps.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193215-20190107194939.patch (text/plain), 8.27 KB, created by
Chris Dumez
on 2019-01-07 19:49:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-01-07 19:49:40 PST
Size:
8.27 KB
patch
obsolete
>Subversion Revision: 239634 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a378b23c3f6427b22fd9257c215c2dd99b0a9cae..c31e4acd7f005f2a6791dd9056b858927b938ab0 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,33 @@ >+2019-01-07 Chris Dumez <cdumez@apple.com> >+ >+ Cannot scoll for 5 seconds after swiping back on quoteunquoteapps.com >+ https://bugs.webkit.org/show_bug.cgi?id=193215 >+ <rdar://problem/45108222> >+ >+ Reviewed by Tim Horton. >+ >+ When doing the history navigation, if the source and destination history >+ items are clones then we will not trigger a main frame load. We may >+ however trigger loads in subframes if needed. This was an issue for the >+ ViewGestureController because it was expecting a main frame load after >+ calling WebPageProxy::goToBackForwardItem() in order to determine when >+ taking down the view snapshot is appropriate. >+ >+ To address the problem, the ViewGestureController now takes the snapshot >+ down as soon as the swipe gesture ends when the source and destination >+ items are clones. >+ >+ * Shared/WebBackForwardListItem.cpp: >+ (WebKit::childItemWithTarget): >+ (WebKit::WebBackForwardListItem::itemIsInSameDocument const): >+ (WebKit::hasSameFrames): >+ (WebKit::WebBackForwardListItem::itemIsClone): >+ * Shared/WebBackForwardListItem.h: >+ * UIProcess/ios/ViewGestureControllerIOS.mm: >+ (WebKit::ViewGestureController::endSwipeGesture): >+ * UIProcess/mac/ViewGestureControllerMac.mm: >+ (WebKit::ViewGestureController::endSwipeGesture): >+ > 2019-01-04 Youenn Fablet <youenn@apple.com> > > CSP violation reports should bypass CSP checks >diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp >index 0ccfda39376444429193c54833421a418bea007d..44d49c76f930f2f6d8ac846a90519ebd8e5af7f5 100644 >--- a/Source/WebCore/history/HistoryItem.cpp >+++ b/Source/WebCore/history/HistoryItem.cpp >@@ -372,6 +372,7 @@ void HistoryItem::clearChildren() > // - The other item corresponds to the same set of documents, including frames (for history entries created via regular navigation) > bool HistoryItem::shouldDoSameDocumentNavigationTo(HistoryItem& otherItem) const > { >+ // The following logic must be kept in sync with WebKit::WebBackForwardListItem::itemIsInSameDocument(). > if (this == &otherItem) > return false; > >diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp >index 5f38cda69137e7e1bea6658794a0129e0e92dfc7..5401eea71f6b519501d811e62ec11994271c07b2 100644 >--- a/Source/WebCore/loader/HistoryController.cpp >+++ b/Source/WebCore/loader/HistoryController.cpp >@@ -766,6 +766,7 @@ void HistoryController::recursiveGoToItem(HistoryItem& item, HistoryItem* fromIt > } > } > >+// The following logic must be kept in sync with WebKit::WebBackForwardListItem::itemIsClone(). > bool HistoryController::itemsAreClones(HistoryItem& item1, HistoryItem* item2) const > { > // If the item we're going to is a clone of the item we're at, then we do >diff --git a/Source/WebKit/Shared/WebBackForwardListItem.cpp b/Source/WebKit/Shared/WebBackForwardListItem.cpp >index 644fffccd02a09e8569ba16023fad3e069645425..03b43f1c97b1eb87ddc0f44153ec828f5ce44498 100644 >--- a/Source/WebKit/Shared/WebBackForwardListItem.cpp >+++ b/Source/WebKit/Shared/WebBackForwardListItem.cpp >@@ -77,6 +77,16 @@ static const FrameState* childItemWithDocumentSequenceNumber(const FrameState& f > return nullptr; > } > >+static const FrameState* childItemWithTarget(const FrameState& frameState, const String& target) >+{ >+ for (const auto& child : frameState.children) { >+ if (child.target == target) >+ return &child; >+ } >+ >+ return nullptr; >+} >+ > static bool documentTreesAreEqual(const FrameState& a, const FrameState& b) > { > if (a.documentSequenceNumber != b.documentSequenceNumber) >@@ -99,7 +109,7 @@ bool WebBackForwardListItem::itemIsInSameDocument(const WebBackForwardListItem& > if (m_pageID != other.m_pageID) > return false; > >- // The following logic must be kept in sync with WebCore::HistoryItem::shouldDoSameDocumentNavigationTo. >+ // The following logic must be kept in sync with WebCore::HistoryItem::shouldDoSameDocumentNavigationTo(). > > const FrameState& mainFrameState = m_itemState.pageState.mainFrameState; > const FrameState& otherMainFrameState = other.m_itemState.pageState.mainFrameState; >@@ -116,6 +126,38 @@ bool WebBackForwardListItem::itemIsInSameDocument(const WebBackForwardListItem& > return documentTreesAreEqual(mainFrameState, otherMainFrameState); > } > >+static bool hasSameFrames(const FrameState& a, const FrameState& b) >+{ >+ if (a.target != b.target) >+ return false; >+ >+ if (a.children.size() != b.children.size()) >+ return false; >+ >+ for (const auto& child : a.children) { >+ if (!childItemWithTarget(b, child.target)) >+ return false; >+ } >+ >+ return true; >+} >+ >+bool WebBackForwardListItem::itemIsClone(const WebBackForwardListItem& other) >+{ >+ // The following logic must be kept in sync with WebCore::HistoryItem::itemsAreClones(). >+ >+ if (this == &other) >+ return false; >+ >+ const FrameState& mainFrameState = m_itemState.pageState.mainFrameState; >+ const FrameState& otherMainFrameState = other.m_itemState.pageState.mainFrameState; >+ >+ if (mainFrameState.itemSequenceNumber != otherMainFrameState.itemSequenceNumber) >+ return false; >+ >+ return hasSameFrames(mainFrameState, otherMainFrameState); >+} >+ > void WebBackForwardListItem::setSuspendedPage(SuspendedPageProxy* page) > { > if (m_suspendedPage == page) >diff --git a/Source/WebKit/Shared/WebBackForwardListItem.h b/Source/WebKit/Shared/WebBackForwardListItem.h >index 3dad9b78d8214328fc7ad6de9c88ab601b331e2f..aaf6514e7a67c36187b11f99d7ad4e7d03efd4f2 100644 >--- a/Source/WebKit/Shared/WebBackForwardListItem.h >+++ b/Source/WebKit/Shared/WebBackForwardListItem.h >@@ -64,6 +64,7 @@ public: > const String& title() const { return m_itemState.pageState.title; } > > bool itemIsInSameDocument(const WebBackForwardListItem&) const; >+ bool itemIsClone(const WebBackForwardListItem&); > > #if PLATFORM(COCOA) > ViewSnapshot* snapshot() const { return m_itemState.snapshot.get(); } >diff --git a/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm b/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm >index 0d3711fb8d1f26d3c7609fc832c18eb5db5bfcc4..93319d2ad7129e542b9fdbf15994bc488f18e414 100644 >--- a/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm >+++ b/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm >@@ -300,6 +300,13 @@ void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem, > return; > } > >+ auto* currentItem = m_webPageProxyForBackForwardListForCurrentSwipe->backForwardList().currentItem(); >+ // The main frame will not be navigated so hide the snapshot right away. >+ if (currentItem && currentItem->itemIsClone(*targetItem)) { >+ removeSwipeSnapshot(); >+ return; >+ } >+ > // FIXME: Should we wait for VisuallyNonEmptyLayout like we do on Mac? > m_snapshotRemovalTracker.start(SnapshotRemovalTracker::RenderTreeSizeThreshold > | SnapshotRemovalTracker::RepaintAfterNavigation >diff --git a/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm b/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm >index cc44f8b3b6c2a615707d7045063ab0b83ca00e2a..6405ecdebac0599e82b368aff62264402750786c 100644 >--- a/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm >+++ b/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm >@@ -743,6 +743,13 @@ void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem, > m_webPageProxy.navigationGestureDidEnd(true, *targetItem); > m_webPageProxy.goToBackForwardItem(*targetItem); > >+ auto* currentItem = m_webPageProxy.backForwardList().currentItem(); >+ // The main frame will not be navigated so hide the snapshot right away. >+ if (currentItem && currentItem->itemIsClone(*targetItem)) { >+ removeSwipeSnapshot(); >+ return; >+ } >+ > SnapshotRemovalTracker::Events desiredEvents = SnapshotRemovalTracker::VisuallyNonEmptyLayout > | SnapshotRemovalTracker::MainFrameLoad > | SnapshotRemovalTracker::SubresourceLoads
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 193215
:
358536
|
358547
|
358563
| 358567