Title: [211838] trunk/Source/WebKit2
Revision
211838
Author
ander...@apple.com
Date
2017-02-07 14:09:03 -0800 (Tue, 07 Feb 2017)

Log Message

REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
https://bugs.webkit.org/show_bug.cgi?id=167947

Reviewed by Tim Horton.

* Platform/spi/ios/UIKitSPI.h:
Add SPI declaration.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Make sure to call setDrawsBackground here.

(-[WKWebView _populateArchivedSubviews:]):
We don't want to archive the scroll view and the fixed overlay view.

(-[WKWebView setOpaque:]):
Return early if this is called before we have a page (like from -[UIView initWithCoder:]).

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (211837 => 211838)


--- trunk/Source/WebKit2/ChangeLog	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-07 22:09:03 UTC (rev 211838)
@@ -1,3 +1,23 @@
+2017-02-07  Anders Carlsson  <ander...@apple.com>
+
+        REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
+        https://bugs.webkit.org/show_bug.cgi?id=167947
+
+        Reviewed by Tim Horton.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        Add SPI declaration.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        Make sure to call setDrawsBackground here.
+
+        (-[WKWebView _populateArchivedSubviews:]):
+        We don't want to archive the scroll view and the fixed overlay view.
+
+        (-[WKWebView setOpaque:]):
+        Return early if this is called before we have a page (like from -[UIView initWithCoder:]).
+
 2017-02-07  Alex Christensen  <achristen...@webkit.org>
 
         Revert r166597

Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (211837 => 211838)


--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-02-07 22:09:03 UTC (rev 211838)
@@ -448,6 +448,7 @@
 - (void)setFrameOrigin:(CGPoint)origin;
 - (void)setSize:(CGSize)size;
 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
+- (void)_populateArchivedSubviews:(NSMutableSet *)encodedViews;
 @end
 
 @interface UIWebSelectionView : UIView

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211837 => 211838)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 21:56:42 UTC (rev 211837)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-02-07 22:09:03 UTC (rev 211838)
@@ -503,6 +503,7 @@
 
     _page = [_contentView page];
     _page->setDeviceOrientation(deviceOrientation());
+    _page->setDrawsBackground(self.opaque);
 
     [_contentView layer].anchorPoint = CGPointZero;
     [_contentView setFrame:bounds];
@@ -970,6 +971,16 @@
 
 #if PLATFORM(IOS)
 
+- (void)_populateArchivedSubviews:(NSMutableSet *)encodedViews
+{
+    [super _populateArchivedSubviews:encodedViews];
+
+    if (_scrollView)
+        [encodedViews removeObject:_scrollView.get()];
+    if (_customContentFixedOverlayView)
+        [encodedViews removeObject:_customContentFixedOverlayView.get()];
+}
+
 - (BOOL)_isBackground
 {
     if ([self _isDisplayingPDF])
@@ -1823,6 +1834,9 @@
     if (oldOpaque == opaque)
         return;
 
+    if (!_page)
+        return;
+
     _page->setDrawsBackground(opaque);
     [self _updateScrollViewBackground];
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to