Diff
Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/ChangeLog 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog 2016-11-04 04:47:58 UTC (rev 208368)
@@ -1,5 +1,42 @@
2016-11-03 Matthew Hanson <matthew_han...@apple.com>
+ Merge r208340. rdar://problem/29092397
+
+ 2016-11-03 Dan Bernstein <m...@apple.com>
+
+ WKWebView’s _observedRenderingProgressEvents not restored after web process crash
+ https://bugs.webkit.org/show_bug.cgi?id=164368
+ <rdar://problem/29091954>
+
+ Reviewed by Anders Carlsson.
+
+ Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
+ (WebKit::WebPageCreationParameters::decode): Decode it.
+ * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
+ m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
+ (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
+ member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
+ (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
+ creation parameters.
+
+ * UIProcess/WebPageProxy.h: Declared new member variable, deleted
+ m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
+ m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
+
+2016-11-03 Matthew Hanson <matthew_han...@apple.com>
+
Merge r208307. rdar://problem/29078457
2016-11-02 David Kilzer <ddkil...@apple.com>
Modified: branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2016-11-04 04:47:58 UTC (rev 208368)
@@ -88,6 +88,7 @@
encoder << appleMailPaginationQuirkEnabled;
encoder << shouldScaleViewToFitDocument;
encoder.encodeEnum(userInterfaceLayoutDirection);
+ encoder.encodeEnum(observedLayoutMilestones);
}
bool WebPageCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebPageCreationParameters& parameters)
@@ -200,6 +201,8 @@
if (!decoder.decodeEnum(parameters.userInterfaceLayoutDirection))
return false;
+ if (!decoder.decodeEnum(parameters.observedLayoutMilestones))
+ return false;
return true;
}
Modified: branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.h (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.h 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/Shared/WebPageCreationParameters.h 2016-11-04 04:47:58 UTC (rev 208368)
@@ -35,6 +35,7 @@
#include <WebCore/Color.h>
#include <WebCore/FloatSize.h>
#include <WebCore/IntSize.h>
+#include <WebCore/LayoutMilestones.h>
#include <WebCore/Pagination.h>
#include <WebCore/ScrollTypes.h>
#include <WebCore/SessionID.h>
@@ -137,6 +138,7 @@
bool shouldScaleViewToFitDocument;
WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection;
+ WebCore::LayoutMilestones observedLayoutMilestones;
};
} // namespace WebKit
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-11-04 04:47:58 UTC (rev 208368)
@@ -429,7 +429,6 @@
, m_pageCount(0)
, m_renderTreeSize(0)
, m_sessionRestorationRenderTreeSize(0)
- , m_wantsSessionRestorationRenderTreeSizeThresholdEvent(false)
, m_hitRenderTreeSizeThreshold(false)
, m_suppressVisibilityUpdates(false)
, m_autoSizingShouldExpandToViewHeight(false)
@@ -2593,8 +2592,10 @@
if (!isValid())
return;
- m_wantsSessionRestorationRenderTreeSizeThresholdEvent = milestones & WebCore::ReachedSessionRestorationRenderTreeSizeThreshold;
+ if (milestones == m_observedLayoutMilestones)
+ return;
+ m_observedLayoutMilestones = milestones;
m_process->send(Messages::WebPage::ListenForLayoutMilestones(milestones), m_pageID);
}
@@ -5464,6 +5465,7 @@
#endif
parameters.shouldScaleViewToFitDocument = m_shouldScaleViewToFitDocument;
parameters.userInterfaceLayoutDirection = m_pageClient.userInterfaceLayoutDirection();
+ parameters.observedLayoutMilestones = m_observedLayoutMilestones;
return parameters;
}
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2016-11-04 04:47:58 UTC (rev 208368)
@@ -1663,6 +1663,8 @@
bool m_useFixedLayout;
WebCore::IntSize m_fixedLayoutSize;
+ WebCore::LayoutMilestones m_observedLayoutMilestones { 0 };
+
bool m_suppressScrollbarAnimations;
WebCore::Pagination::Mode m_paginationMode;
@@ -1814,7 +1816,6 @@
uint64_t m_renderTreeSize;
uint64_t m_sessionRestorationRenderTreeSize;
- bool m_wantsSessionRestorationRenderTreeSizeThresholdEvent;
bool m_hitRenderTreeSizeThreshold;
bool m_suppressVisibilityUpdates;
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-11-04 04:47:58 UTC (rev 208368)
@@ -361,7 +361,7 @@
m_pageClient.didCommitLayerTree(layerTreeTransaction);
// FIXME: Remove this special mechanism and fold it into the transaction's layout milestones.
- if (m_wantsSessionRestorationRenderTreeSizeThresholdEvent && !m_hitRenderTreeSizeThreshold
+ if ((m_observedLayoutMilestones & WebCore::ReachedSessionRestorationRenderTreeSizeThreshold) && !m_hitRenderTreeSizeThreshold
&& exceedsRenderTreeSizeSizeThreshold(m_sessionRestorationRenderTreeSize, layerTreeTransaction.renderTreeSize())) {
m_hitRenderTreeSizeThreshold = true;
didReachLayoutMilestone(WebCore::ReachedSessionRestorationRenderTreeSizeThreshold);
Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208367 => 208368)
--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-04 04:47:58 UTC (rev 208368)
@@ -561,6 +561,8 @@
if (parameters.viewScaleFactor != 1)
scaleView(parameters.viewScaleFactor);
+ m_page->addLayoutMilestones(parameters.observedLayoutMilestones);
+
#if PLATFORM(COCOA)
m_page->settings().setContentDispositionAttachmentSandboxEnabled(true);
#endif
Modified: branches/safari-602-branch/Tools/ChangeLog (208367 => 208368)
--- branches/safari-602-branch/Tools/ChangeLog 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Tools/ChangeLog 2016-11-04 04:47:58 UTC (rev 208368)
@@ -1,3 +1,19 @@
+2016-11-03 Matthew Hanson <matthew_han...@apple.com>
+
+ Merge r208340. rdar://problem/29092397
+
+ 2016-11-03 Dan Bernstein <m...@apple.com>
+
+ WKWebView’s _observedRenderingProgressEvents not restored after web process crash
+ https://bugs.webkit.org/show_bug.cgi?id=164368
+ <rdar://problem/29091954>
+
+ Reviewed by Anders Carlsson.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm: Added.
+ (TEST):
+
2016-10-26 Matthew Hanson <matthew_han...@apple.com>
Merge r206102. rdar://problem/28744106
Modified: branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (208367 => 208368)
--- branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2016-11-04 04:38:58 UTC (rev 208367)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2016-11-04 04:47:58 UTC (rev 208368)
@@ -89,6 +89,7 @@
378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; };
378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; };
379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
+ 37A22AA71DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */; };
37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */; };
37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */; };
37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
@@ -802,6 +803,7 @@
379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AcceptsFirstMouse.mm; sourceTree = "<group>"; };
379028B814FABE49007E6B43 /* acceptsFirstMouse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = acceptsFirstMouse.html; sourceTree = "<group>"; };
3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringByEvaluatingJavaScriptFromString.mm; sourceTree = "<group>"; };
+ 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObservedRenderingProgressEventsAfterCrash.mm; sourceTree = "<group>"; };
37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = "<group>"; };
37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShouldOpenExternalURLsInNewWindowActions.mm; sourceTree = "<group>"; };
37C784DE197C8F2E0010A496 /* RenderedImageFromDOMNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMNode.mm; sourceTree = "<group>"; };
@@ -1334,6 +1336,7 @@
51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */,
1ABC3DED1899BE6D004F0626 /* Navigation.mm */,
2ECFF5541D9B12F800B55394 /* NowPlayingControlsTests.mm */,
+ 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */,
CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */,
C95501BE19AD2FAF0049BE3E /* Preferences.mm */,
5798E2AF1CAF5C2800C5CBA0 /* ProvisionalURLNotChange.mm */,
@@ -2254,6 +2257,7 @@
7CCE7EE91A411AE600447C4C /* DidAssociateFormControls.cpp in Sources */,
7CCE7EEA1A411AE600447C4C /* DidNotHandleKeyDown.cpp in Sources */,
7CCE7EEB1A411AE600447C4C /* DocumentStartUserScriptAlertCrash.cpp in Sources */,
+ 37A22AA71DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm in Sources */,
7CCE7EBB1A411A7E00447C4C /* DOMHTMLTableCellCellAbove.mm in Sources */,
7CCE7EBC1A411A7E00447C4C /* DOMNodeFromJSObject.mm in Sources */,
1C2B81801C891E7C00A5529F /* CancelFontSubresource.mm in Sources */,
Added: branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm (0 => 208368)
--- branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm (rev 0)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm 2016-11-04 04:47:58 UTC (rev 208368)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#import "PlatformUtilities.h"
+#import "TestNavigationDelegate.h"
+#import <WebKit/WKWebViewConfigurationPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <wtf/RetainPtr.h>
+
+#if PLATFORM(MAC) && WK_API_ENABLED
+
+TEST(WebKit2, ObservedRenderingProgressEventsAfterCrash)
+{
+ __block bool done = false;
+ RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+ [configuration setSuppressesIncrementalRendering:YES];
+
+ RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
+
+ RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+ [window.get().contentView addSubview:webView.get()];
+
+ RetainPtr<TestNavigationDelegate> delegate = adoptNS([[TestNavigationDelegate alloc] init]);
+ [delegate setRenderingProgressDidChange:^(WKWebView *webView, _WKRenderingProgressEvents progressEvents) {
+ if (progressEvents & _WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering)
+ done = true;
+ }];
+
+ [webView setNavigationDelegate:delegate.get()];
+ [webView _setObservedRenderingProgressEvents:_WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering];
+ [webView _killWebContentProcessAndResetState];
+ [webView loadHTMLString:@"content" baseURL:nil];
+ TestWebKitAPI::Util::run(&done);
+}
+
+#endif