Title: [168746] trunk/Source/WebKit2
Revision
168746
Author
[email protected]
Date
2014-05-13 15:34:21 -0700 (Tue, 13 May 2014)

Log Message

[iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
https://bugs.webkit.org/show_bug.cgi?id=132848
<rdar://problem/16875093>

Patch by Benjamin Poulain <[email protected]> on 2014-05-13
Reviewed by Darin Adler.

The SPI is no longer needed by Safari.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView _updateScrollViewBackground]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _setObscuredInsets:]):
(-[WKWebView _endAnimatedResize]):
(updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
(-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
(-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (168745 => 168746)


--- trunk/Source/WebKit2/ChangeLog	2014-05-13 22:26:43 UTC (rev 168745)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-13 22:34:21 UTC (rev 168746)
@@ -1,3 +1,24 @@
+2014-05-13  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
+        https://bugs.webkit.org/show_bug.cgi?id=132848
+        <rdar://problem/16875093>
+
+        Reviewed by Darin Adler.
+
+        The SPI is no longer needed by Safari.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]):
+        (-[WKWebView _updateScrollViewBackground]):
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _setObscuredInsets:]):
+        (-[WKWebView _endAnimatedResize]):
+        (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
+        (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
+        (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
 2014-05-13  Samuel White  <[email protected]>
 
         AX: Hit testing not accounting for top content inset.

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-05-13 22:26:43 UTC (rev 168745)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-05-13 22:34:21 UTC (rev 168746)
@@ -123,11 +123,6 @@
     UIEdgeInsets _obscuredInsets;
     bool _isChangingObscuredInsetsInteractively;
 
-    UIEdgeInsets _extendedBackgroundExclusionInsets;
-    UIView *_mainExtendedBackgroundView;
-    UIView *_extendedBackgroundLayerTopInset;
-    UIView *_extendedBackgroundLayerBottomInset;
-
     BOOL _needsResetViewStateAfterCommitLoadForMainFrame;
     BOOL _isAnimatingResize;
     CATransform3D _resizeAnimationTransformAdjustments;
@@ -194,8 +189,7 @@
     [_scrollView setBouncesZoom:YES];
 
     [self addSubview:_scrollView.get()];
-    _mainExtendedBackgroundView = _scrollView.get();
-    _mainExtendedBackgroundView.backgroundColor = [UIColor whiteColor];
+    [_scrollView setBackgroundColor:[UIColor whiteColor]];
 
     _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds context:context configuration:std::move(webPageConfiguration) webView:self]);
     _page = [_contentView page];
@@ -455,9 +449,7 @@
     _scrollViewBackgroundColor = color;
 
     RetainPtr<UIColor*> uiBackgroundColor = adoptNS([[UIColor alloc] initWithCGColor:cachedCGColor(color, WebCore::ColorSpaceDeviceRGB)]);
-    _mainExtendedBackgroundView.backgroundColor = uiBackgroundColor.get();
-    _extendedBackgroundLayerTopInset.backgroundColor = uiBackgroundColor.get();
-    _extendedBackgroundLayerBottomInset.backgroundColor = uiBackgroundColor.get();
+    [_scrollView setBackgroundColor:uiBackgroundColor.get()];
 }
 
 - (void)_didCommitLoadForMainFrame
@@ -868,13 +860,6 @@
 {
     CGRect bounds = self.bounds;
 
-    CGRect backgroundLayerRect = UIEdgeInsetsInsetRect(bounds, _extendedBackgroundExclusionInsets);
-    _mainExtendedBackgroundView.frame = backgroundLayerRect;
-    if (!_extendedBackgroundExclusionInsets.top && _obscuredInsets.top)
-        _extendedBackgroundLayerTopInset.frame = CGRectMake(0, 0, bounds.size.width, _obscuredInsets.top);
-    if (!_extendedBackgroundExclusionInsets.bottom && _obscuredInsets.bottom)
-        _extendedBackgroundLayerBottomInset.frame = CGRectMake(0, bounds.size.height - _obscuredInsets.bottom, bounds.size.width, _obscuredInsets.bottom);
-
     if (!_hasStaticMinimumLayoutSize && !_isAnimatingResize)
         setViewportConfigurationMinimumLayoutSize(*_page, bounds.size);
     [_scrollView setFrame:bounds];
@@ -1461,35 +1446,6 @@
     return _obscuredInsets;
 }
 
-static void updateTopAndBottomExtendedBackgroundExclusionIfNecessary(WKWebView* webView)
-{
-    if (webView->_obscuredInsets.top && !webView->_extendedBackgroundExclusionInsets.top) {
-        if (!webView->_extendedBackgroundLayerTopInset) {
-            RetainPtr<UIView> backgroundView = adoptNS([[UIView alloc] init]);
-            [backgroundView setBackgroundColor:webView->_mainExtendedBackgroundView.backgroundColor];
-            [webView insertSubview:backgroundView.get() belowSubview:webView->_scrollView.get()];
-            webView->_extendedBackgroundLayerTopInset = backgroundView.get();
-            [UIView performWithoutAnimation: ^{
-                [webView->_extendedBackgroundLayerTopInset setFrame:CGRectMake(0, 0, 0, webView->_obscuredInsets.top)];
-            }];
-        }
-
-        [webView->_extendedBackgroundLayerTopInset setFrame:CGRectMake(0, 0, webView->_extendedBackgroundExclusionInsets.left, webView->_obscuredInsets.top)];
-    }
-    if (webView->_obscuredInsets.bottom && !webView->_extendedBackgroundExclusionInsets.bottom) {
-        if (!webView->_extendedBackgroundLayerBottomInset) {
-            RetainPtr<UIView> backgroundView = adoptNS([[UIView alloc] init]);
-            [backgroundView setBackgroundColor:webView->_mainExtendedBackgroundView.backgroundColor];
-            [webView insertSubview:backgroundView.get() belowSubview:webView->_scrollView.get()];
-            webView->_extendedBackgroundLayerBottomInset = backgroundView.get();
-            [UIView performWithoutAnimation: ^{
-                [webView->_extendedBackgroundLayerBottomInset setFrame:CGRectMake(0, webView.bounds.size.height - webView->_obscuredInsets.bottom, 0, webView->_obscuredInsets.bottom)];
-            }];
-        }
-        [webView->_extendedBackgroundLayerBottomInset setFrame:CGRectMake(0, webView.bounds.size.height - webView->_obscuredInsets.bottom, webView->_extendedBackgroundExclusionInsets.left, webView->_obscuredInsets.bottom)];
-    }
-}
-
 - (void)_setObscuredInsets:(UIEdgeInsets)obscuredInsets
 {
     ASSERT(obscuredInsets.top >= 0);
@@ -1502,8 +1458,6 @@
 
     _obscuredInsets = obscuredInsets;
 
-    updateTopAndBottomExtendedBackgroundExclusionIfNecessary(self);
-
     [self _updateVisibleContentRects];
 }
 
@@ -1517,33 +1471,6 @@
     return _page->backgroundExtendsBeyondPage();
 }
 
-- (void)_setExtendedBackgroundExclusionInsets:(UIEdgeInsets)extendedBackgroundExclusionInsets
-{
-    if (UIEdgeInsetsEqualToEdgeInsets(extendedBackgroundExclusionInsets, _extendedBackgroundExclusionInsets))
-        return;
-
-    CGRect bounds = self.bounds;
-    if (_mainExtendedBackgroundView == _scrollView) {
-        [UIView performWithoutAnimation: ^{
-            RetainPtr<UIView> backgroundView = adoptNS([[UIView alloc] initWithFrame:bounds]);
-            _mainExtendedBackgroundView = backgroundView.get();
-            _mainExtendedBackgroundView.backgroundColor = [_scrollView backgroundColor];
-            [self insertSubview:_mainExtendedBackgroundView belowSubview:_scrollView.get()];
-            [_scrollView setBackgroundColor:nil];
-        }];
-    }
-
-    _extendedBackgroundExclusionInsets = extendedBackgroundExclusionInsets;
-    _mainExtendedBackgroundView.frame = UIEdgeInsetsInsetRect(bounds, _extendedBackgroundExclusionInsets);
-
-    updateTopAndBottomExtendedBackgroundExclusionIfNecessary(self);
-}
-
-- (UIEdgeInsets)_extendedBackgroundExclusionInsets
-{
-    return _extendedBackgroundExclusionInsets;
-}
-
 - (void)_beginInteractiveObscuredInsetsChange
 {
     ASSERT(!_isChangingObscuredInsetsInteractively);
@@ -1664,13 +1591,6 @@
     _isAnimatingResize = NO;
     _resizeAnimationTransformAdjustments = CATransform3DIdentity;
 
-    if (!_extendedBackgroundExclusionInsets.left) {
-        [_extendedBackgroundLayerTopInset removeFromSuperview];
-        _extendedBackgroundLayerTopInset = nil;
-        [_extendedBackgroundLayerBottomInset removeFromSuperview];
-        _extendedBackgroundLayerBottomInset = nil;
-    }
-
     [self _updateVisibleContentRects];
 }
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (168745 => 168746)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-05-13 22:26:43 UTC (rev 168745)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-05-13 22:34:21 UTC (rev 168746)
@@ -103,10 +103,6 @@
 
 @property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
 
-// If BackgroundExtendsBeyondPage is set, the background of a page extend to the edges of the webview.
-// The extendedBackgroundExclusionInsets defines insets where the background is not extended. The view is transparent in those areas.
-@property (nonatomic, setter=_setExtendedBackgroundExclusionInsets:) UIEdgeInsets _extendedBackgroundExclusionInsets;
-
 // FIXME: Remove these three properties once we expose WKWebViewContentProvider as API.
 @property (nonatomic, readonly, getter=_isDisplayingPDF) BOOL _displayingPDF;
 @property (nonatomic, readonly) NSData *_dataForDisplayedPDF;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to