Changeset 235157 in webkit
- Timestamp:
- Aug 21, 2018 8:51:52 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r235156 r235157 1 2018-08-21 Alex Christensen <achristensen@webkit.org> 2 3 Roll out r235139 and r235146 4 https://bugs.webkit.org/show_bug.cgi?id=188805 5 6 It turns out shouldKeepCurrentBackForwardListItemInList has one use left. 7 8 * UIProcess/API/APILoaderClient.h: 9 (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): 10 * UIProcess/API/C/WKPage.cpp: 11 (WKPageSetPageLoaderClient): 12 * UIProcess/WebBackForwardList.cpp: 13 (WebKit::WebBackForwardList::addItem): 14 (WebKit::WebBackForwardList::goToItem): 15 * UIProcess/WebPageProxy.cpp: 16 (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): 17 * UIProcess/WebPageProxy.h: 18 1 19 2018-08-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/API/APILoaderClient.h
r235139 r235157 91 91 92 92 virtual void didChangeBackForwardList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, Vector<Ref<WebKit::WebBackForwardListItem>>&&) { } 93 virtual bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&) { return true; } 93 94 virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&, API::Object*) { } 94 95 -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r235139 r235157 1043 1043 { 1044 1044 initialize(client); 1045 ASSERT(!m_client.shouldKeepCurrentBackForwardListItemInList);1046 1045 } 1047 1046 … … 1248 1247 1249 1248 m_client.didChangeBackForwardList(toAPI(&page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo); 1249 } 1250 1251 bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy& page, WebKit::WebBackForwardListItem& item) override 1252 { 1253 if (!m_client.shouldKeepCurrentBackForwardListItemInList) 1254 return true; 1255 1256 return m_client.shouldKeepCurrentBackForwardListItemInList(toAPI(&page), toAPI(&item), m_client.base.clientInfo); 1250 1257 } 1251 1258 -
trunk/Source/WebKit/UIProcess/WebBackForwardList.cpp
r235146 r235157 142 142 m_currentIndex = 0; 143 143 m_hasCurrentIndex = true; 144 } else 145 m_currentIndex++; 144 } else { 145 shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex]); 146 if (shouldKeepCurrentItem) 147 m_currentIndex++; 148 } 146 149 147 150 auto* newItemPtr = newItem.ptr(); … … 196 199 // item should remain in the list. 197 200 auto& currentItem = m_entries[m_currentIndex]; 198 if (currentItem.ptr() != &item) 201 bool shouldKeepCurrentItem = true; 202 if (currentItem.ptr() != &item) { 199 203 m_page->recordAutomaticNavigationSnapshot(); 204 shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex]); 205 } 206 207 // If the client said to remove the current item, remove it and then update the target index. 208 Vector<Ref<WebBackForwardListItem>> removedItems; 209 if (!shouldKeepCurrentItem) { 210 removedItems.append(currentItem.copyRef()); 211 m_entries.remove(m_currentIndex); 212 targetIndex = notFound; 213 for (size_t i = 0; i < m_entries.size(); ++i) { 214 if (m_entries[i].ptr() == &item) { 215 targetIndex = i; 216 break; 217 } 218 } 219 ASSERT(targetIndex != notFound); 220 } 200 221 201 222 m_currentIndex = targetIndex; 202 223 203 224 LOG(BackForward, "(Back/Forward) WebBackForwardList %p going to item %s, is now at index %zu", this, item.itemID().logString(), targetIndex); 204 m_page->didChangeBackForwardList(nullptr, { });225 m_page->didChangeBackForwardList(nullptr, WTFMove(removedItems)); 205 226 } 206 227 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r235156 r235157 1291 1291 } 1292 1292 1293 bool WebPageProxy::shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem& item) 1294 { 1295 PageClientProtector protector(m_pageClient); 1296 1297 return m_loaderClient->shouldKeepCurrentBackForwardListItemInList(*this, item); 1298 } 1299 1293 1300 bool WebPageProxy::canShowMIMEType(const String& mimeType) 1294 1301 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r235156 r235157 469 469 void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache, const UserData&); 470 470 471 bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&); 472 471 473 bool willHandleHorizontalScrollEvents() const; 472 474 -
trunk/Tools/ChangeLog
r235156 r235157 1 2018-08-21 Alex Christensen <achristensen@webkit.org> 2 3 Roll out r235139 and r235146 4 https://bugs.webkit.org/show_bug.cgi?id=188805 5 6 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 7 * TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp: 8 1 9 2018-08-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 10 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r235140 r235157 534 534 7CCE7F121A411AE600447C4C /* ScrollPinningBehaviors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */; }; 535 535 7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */; }; 536 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */; }; 536 537 7CCE7F151A411AE600447C4C /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; }; 537 538 7CCE7F161A411AE600447C4C /* TerminateTwice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */; }; … … 1498 1499 51D124971E763AF8002B2820 /* WKHTTPCookieStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKHTTPCookieStore.mm; sourceTree = "<group>"; }; 1499 1500 51DB16CD1F085047001FA4C5 /* WebViewIconLoading.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewIconLoading.mm; sourceTree = "<group>"; }; 1501 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShouldKeepCurrentBackForwardListItemInList.cpp; sourceTree = "<group>"; }; 1500 1502 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageClear.mm; sourceTree = "<group>"; }; 1501 1503 51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LocalStorageClear.html; sourceTree = "<group>"; }; … … 2934 2936 51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */, 2935 2937 51FCF7971534AC6D00104491 /* ShouldGoToBackForwardListItem_Bundle.cpp */, 2938 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */, 2936 2939 C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */, 2937 2940 76734997193016DC00E44DF9 /* StopLoadingDuringDidFailProvisionalLoad.cpp */, … … 3941 3944 A179918B1E1CA24100A505ED /* SharedBufferTest.cpp in Sources */, 3942 3945 7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */, 3946 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */, 3943 3947 37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */, 3944 3948 7C83E0C51D0A654600FEBCF3 /* ShrinkToFit.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.