You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/23 03:30:29 UTC

[1/4] incubator-weex git commit: * [ios] use coretext default

Repository: incubator-weex
Updated Branches:
  refs/heads/0.13-dev 23acc90ff -> d990b4fc9


* [ios] use coretext default


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5889001e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5889001e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5889001e

Branch: refs/heads/0.13-dev
Commit: 5889001e692b92904b8b2c631dfb9a1d80f81b68
Parents: 8acc6e6
Author: acton393 <zh...@gmail.com>
Authored: Fri May 19 15:20:36 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri May 19 15:20:36 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m |  4 ++--
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m       | 16 ++++++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5889001e/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
index e6be027..ba41655 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -83,7 +83,7 @@
 
 @end
 
-static BOOL textRenderUsingCoreText = NO;
+static BOOL textRenderUsingCoreText = YES;
 
 NSString *const WXTextTruncationToken = @"\u2026";
 CGFloat WXTextDefaultLineThroughWidth = 1.2;
@@ -213,7 +213,7 @@ do {\
         WXFloorPixelValue(self.cssNode->style.padding[CSS_RIGHT] + self.cssNode->style.border[CSS_RIGHT])
     };
     
-    if (styles[@"lineHeight"] && WX_SYS_VERSION_LESS_THAN(@"10.0")) {
+    if (styles[@"lineHeight"] && WX_SYS_VERSION_LESS_THAN(@"10.0") && WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
         self.useCoreTextAttr = @"false";
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5889001e/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 68eb1d2..1a08dbf 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -194,9 +194,18 @@ typedef enum : NSUInteger {
     // ensure default modules/components/handlers are ready before create instance
     [WXSDKEngine registerDefaults];
     
+    [self _handleConfigCenter];
+    
+    [[WXSDKManager bridgeMgr] createInstance:self.instanceId template:mainBundleString options:dictionary data:_jsData];
+    
+    WX_MONITOR_PERF_SET(WXPTBundleSize, [mainBundleString lengthOfBytesUsingEncoding:NSUTF8StringEncoding], self);
+}
+
+- (void)_handleConfigCenter
+{
     id configCenter = [WXSDKEngine handlerForProtocol:@protocol(WXConfigCenterProtocol)];
     if ([configCenter respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) {
-        BOOL useCoreText = [[configCenter configForKey:@"iOS_weex_ext_config.text_render_useCoreText" defaultValue:@false isDefault:NULL] boolValue];
+        BOOL useCoreText = [[configCenter configForKey:@"iOS_weex_ext_config.text_render_useCoreText" defaultValue:@YES isDefault:NULL] boolValue];
         [WXTextComponent setRenderUsingCoreText:useCoreText];
         id sliderConfig =  [configCenter configForKey:@"iOS_weex_ext_config.slider_class_name" defaultValue:@"WXSliderComponent" isDefault:NULL];
         if(sliderConfig){
@@ -210,13 +219,8 @@ typedef enum : NSUInteger {
             [WXSDKEngine registerComponent:@"slider" withClass:NSClassFromString(@"WXSliderComponent")];
         }
     }
-    
-    [[WXSDKManager bridgeMgr] createInstance:self.instanceId template:mainBundleString options:dictionary data:_jsData];
-    
-    WX_MONITOR_PERF_SET(WXPTBundleSize, [mainBundleString lengthOfBytesUsingEncoding:NSUTF8StringEncoding], self);
 }
 
-
 - (void)_renderWithRequest:(WXResourceRequest *)request options:(NSDictionary *)options data:(id)data;
 {
     NSURL *url = request.URL;


[4/4] incubator-weex git commit: Merge remote-tracking branch 'wip-us/0.13-dev' into 0.13-dev-text-line-height

Posted by ac...@apache.org.
Merge remote-tracking branch 'wip-us/0.13-dev' into 0.13-dev-text-line-height


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d990b4fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d990b4fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d990b4fc

Branch: refs/heads/0.13-dev
Commit: d990b4fc9f2b0438a13b94e063e89753f890b6e9
Parents: 8e1c01b 23acc90
Author: acton393 <zh...@gmail.com>
Authored: Mon May 22 19:06:57 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon May 22 19:06:57 2017 +0800

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[3/4] incubator-weex git commit: * [ios] fix text line-height in iOS 8 and iOS 9

Posted by ac...@apache.org.
* [ios] fix text line-height in iOS  8 and iOS 9


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8e1c01bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8e1c01bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8e1c01bc

Branch: refs/heads/0.13-dev
Commit: 8e1c01bca9294d219bfbc011abd1ad019c5954c7
Parents: 8bb4c9e
Author: acton393 <zh...@gmail.com>
Authored: Mon May 22 15:41:55 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon May 22 15:41:55 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e1c01bc/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
index ba41655..f473a1c 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -213,10 +213,6 @@ do {\
         WXFloorPixelValue(self.cssNode->style.padding[CSS_RIGHT] + self.cssNode->style.border[CSS_RIGHT])
     };
     
-    if (styles[@"lineHeight"] && WX_SYS_VERSION_LESS_THAN(@"10.0") && WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
-        self.useCoreTextAttr = @"false";
-    }
-    
     if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) {
         _padding = padding;
         [self setNeedsRepaint];
@@ -683,9 +679,11 @@ do {\
         run = CFArrayGetValueAtIndex(runs, runIndex);
         CFDictionaryRef attr = NULL;
         attr = CTRunGetAttributes(run);
-        NSNumber *baselineOffset = (NSNumber*)CFDictionaryGetValue(attr, NSBaselineOffsetAttributeName);
-        if (baselineOffset) {
-            lineOrigin.y += [baselineOffset doubleValue];
+        if (0 == runIndex) {
+            NSNumber *baselineOffset = (NSNumber*)CFDictionaryGetValue(attr, NSBaselineOffsetAttributeName);
+            if (baselineOffset) {
+                lineOrigin.y += [baselineOffset doubleValue];
+            }
         }
         CGContextSetTextPosition(context, lineOrigin.x, lineOrigin.y);
         CTRunDraw(run, context, CFRangeMake(0, 0));


[2/4] incubator-weex git commit: * [ios] fix iOS 10 api

Posted by ac...@apache.org.
* [ios] fix iOS 10 api


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8bb4c9ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8bb4c9ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8bb4c9ee

Branch: refs/heads/0.13-dev
Commit: 8bb4c9ee46ebae6e7f9bec597f4c687014e8be13
Parents: 5889001
Author: acton393 <zh...@gmail.com>
Authored: Fri May 19 16:48:30 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri May 19 16:48:30 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8bb4c9ee/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
index 36be1b2..7258790 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m
@@ -798,7 +798,11 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue)
     } else if ([role isEqualToString:@"search"]) {
         accessibilityTrait = UIAccessibilityTraitSearchField;
     } else if ([role isEqualToString:@"tab"]) {
-        accessibilityTrait = UIAccessibilityTraitTabBar;
+#ifdef __IPHONE_10_0
+        if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
+            accessibilityTrait = UIAccessibilityTraitTabBar;
+        }
+#endif
     }
     
     return accessibilityTrait;