Unreviewed, rolling out r229688.
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2018 05:58:06 +0000 (05:58 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2018 05:58:06 +0000 (05:58 +0000)
There's a solution that doesn't require this SPI.

Reverted changeset:

"Add SPI to expose width and height anchors for WKWebView's
content view"
https://bugs.webkit.org/show_bug.cgi?id=183711
https://trac.webkit.org/changeset/229688

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229693 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm

index 6c09a19..b0212fe 100644 (file)
@@ -1,5 +1,18 @@
 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
 
+        Unreviewed, rolling out r229688.
+
+        There's a solution that doesn't require this SPI.
+
+        Reverted changeset:
+
+        "Add SPI to expose width and height anchors for WKWebView's
+        content view"
+        https://bugs.webkit.org/show_bug.cgi?id=183711
+        https://trac.webkit.org/changeset/229688
+
+2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
+
         Add SPI to expose width and height anchors for WKWebView's content view
         https://bugs.webkit.org/show_bug.cgi?id=183711
         <rdar://problem/38562899>
index e191303..18b2bc1 100644 (file)
@@ -4948,16 +4948,6 @@ static inline WebKit::FindOptions toFindOptions(_WKFindOptions wkFindOptions)
 
 #if PLATFORM(IOS)
 
-- (NSLayoutDimension *)_contentWidthAnchor
-{
-    return [_contentView widthAnchor];
-}
-
-- (NSLayoutDimension *)_contentHeightAnchor
-{
-    return [_contentView heightAnchor];
-}
-
 #if ENABLE(FULLSCREEN_API)
 - (void)removeFromSuperview
 {
index e1dd5d8..e63dd9f 100644 (file)
@@ -254,9 +254,6 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
 - (void)_accessibilityRetrieveSpeakSelectionContent WK_API_AVAILABLE(ios(11.0));
 - (void)_accessibilityDidGetSpeakSelectionContent:(NSString *)content WK_API_AVAILABLE(ios(11.0));
 
-@property (nonatomic, readonly) NSLayoutDimension *_contentWidthAnchor WK_API_AVAILABLE(ios(WK_IOS_TBA));
-@property (nonatomic, readonly) NSLayoutDimension *_contentHeightAnchor WK_API_AVAILABLE(ios(WK_IOS_TBA));
-
 #else
 
 @property (nonatomic, readonly) _WKRectEdge _pinnedState WK_API_AVAILABLE(macosx(WK_MAC_TBA));
index 067f8ac..40980f9 100644 (file)
@@ -1,3 +1,16 @@
+2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Unreviewed, rolling out r229688.
+
+        There's a solution that doesn't require this SPI.
+
+        Reverted changeset:
+
+        "Add SPI to expose width and height anchors for WKWebView's
+        content view"
+        https://bugs.webkit.org/show_bug.cgi?id=183711
+        https://trac.webkit.org/changeset/229688
+
 2018-03-16  Zalan Bujtas  <zalan@apple.com>
 
         [LayoutReloaded] Move move functions to the base class from BlockFormattingContext
index d125741..7c39c3c 100644 (file)
 
 #import "PlatformUtilities.h"
 #import "TestNavigationDelegate.h"
-#import "TestWKWebView.h"
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
 
-#if PLATFORM(IOS)
-#import "UIKitSPI.h"
-#endif
-
-#if WK_API_ENABLED
-
-#if PLATFORM(MAC)
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool didInvalidateIntrinsicContentSize;
 static bool didEvaluateJavaScript;
@@ -211,54 +204,4 @@ TEST(WebKit, AutoLayoutRenderingProgressRelativeOrdering)
     [webView setNavigationDelegate:nil];
 }
 
-#endif // PLATFORM(MAC)
-
-#if PLATFORM(IOS)
-
-static void checkCGRect(CGRect expected, CGRect observed)
-{
-    bool success = CGRectEqualToRect(expected, observed);
-    EXPECT_TRUE(success);
-    if (!success)
-        NSLog(@"Expected rect: %@ but got: %@", NSStringFromCGRect(expected), NSStringFromCGRect(observed));
-}
-
-TEST(WebKit, AutoLayoutPositionHeaderAndFooterViewsInScrollView)
-{
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    UIScrollView *scrollView = [webView scrollView];
-    scrollView.contentInset = UIEdgeInsetsMake(100, 0, 100, 0);
-
-    [webView synchronouslyLoadHTMLString:@"<meta name='viewport' content='width=device-width, initial-scale=1'><body style='width: 100%; height: 5000px; margin: 0'>"];
-
-    auto headerLabel = adoptNS([[UILabel alloc] init]);
-    [headerLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
-    [scrollView addSubview:headerLabel.get()];
-
-    auto footerLabel = adoptNS([[UILabel alloc] init]);
-    [footerLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
-    [scrollView addSubview:footerLabel.get()];
-
-    [NSLayoutConstraint activateConstraints:@[
-        [[headerLabel widthAnchor] constraintEqualToConstant:320],
-        [[headerLabel heightAnchor] constraintEqualToConstant:100],
-        [[headerLabel leftAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.leftAnchor],
-        [[headerLabel bottomAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.topAnchor],
-        [[footerLabel widthAnchor] constraintEqualToConstant:320],
-        [[footerLabel heightAnchor] constraintEqualToConstant:100],
-        [[footerLabel leftAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.leftAnchor],
-        [[footerLabel topAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.bottomAnchor],
-        [[webView _contentWidthAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.widthAnchor],
-        [[webView _contentHeightAnchor] constraintEqualToAnchor:scrollView.contentLayoutGuide.heightAnchor]
-    ]];
-
-    [webView layoutSubviews];
-    [webView waitForNextPresentationUpdate];
-
-    checkCGRect(CGRectMake(0, -100, 320, 100), [headerLabel frame]);
-    checkCGRect(CGRectMake(0, 5000, 320, 100), [footerLabel frame]);
-}
-
-#endif // PLATFORM(IOS)
-
-#endif // WK_API_ENABLED
+#endif