Title: [218121] trunk
Revision
218121
Author
cdu...@apple.com
Date
2017-06-12 11:55:32 -0700 (Mon, 12 Jun 2017)

Log Message

Regression(r217867): Legacy SessionHistoryEntryData format should not change
https://bugs.webkit.org/show_bug.cgi?id=173267
<rdar://problem/32701257>

Reviewed by Simon Fraser.

Source/WebKit2:

Revert changes to Legacy SessionHistoryEntryData format that were made in r217867,
as this apparently breaks compatiblity.

* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFrameStateNode):
(WebKit::decodeBackForwardTreeNode):

Tools:

Restrict test to stop covering saving / restore of scrollRestoration via the legacy
SessionHistoryEntryData. Maintain coverage for the default value of scrollRestoration
though as this covers the crash that r217867 was fixing.

* TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp:
(TestWebKitAPI::createSessionStateData):
(TestWebKitAPI::TEST):
(TestWebKitAPI::createSessionStateDataContainingScrollRestoration): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218120 => 218121)


--- trunk/Source/WebKit2/ChangeLog	2017-06-12 18:49:19 UTC (rev 218120)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-12 18:55:32 UTC (rev 218121)
@@ -1,3 +1,18 @@
+2017-06-12  Chris Dumez  <cdu...@apple.com>
+
+        Regression(r217867): Legacy SessionHistoryEntryData format should not change
+        https://bugs.webkit.org/show_bug.cgi?id=173267
+        <rdar://problem/32701257>
+
+        Reviewed by Simon Fraser.
+
+        Revert changes to Legacy SessionHistoryEntryData format that were made in r217867,
+        as this apparently breaks compatiblity.
+
+        * UIProcess/mac/LegacySessionStateCoding.cpp:
+        (WebKit::encodeFrameStateNode):
+        (WebKit::decodeBackForwardTreeNode):
+
 2017-06-12  Brent Fulgham  <bfulg...@apple.com>
 
         [WK2][macOS] Alow iokit-get-properties for additional media features

Modified: trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp (218120 => 218121)


--- trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp	2017-06-12 18:49:19 UTC (rev 218120)
+++ trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp	2017-06-12 18:55:32 UTC (rev 218121)
@@ -346,7 +346,6 @@
     encoder << frameState.scrollPosition.x();
     encoder << frameState.scrollPosition.y();
 
-    encoder << frameState.shouldRestoreScrollPosition;
     encoder << frameState.pageScaleFactor;
 
     encoder << !!frameState.stateObjectData;
@@ -929,7 +928,6 @@
 
     frameState.scrollPosition = WebCore::IntPoint(scrollPositionX, scrollPositionY);
 
-    decoder >> frameState.shouldRestoreScrollPosition;
     decoder >> frameState.pageScaleFactor;
 
     bool hasStateObject;

Modified: trunk/Tools/ChangeLog (218120 => 218121)


--- trunk/Tools/ChangeLog	2017-06-12 18:49:19 UTC (rev 218120)
+++ trunk/Tools/ChangeLog	2017-06-12 18:55:32 UTC (rev 218121)
@@ -1,3 +1,20 @@
+2017-06-12  Chris Dumez  <cdu...@apple.com>
+
+        Regression(r217867): Legacy SessionHistoryEntryData format should not change
+        https://bugs.webkit.org/show_bug.cgi?id=173267
+        <rdar://problem/32701257>
+
+        Reviewed by Simon Fraser.
+
+        Restrict test to stop covering saving / restore of scrollRestoration via the legacy
+        SessionHistoryEntryData. Maintain coverage for the default value of scrollRestoration
+        though as this covers the crash that r217867 was fixing.
+
+        * TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp:
+        (TestWebKitAPI::createSessionStateData):
+        (TestWebKitAPI::TEST):
+        (TestWebKitAPI::createSessionStateDataContainingScrollRestoration): Deleted.
+
 2017-06-12  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Stop dismissing menus attached to the web view for every injected event

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp (218120 => 218121)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp	2017-06-12 18:49:19 UTC (rev 218120)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp	2017-06-12 18:55:32 UTC (rev 218121)
@@ -53,7 +53,7 @@
     WKPageSetPageLoaderClient(page, &loaderClient.base);
 }
 
-static WKRetainPtr<WKDataRef> createSessionStateDataContainingScrollRestoration(WKContextRef context, std::function<void(WKPageRef)> apply)
+static WKRetainPtr<WKDataRef> createSessionStateData(WKContextRef context)
 {
     PlatformWebView webView(context);
     setPageLoaderClient(webView.page());
@@ -62,52 +62,10 @@
     Util::run(&didFinishLoad);
     didFinishLoad = false;
 
-    apply(webView.page());
-
     auto sessionState = adoptWK(static_cast<WKSessionStateRef>(WKPageCopySessionState(webView.page(), reinterpret_cast<void*>(1), nullptr)));
     return adoptWK(WKSessionStateCopyData(sessionState.get()));
 }
 
-TEST(WebKit2, RestoreSessionStateContainingScrollRestorationManual)
-{
-    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
-
-    PlatformWebView webView(context.get());
-    setPageLoaderClient(webView.page());
-
-    WKRetainPtr<WKDataRef> data = "" [](WKPageRef page) {
-        EXPECT_JS_EQ(page, "history.scrollRestoration = 'manual'", "manual");
-    });
-    EXPECT_NOT_NULL(data);
-
-    auto sessionState = adoptWK(WKSessionStateCreateFromData(data.get()));
-    WKPageRestoreFromSessionState(webView.page(), sessionState.get());
-
-    Util::run(&didFinishLoad);
-
-    EXPECT_JS_EQ(webView.page(), "history.scrollRestoration", "manual");
-}
-
-TEST(WebKit2, RestoreSessionStateContainingScrollRestorationAuto)
-{
-    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
-
-    PlatformWebView webView(context.get());
-    setPageLoaderClient(webView.page());
-
-    WKRetainPtr<WKDataRef> data = "" [](WKPageRef page) {
-        EXPECT_JS_EQ(page, "history.scrollRestoration = 'auto'", "auto");
-    });
-    EXPECT_NOT_NULL(data);
-
-    auto sessionState = adoptWK(WKSessionStateCreateFromData(data.get()));
-    WKPageRestoreFromSessionState(webView.page(), sessionState.get());
-
-    Util::run(&didFinishLoad);
-
-    EXPECT_JS_EQ(webView.page(), "history.scrollRestoration", "auto");
-}
-
 TEST(WebKit2, RestoreSessionStateContainingScrollRestorationDefault)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
@@ -115,8 +73,7 @@
     PlatformWebView webView(context.get());
     setPageLoaderClient(webView.page());
 
-    WKRetainPtr<WKDataRef> data = "" [](WKPageRef) {
-    });
+    WKRetainPtr<WKDataRef> data = ""
     EXPECT_NOT_NULL(data);
 
     auto sessionState = adoptWK(WKSessionStateCreateFromData(data.get()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to