This is an automated email from the ASF dual-hosted git repository.

jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new a31c982  Revert "[iOS] Set overflow to  hidden by default on iOS to 
conform to Android. (#2521)" (#2565)
a31c982 is described below

commit a31c9821f0fe653a2cf3cceff3bd2e99204d1da2
Author: wqyfavor <qianyuan....@alibaba-inc.com>
AuthorDate: Mon Jun 17 20:42:30 2019 +0800

    Revert "[iOS] Set overflow to  hidden by default on iOS to conform to 
Android. (#2521)" (#2565)
    
    This reverts commit 4553f0ff6bc70d3fb717377655cff06f7f9a36c4.
---
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m      |  3 ---
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.h        |  4 +---
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m        | 13 ------------
 .../Sources/View/WXComponent+ViewManagement.mm     | 24 ++++------------------
 ios/sdk/WeexSDKTests/WXComponentTests.m            |  1 +
 5 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m 
b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 65f376f..33f774f 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -522,9 +522,6 @@ typedef enum : NSUInteger {
     if ([configCenter 
respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) {          
 
         BOOL enableRTLLayoutDirection = [[configCenter 
configForKey:@"iOS_weex_ext_config.enableRTLLayoutDirection" 
defaultValue:@(YES) isDefault:NULL] boolValue];
         [WXUtility setEnableRTLLayoutDirection:enableRTLLayoutDirection];
-        
-        BOOL overflowHiddenByDefault = [[configCenter 
configForKey:@"iOS_weex_ext_config.overflowHiddenByDefault" defaultValue:@(YES) 
isDefault:NULL] boolValue];
-        [WXUtility setOverflowHiddenByDefault:overflowHiddenByDefault];
     }
     return NO;
 }
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h 
b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
index 3714a82..71c77d5 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
@@ -494,10 +494,8 @@ BOOL WXFloatGreaterThanWithPrecision(CGFloat a,CGFloat 
b,double precision);
 + (NSData *_Nonnull)base64DictToData:(NSDictionary *_Nullable)base64Dict;
 
 + (void)setEnableRTLLayoutDirection:(BOOL)value;
-+ (BOOL)enableRTLLayoutDirection;
 
-+ (void)setOverflowHiddenByDefault:(BOOL)value;
-+ (BOOL)overflowHiddenByDefault;
++ (BOOL)enableRTLLayoutDirection;
 
 + (long) getUnixFixTimeMillis;
 
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m 
b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index a6ba757..e94c40e 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -43,7 +43,6 @@
 #define KEY_USERNAME_PASSWORD  @"com.taobao.Weex.weex123456"
 
 static BOOL enableRTLLayoutDirection = YES;
-static BOOL overflowHiddenByDefault = YES;
 
 void WXPerformBlockOnMainThread(void (^ _Nonnull block)(void))
 {
@@ -771,18 +770,6 @@ CGFloat WXFloorPixelValue(CGFloat value)
     return enableRTLLayoutDirection;
 }
 
-# pragma mark - Overflow
-
-+ (void)setOverflowHiddenByDefault:(BOOL)value
-{
-    overflowHiddenByDefault = value;
-}
-
-+ (BOOL)overflowHiddenByDefault
-{
-    return overflowHiddenByDefault;
-}
-
 #pragma mark - get deviceID
 + (NSString *)getDeviceID {
     NSMutableDictionary *usernamepasswordKVPairs = (NSMutableDictionary 
*)[self load:KEY_USERNAME_PASSWORD];
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm 
b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm
index e987704..896c2fb 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm
@@ -177,15 +177,7 @@ do {\
     _backgroundColor = styles[@"backgroundColor"] ? [WXConvert 
UIColor:styles[@"backgroundColor"]] : [UIColor clearColor];
     _backgroundImage = styles[@"backgroundImage"] ? [WXConvert 
NSString:styles[@"backgroundImage"]]: nil;
     _opacity = styles[@"opacity"] ? [WXConvert CGFloat:styles[@"opacity"]] : 
1.0;
-    if ([WXUtility overflowHiddenByDefault]) {
-        /* If we enable overflow:hidden by default, we cannot use original 
"overflow" style value.
-         Unless js explicitly define "ios-overflow: visible", we disable 
clipToBounds.
-         */
-        _clipToBounds = styles[@"iosOverflow"] ? [WXConvert 
WXClipType:styles[@"iosOverflow"]] : YES;
-    }
-    else {
-        _clipToBounds = styles[@"overflow"] ? [WXConvert 
WXClipType:styles[@"overflow"]] : NO;
-    }
+    _clipToBounds = styles[@"overflow"] ? [WXConvert 
WXClipType:styles[@"overflow"]] : NO;
     _visibility = styles[@"visibility"] ? [WXConvert 
WXVisibility:styles[@"visibility"]] : WXVisibilityShow;
     _positionType = styles[@"position"] ? [WXConvert 
WXPositionType:styles[@"position"]] : WXPositionTypeRelative;
     _transform = styles[@"transform"] || styles[@"transformOrigin"] ?
@@ -235,17 +227,9 @@ do {\
         _layer.opacity = _opacity;
     }
     
-    if ([WXUtility overflowHiddenByDefault]) {
-        if (styles[@"iosOverflow"]) {
-            _clipToBounds = [WXConvert WXClipType:styles[@"iosOverflow"]];
-            _view.clipsToBounds = _clipToBounds;
-        }
-    }
-    else {
-        if (styles[@"overflow"]) {
-            _clipToBounds = [WXConvert WXClipType:styles[@"overflow"]];
-            _view.clipsToBounds = _clipToBounds;
-        }
+    if (styles[@"overflow"]) {
+        _clipToBounds = [WXConvert WXClipType:styles[@"overflow"]];
+        _view.clipsToBounds = _clipToBounds;
     }
     
     if (styles[@"position"]) {
diff --git a/ios/sdk/WeexSDKTests/WXComponentTests.m 
b/ios/sdk/WeexSDKTests/WXComponentTests.m
index 12685a6..0ca4cc7 100644
--- a/ios/sdk/WeexSDKTests/WXComponentTests.m
+++ b/ios/sdk/WeexSDKTests/WXComponentTests.m
@@ -71,6 +71,7 @@
      *  View
      */
     XCTAssertEqual(component->_backgroundColor, [UIColor clearColor]);
+    XCTAssertEqual(component->_clipToBounds, NO);
     XCTAssertNil(component->_view);
     XCTAssertEqual(component->_opacity, 1.0);
     XCTAssertEqual(component->_visibility, WXVisibilityShow);

Reply via email to