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/06/15 06:29:28 UTC

[1/6] incubator-weex git commit: * [ios] cache attributedString for improve performance while draw Text

Repository: incubator-weex
Updated Branches:
  refs/heads/0.14-dev abf502286 -> e19ea2940


* [ios] cache attributedString for improve performance while draw Text


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

Branch: refs/heads/0.14-dev
Commit: d2715ffe211c144d0a1d248d31920a5ed843bd08
Parents: 0d61f2b
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 12 17:43:46 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 12 17:43:46 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2715ffe/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 721ce44..546ca03 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -118,6 +118,7 @@ CGFloat WXTextDefaultLineThroughWidth = 1.2;
     BOOL _truncationLine; // support trunk tail
     
     BOOL _needsRemoveObserver;
+    NSMutableAttributedString * _ctAttributedString;
 }
 
 + (void)setRenderUsingCoreText:(BOOL)usingCoreText
@@ -241,6 +242,7 @@ do {\
 - (void)setNeedsRepaint
 {
     _textStorage = nil;
+    _ctAttributedString = nil;
 }
 
 #pragma mark - Subclass
@@ -335,6 +337,14 @@ do {\
     return _text;
 }
 
+- (NSMutableAttributedString *)ctAttributedString
+{
+    if (!_ctAttributedString) {
+        _ctAttributedString = [self buildCTAttributeString];
+    }
+    return _ctAttributedString;
+}
+
 - (void)repaintText:(NSNotification *)notification
 {
     if (![_fontFamily isEqualToString:notification.userInfo[@"fontFamily"]]) {
@@ -605,7 +615,7 @@ do {\
         CGContextTranslateCTM(context, 0, textFrame.size.height);
         CGContextScaleCTM(context, 1.0, -1.0);
         
-        NSMutableAttributedString * attributedStringCopy = [self buildCTAttributeString];
+        NSMutableAttributedString * attributedStringCopy = [self ctAttributedString];
         //add path
         CGPathRef cgPath = NULL;
         cgPath = CGPathCreateWithRect(textFrame, NULL);
@@ -749,7 +759,7 @@ do {\
     if (truncationTokenLine) {
         // default truncationType is kCTLineTruncationEnd
         CTLineTruncationType truncationType = kCTLineTruncationEnd;
-        NSAttributedString *attributedString = [self buildCTAttributeString];
+        NSAttributedString *attributedString = [self ctAttributedString];
         NSAttributedString * lastLineText = nil;
         NSRange lastLineTextRange = WXNSRangeFromCFRange(CTLineGetStringRange(lastLine));
         NSRange attributeStringRange = NSMakeRange(0, attributedString.string.length);
@@ -817,7 +827,7 @@ do {\
     
     CGFloat totalHeight = 0;
     CGSize suggestSize = CGSizeZero;
-    NSAttributedString * attributedStringCpy = [self buildCTAttributeString];
+    NSAttributedString * attributedStringCpy = [self ctAttributedString];
     CTFramesetterRef framesetterRef = NULL;
     framesetterRef = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)attributedStringCpy);
         


[5/6] incubator-weex git commit: Merge remote-tracking branch 'wip-us/0.14-dev' into 0.14-dev

Posted by ac...@apache.org.
Merge remote-tracking branch 'wip-us/0.14-dev' into 0.14-dev


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

Branch: refs/heads/0.14-dev
Commit: 53efdad2048e3dfffb42b3c9a95c5a855f1a22d8
Parents: 1b10c6a 6371b3a
Author: acton393 <zh...@gmail.com>
Authored: Thu Jun 15 12:07:00 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Jun 15 12:07:00 2017 +0800

----------------------------------------------------------------------
 .travis.yml                                     |  87 ++++++++---
 android/run-ci.sh                               |   7 -
 android/sdk/build.gradle                        |  11 +-
 .../taobao/weex/ui/module/WXTimerModule.java    |  87 ++++++-----
 .../weex/ui/module/WXTimerModuleTest.java       |  44 ++++--
 .../WeexSDK/Sources/Bridge/WXBridgeContext.m    | 154 +++++++++++++++++++
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 111 +++++++++++++
 .../WeexSDK/Sources/Protocol/WXBridgeProtocol.h |  38 +++++
 test/ci-funcs.sh                                |  18 ---
 test/screenshot/border-ios.png                  | Bin 128206 -> 126375 bytes
 10 files changed, 454 insertions(+), 103 deletions(-)
----------------------------------------------------------------------



[3/6] incubator-weex git commit: Merge remote-tracking branch 'wip-us/0.14-dev' into 0.14-dev

Posted by ac...@apache.org.
Merge remote-tracking branch 'wip-us/0.14-dev' into 0.14-dev


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

Branch: refs/heads/0.14-dev
Commit: 03747a67c5d9f19a0a2bb8c8785bf9835aebbfc6
Parents: 2242b73 64b77b1
Author: acton393 <zh...@gmail.com>
Authored: Tue Jun 13 15:23:38 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jun 13 15:23:38 2017 +0800

----------------------------------------------------------------------
 .travis.yml                                          |  5 +++++
 .../Sources/Component/WXCycleSliderComponent.m       |  7 ++++---
 package.json                                         |  2 +-
 test/pages/css/border.vue                            | 15 +++++++++------
 test/run.sh                                          |  4 +++-
 test/scripts/util.js                                 |  5 +++--
 test/serve.sh                                        |  3 ++-
 7 files changed, 27 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[6/6] incubator-weex git commit: Merge branch '0.14-dev' of https://github.com/acton393/incubator-weex into wip-us-0.14-dev

Posted by ac...@apache.org.
Merge branch '0.14-dev' of https://github.com/acton393/incubator-weex into wip-us-0.14-dev


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

Branch: refs/heads/0.14-dev
Commit: e19ea2940dacf022153bdfa6ed86ca9fa00673b9
Parents: abf5022 53efdad
Author: acton393 <zh...@gmail.com>
Authored: Thu Jun 15 14:28:07 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Jun 15 14:28:07 2017 +0800

----------------------------------------------------------------------
 WeexSDK.podspec                                 |  2 +-
 .../Sources/Component/WXComponent_internal.h    |  1 +
 .../WeexSDK/Sources/Component/WXTextComponent.m | 16 +++++--
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m |  1 -
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     | 47 +++++++++++++++-----
 5 files changed, 50 insertions(+), 17 deletions(-)
----------------------------------------------------------------------



[2/6] incubator-weex git commit: * [ios] add system frameworks for WeexSDK.podspec

Posted by ac...@apache.org.
* [ios] add system frameworks for WeexSDK.podspec


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

Branch: refs/heads/0.14-dev
Commit: 2242b736a259657b3dfb30369f597e0d25a4e490
Parents: d2715ff
Author: acton393 <zh...@gmail.com>
Authored: Mon Jun 12 19:40:00 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Jun 12 19:40:00 2017 +0800

----------------------------------------------------------------------
 WeexSDK.podspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2242b736/WeexSDK.podspec
----------------------------------------------------------------------
diff --git a/WeexSDK.podspec b/WeexSDK.podspec
index 5563626..80a39db 100644
--- a/WeexSDK.podspec
+++ b/WeexSDK.podspec
@@ -38,7 +38,7 @@ Pod::Spec.new do |s|
 
   s.xcconfig = { "OTHER_LINK_FLAG" => '$(inherited) -ObjC'}
 
-  s.frameworks = 'CoreMedia','MediaPlayer','AVFoundation','AVKit','JavaScriptCore', 'GLKit'
+  s.frameworks = 'CoreMedia','MediaPlayer','AVFoundation','AVKit','JavaScriptCore', 'GLKit', 'OpenGLES', 'CoreText', 'QuartzCore', 'CoreGraphics'
 
   s.dependency 'SocketRocket'
   s.libraries = "stdc++"


[4/6] incubator-weex git commit: * [ios] fix set accessibility unexpected crash

Posted by ac...@apache.org.
* [ios] fix set accessibility unexpected crash


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

Branch: refs/heads/0.14-dev
Commit: 1b10c6a4a6f3443b6b1919ba376997a1911cac5b
Parents: 03747a6
Author: acton393 <zh...@gmail.com>
Authored: Tue Jun 13 15:46:02 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jun 13 15:46:02 2017 +0800

----------------------------------------------------------------------
 .../Sources/Component/WXComponent_internal.h    |  1 +
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m |  1 -
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     | 47 +++++++++++++++-----
 3 files changed, 36 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b10c6a4/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
index ce2e80a..7226ced 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
@@ -61,6 +61,7 @@
     UIAccessibilityTraits _role; //accessibility
     NSString * _ariaLabel; //accessibilityLabel
     BOOL _ariaHidden; // accessibilityElementsHidden
+    NSString * _testId;// just for auto-test
     
     /**
      *  PseudoClass

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b10c6a4/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
index ce570ca..a6f1f0e 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -148,7 +148,6 @@
                 [strongSelf setGradientLayer];
             }
             [strongSelf setNeedsDisplay];
-            [strongSelf _configWXComponentA11yWithAttributes:nil];
         }];
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b10c6a4/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index 561baa5..2a0bbd9 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -90,6 +90,7 @@
         _isNeedJoinLayoutSystem = YES;
         _isLayoutDirty = YES;
         _isViewFrameSyncWithCalculated = YES;
+        _ariaHidden = NO;
         
         _async = NO;
         
@@ -104,6 +105,20 @@
             }
         }
         
+        if (attributes[@"role"]){
+            _role = [WXConvert WXUIAccessibilityTraits:attributes[@"role"]];
+        }
+        if (attributes[@"ariaHidden"]) {
+            _ariaHidden = [WXConvert BOOL:attributes[@"ariaHidden"]];
+        }
+        if (attributes[@"ariaLabel"]) {
+            _ariaLabel = [WXConvert NSString:attributes[@"ariaLabel"]];
+        }
+        
+        if (attributes[@"testId"]) {
+            _testId = [WXConvert NSString:attributes[@"testId"]];
+        }
+        
         [self _setupNavBarWithStyles:_styles attributes:_attributes];
         [self _initCSSNodeWithStyles:_styles];
         [self _initViewPropertyWithStyles:_styles];
@@ -234,7 +249,19 @@
         _view.wx_ref = self.ref;
         _layer.wx_component = self;
         
-        [self _configWXComponentA11yWithAttributes:_attributes];
+        if (_role) {
+            _view.accessibilityTraits |= _role;
+        }
+        
+        if (_testId) {
+            _view.accessibilityIdentifier = _testId;
+        }
+        
+        if (_ariaLabel) {
+            _view.accessibilityLabel = _ariaLabel;
+        }
+        
+        _view.accessibilityElementsHidden = _ariaHidden;
         
         [self _initEvents:self.events];
         [self _initPseudoEvents:_isListenPseudoTouch];
@@ -515,26 +542,22 @@
 - (void)_configWXComponentA11yWithAttributes:(NSDictionary *)attributes
 {
     WX_CHECK_COMPONENT_TYPE(self.componentType)
-    NSDictionary *attributesCpy = [attributes copy];
-    if (!attributesCpy) {
-        return;
-    }
     
-    if (attributesCpy[@"role"]){
+    if (attributes[@"role"]){
         _role = [WXConvert WXUIAccessibilityTraits:attributes[@"role"]];
         self.view.accessibilityTraits = _role;
     }
-    if (attributesCpy[@"ariaHidden"]) {
-        _ariaHidden = [WXConvert BOOL:attributesCpy[@"ariaHidden"]];
+    if (attributes[@"ariaHidden"]) {
+        _ariaHidden = [WXConvert BOOL:attributes[@"ariaHidden"]];
         self.view.accessibilityElementsHidden = _ariaHidden;
     }
-    if (attributesCpy[@"ariaLabel"]) {
-        _ariaLabel = [WXConvert NSString:attributesCpy[@"ariaLabel"]];
+    if (attributes[@"ariaLabel"]) {
+        _ariaLabel = [WXConvert NSString:attributes[@"ariaLabel"]];
         self.view.accessibilityValue = _ariaLabel;
     }
     
-    if (attributesCpy[@"testId"]) {
-        [self.view setAccessibilityIdentifier:[WXConvert NSString:attributesCpy[@"testId"]]];
+    if (attributes[@"testId"]) {
+        [self.view setAccessibilityIdentifier:[WXConvert NSString:attributes[@"testId"]]];
     }
 
 }