[incubator-weex] branch master updated: [iOS] fix crash when multithread call initSDKEnvironment
This is an automated email from the ASF dual-hosted git repository. moshen 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 3da1499 [iOS] fix crash when multithread call initSDKEnvironment new 4ea510d Merge pull request #3229 from jianhan-he/master 3da1499 is described below commit 3da1499c4810895255a16b1af9545affe72bea7e Author: linghe.lh AuthorDate: Thu Jun 18 10:02:58 2020 +0800 [iOS] fix crash when multithread call initSDKEnvironment --- ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m index 993e427..19ab11a 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m @@ -271,23 +271,22 @@ + (void)initSDKEnvironment:(NSString *)script { -WX_MONITOR_PERF_START(WXPTInitalize) -WX_MONITOR_PERF_START(WXPTInitalizeSync) - -if (!script || script.length <= 0) { -NSMutableString *errMsg = [NSMutableString stringWithFormat:@"[WX_KEY_EXCEPTION_SDK_INIT_JSFM_INIT_FAILED] script don't exist:%@",script]; -[WXExceptionUtils commitCriticalExceptionRT:@"WX_KEY_EXCEPTION_SDK_INIT" errCode:[NSString stringWithFormat:@"%d", WX_KEY_EXCEPTION_SDK_INIT] function:@"initSDKEnvironment" exception:errMsg extParams:nil]; -WX_MONITOR_FAIL(WXMTJSFramework, WX_ERR_JSFRAMEWORK_LOAD, errMsg); -return; -} static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ +WX_MONITOR_PERF_START(WXPTInitalize) +WX_MONITOR_PERF_START(WXPTInitalizeSync) + +if (!script || script.length <= 0) { +NSMutableString *errMsg = [NSMutableString stringWithFormat:@"[WX_KEY_EXCEPTION_SDK_INIT_JSFM_INIT_FAILED] script don't exist:%@",script]; +[WXExceptionUtils commitCriticalExceptionRT:@"WX_KEY_EXCEPTION_SDK_INIT" errCode:[NSString stringWithFormat:@"%d", WX_KEY_EXCEPTION_SDK_INIT] function:@"initSDKEnvironment" exception:errMsg extParams:nil]; +WX_MONITOR_FAIL(WXMTJSFramework, WX_ERR_JSFRAMEWORK_LOAD, errMsg); +return; +} [self registerDefaults]; [[WXSDKManager bridgeMgr] executeJsFramework:script]; + +WX_MONITOR_PERF_END(WXPTInitalizeSync) }); - -WX_MONITOR_PERF_END(WXPTInitalizeSync) - } + (void)registerDefaults
[incubator-weex] branch master updated: [iOS] support reactor protocol to render
This is an automated email from the ASF dual-hosted git repository. moshen 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 c3dda86 [iOS] support reactor protocol to render new 18328bc Merge pull request #3225 from jianhan-he/master c3dda86 is described below commit c3dda86b2b5d916f53db066b83a10a386d483218 Author: linghe.lh AuthorDate: Thu Jun 11 10:09:33 2020 +0800 [iOS] support reactor protocol to render --- WeexSDK.podspec| 3 +- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 23 +++- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 10 +- .../Sources/Component/RecycleList/WXJSASTParser.mm | 2 +- .../WeexSDK/Sources/Events/WXComponent+Events.m| 3 + ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h | 2 + ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m | 21 +++- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 10 ++ ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 45 +++- .../WeexSDK/Sources/Model/WXSDKInstance_private.h | 2 + .../WeexSDK/Sources/Protocol/WXReactorProtocol.h | 64 +++ ios/sdk/WeexSDK/Sources/WeexSDK.h | 2 + weex_core/Source/core/render/page/reactor_page.cpp | 127 + weex_core/Source/core/render/page/reactor_page.h | 79 + weex_core/Source/core/render/page/render_page.cpp | 4 - 15 files changed, 380 insertions(+), 17 deletions(-) diff --git a/WeexSDK.podspec b/WeexSDK.podspec index 37fbc1b..8689ebb 100644 --- a/WeexSDK.podspec +++ b/WeexSDK.podspec @@ -107,7 +107,8 @@ Pod::Spec.new do |s| 'weex_core/Source/core/layout/flex_enum.h', 'weex_core/Source/core/layout/layout.h', 'weex_core/Source/core/layout/style.h', - 'weex_core/Source/core/bridge/eagle_bridge.h' + 'weex_core/Source/core/bridge/eagle_bridge.h', + 'weex_core/Source/core/render/page/reactor_page.h' s.module_map = 'WeexSDK.modulemap' diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index 470c4ad..d14d0a7 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -575,6 +575,14 @@ BD88C14C22F02128004467AA /* render_action_update_richtext_child_style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD88C14822F02128004467AA /* render_action_update_richtext_child_style.cpp */; }; BD9205FB223651D900EDF93D /* eagle_bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9205F9223651D800EDF93D /* eagle_bridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; BD9205FC223651D900EDF93D /* eagle_bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD9205FA223651D800EDF93D /* eagle_bridge.cpp */; }; + BDB112982459D6C2008492F9 /* WXReactorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = BDB112972459D6C2008492F9 /* WXReactorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BDB1129B2459D71E008492F9 /* reactor_page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDB112992459D71E008492F9 /* reactor_page.cpp */; }; + BDB1129C2459D71E008492F9 /* reactor_page.h in Headers */ = {isa = PBXBuildFile; fileRef = BDB1129A2459D71E008492F9 /* reactor_page.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BDB1129D2459D802008492F9 /* WXReactorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = BDB112972459D6C2008492F9 /* WXReactorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BDB1129E2459D8D3008492F9 /* reactor_page.cpp in Headers */ = {isa = PBXBuildFile; fileRef = BDB112992459D71E008492F9 /* reactor_page.cpp */; }; + BDB1129F2459D8FC008492F9 /* reactor_page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDB112992459D71E008492F9 /* reactor_page.cpp */; }; + BDB112A02459D90F008492F9 /* reactor_page.h in Headers */ = {isa = PBXBuildFile; fileRef = BDB1129A2459D71E008492F9 /* reactor_page.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BDBA319B248D0A5200C6EDD0 /* reactor_page.cpp in Headers */ = {isa = PBXBuildFile; fileRef = BDB112992459D71E008492F9 /* reactor_page.cpp */; }; BDEEADBA22F2902E0099F1D7 /* time_calculator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDEEADB822F2902D0099F1D7 /* time_calculator.cpp */; }; BDEEADBB22F2902E0099F1D7 /* time_calculator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDEEADB822F2902D0099F1D7 /* time_calculator.cpp */; }; BDEEADBC22F2902E0099F1D7 /* time_calculator.h in Headers */ = {isa =
[incubator-weex] branch master updated (67bfbef -> c1ea17e)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 67bfbef Merge pull request #3176 from chenzefeng09/master new 35c1d17 [iOS] fix eagle error new 5fb1c16 [iOS] add log when download image new c1ea17e Merge pull request #3205 from jianhan-he/master The 11980 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 2 ++ ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m| 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
[incubator-weex] branch master updated: [iOS] fix ci build script
This is an automated email from the ASF dual-hosted git repository. moshen 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 43a9c09 [iOS] fix ci build script new 494e1d2 Merge pull request #3178 from jianhan-he/master 43a9c09 is described below commit 43a9c09d8cd65d510a0971b42d7ce32f27c44a19 Author: linghe.lh AuthorDate: Fri Mar 27 10:35:01 2020 +0800 [iOS] fix ci build script --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9490dae..ebeb24e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,7 +121,7 @@ install: nvm install 12.6.0 git submodule update --init --remote -cd weex-playground/ios +cd weex-playground/ios && bash update_podfile_for_travisci.sh cd ../../ && npm install cd weex-playground/ios && bundle install && pod install --repo-update cd ../../ @@ -168,10 +168,10 @@ script: "ios" ) if npm run danger -- ci --dangerfile ./dangerfile-ios.js | grep -q "hasIosFile" ; then # build WeexSDK and run WeexSDKTests - #xcodebuild -quiet -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 + xcodebuild -quiet -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 # build WeexDemo and run WeexDemo test cd weex-playground/ios && mkdir tmp && mv * tmp;cd tmp - #xcodebuild -quiet -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 + xcodebuild -quiet -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 fi ;; esac
[incubator-weex] branch master updated: [iOS] fix bugs for iPad
This is an automated email from the ASF dual-hosted git repository. moshen 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 0ad73cf [iOS] fix bugs for iPad new 1488c7e Merge pull request #3173 from jianhan-he/master 0ad73cf is described below commit 0ad73cf973de666db026a2639e593903e0a5a747 Author: linghe.lh AuthorDate: Thu Mar 19 16:01:44 2020 +0800 [iOS] fix bugs for iPad --- .travis.yml | 6 +++--- WeexSDK.podspec | 3 +++ .../Sources/Component/Recycler/WXRecyclerComponent.mm | 9 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 2 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 7 ++- ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m| 2 +- ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 7 +++ ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 13 + weex_core/Source/core/common/view_utils.h | 7 --- weex_core/Source/core/render/node/render_list.cpp | 10 +- weex_core/Source/core/render/node/render_mask.cpp | 4 ++-- 11 files changed, 54 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebeb24e..9490dae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,7 +121,7 @@ install: nvm install 12.6.0 git submodule update --init --remote -cd weex-playground/ios && bash update_podfile_for_travisci.sh +cd weex-playground/ios cd ../../ && npm install cd weex-playground/ios && bundle install && pod install --repo-update cd ../../ @@ -168,10 +168,10 @@ script: "ios" ) if npm run danger -- ci --dangerfile ./dangerfile-ios.js | grep -q "hasIosFile" ; then # build WeexSDK and run WeexSDKTests - xcodebuild -quiet -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 + #xcodebuild -quiet -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 # build WeexDemo and run WeexDemo test cd weex-playground/ios && mkdir tmp && mv * tmp;cd tmp - xcodebuild -quiet -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 + #xcodebuild -quiet -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 fi ;; esac diff --git a/WeexSDK.podspec b/WeexSDK.podspec index 050e37f..37fbc1b 100644 --- a/WeexSDK.podspec +++ b/WeexSDK.podspec @@ -72,6 +72,8 @@ Pod::Spec.new do |s| 'ios/sdk/WeexSDK/Sources/View/WXView.h', 'ios/sdk/WeexSDK/Sources/View/WXErrorView.h', 'ios/sdk/WeexSDK/Sources/Protocol/*.h', + 'ios/sdk/WeexSDK/Sources/Plugin/WXEaglePluginManager.h', + 'ios/sdk/WeexSDK/Sources/Plugin/WXEaglePlugin.h', 'ios/sdk/WeexSDK/Sources/Network/WXResourceRequestHandler.h', 'ios/sdk/WeexSDK/Sources/Network/WXResourceRequest.h', 'ios/sdk/WeexSDK/Sources/Network/WXResourceResponse.h', @@ -87,6 +89,7 @@ Pod::Spec.new do |s| 'ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h', 'ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h', 'ios/sdk/WeexSDK/Sources/Manager/WXInvocationConfig.h', + 'ios/sdk/WeexSDK/Sources/Manager/WXModuleFactory.h', 'ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h', 'ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h', 'ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h', diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm index 22be575..e379ca2 100644 --- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm @@ -2
[incubator-weex] branch master updated: [iOS] support module intercept
This is an automated email from the ASF dual-hosted git repository. moshen 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 0d75d53 [iOS] support module intercept new 1dfb498 Merge pull request #3131 from jianhan-he/master 0d75d53 is described below commit 0d75d53b8855ee894fe0db4c0ad1b822df4bcab9 Author: linghe.lh AuthorDate: Thu Feb 6 13:03:44 2020 +0800 [iOS] support module intercept --- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 6 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h| 13 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m| 40 3 files changed, 59 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index d72c379..7f1e8f1 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -336,6 +336,7 @@ _Pragma("clang diagnostic pop") \ WXLogInfo(@"instance not found for callNativeModule:%@.%@, maybe already destroyed", moduleName, methodName); return nil; } + #ifdef DEBUG WXLogDebug(@"flexLayout -> action: callNativeModule : %@ . %@",moduleName,methodName); #endif @@ -363,6 +364,11 @@ _Pragma("clang diagnostic pop") \ [WXPrerenderManager storePrerenderModuleTasks:method forUrl:instance.scriptURL.absoluteString]; return nil; } + +BOOL intercepted = [instance moduleInterceptWithModuleName:moduleName methodName:methodName arguments:[newArguments copy] options:[newOptions copy]]; +if (intercepted) { +return nil; +} return [method invoke]; }]; diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h index e7d4fb1..84e6802 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h @@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN extern NSString *const bundleUrlOptionKey; +typedef BOOL (^WXModuleInterceptCallback)(NSString *moduleName, NSString *methodName, NSArray *arguments, NSDictionary *options); + @interface WXSDKInstance : NSObject /** @@ -491,6 +493,17 @@ typedef enum : NSUInteger { - (void)setCurrentSchemeName:(NSString*)name; /** + register/unRegister module intercept + */ +- (void)registerModuleIntercept:(NSString*)moduleName callBack:(WXModuleInterceptCallback)callback; +- (void)unRegisterModuleIntercept:(NSString*)moduleName; + +/** + call module intercept + */ +- (BOOL)moduleInterceptWithModuleName:(NSString*)moduleName methodName:(NSString*)methodName arguments:(NSArray*)arguments options:(NSDictionary*)options; + +/** Choose final color between original color and dark-mode one. Also considering invert. */ diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 81bf780..67d2233 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -87,6 +87,7 @@ typedef enum : NSUInteger { BOOL _debugJS; id _instanceJavaScriptContext; // sandbox javaScript context BOOL _defaultDataRender; +NSMutableDictionary *_moduleIntercepts; } - (void)dealloc @@ -157,6 +158,7 @@ typedef enum : NSUInteger { _styleConfigs = [NSMutableDictionary new]; _attrConfigs = [NSMutableDictionary new]; _moduleEventObservers = [WXThreadSafeMutableDictionary new]; +_moduleIntercepts = [NSMutableDictionary new]; _trackComponent = NO; _performanceCommit = NO; @@ -1223,6 +1225,44 @@ typedef enum : NSUInteger { return [self.schemeName isEqualToString:@"dark"]; } +- (void)registerModuleIntercept:(NSString*)moduleName callBack:(WXModuleInterceptCallback)callback { +__weak WXSDKInstance* weakSelf = self; +WXPerformBlockOnBridgeThread(^{ +__strong WXSDKInstance* strongSelf = weakSelf; +if (strongSelf == nil) { +return; +} +if (![WXUtility isBlankString:moduleName] && callback) { +[strongSelf->_moduleIntercepts setObject:callback forKey:moduleName]; + } +}); +} + +- (void)unRegisterModuleIntercept:(NSString*)moduleName { +__weak WXSDKInstance* weakSelf = self; +WXPerformBlockOnBridgeThread(^{ +__strong WXSDKInstance* strongSelf = weakSelf; +if (strongSelf == nil) { +return; +} +if (![WXUtility isBlankString:moduleName]) { +[strongSelf->_moduleIntercepts removeObjectForKey:moduleName]; +} +}); +} + +- (BOOL)moduleInterceptWithModuleName:(NSString*)moduleName methodName:(NSString*)methodName arguments:(NSArray*)arguments op
[incubator-weex] branch master updated: [iOS] fix un catched exception when nan value passed from front end
This is an automated email from the ASF dual-hosted git repository. moshen 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 057cc79 [iOS] fix un catched exception when nan value passed from front end new d90963e Merge pull request #3086 from sunshl/Jiakui/bugfix_191217_crashfix 057cc79 is described below commit 057cc79a5d53ed54a22ca1236c374c1442ecd75c Author: huanglei.hl AuthorDate: Tue Dec 17 12:05:57 2019 +0800 [iOS] fix un catched exception when nan value passed from front end --- ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm index 6fa35be..0a86a77 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm @@ -70,6 +70,7 @@ static NSThread *WXComponentThread; #define WXAssertComponentExist(component) WXAssert(component, @"component not exists") #define MAX_DROP_FRAME_FOR_BATCH 200 +#define SYNC_UI_EXCEPTION_LOG_INTERVAL 1000 @interface WXComponentManager () @end @@ -1146,7 +1147,15 @@ static NSThread *WXComponentThread; if (blocks.count) { dispatch_async(dispatch_get_main_queue(), ^{ for(dispatch_block_t block in blocks) { -block(); +@try { +block(); +} @catch (NSException *exception) { +static NSInteger sCatchCount = 0; +if (++sCatchCount % SYNC_UI_EXCEPTION_LOG_INTERVAL == 1) { +// log for the first time and control interval +WXLogError(@"SyncUI Exception:%@", exception); +} +} } }); }
[incubator-weex] branch master updated: [iOS] Support dark scheme for input controls.
This is an automated email from the ASF dual-hosted git repository. moshen 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 36ccbb1 [iOS] Support dark scheme for input controls. new 4f73e51 Merge pull request #3084 from wqyfavor/dark-input 36ccbb1 is described below commit 36ccbb1ff191f227d4fd7b37ed439c96f3fda55f Author: qianyuan.wqy AuthorDate: Mon Dec 16 18:44:41 2019 +0800 [iOS] Support dark scheme for input controls. --- .../WeexSDK/Sources/Component/WXEditComponent.h| 4 +- .../WeexSDK/Sources/Component/WXEditComponent.mm | 101 ++--- .../Sources/Component/WXTextAreaComponent.mm | 8 +- 3 files changed, 96 insertions(+), 17 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.h index f9559d8..2ae7e1e 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.h @@ -25,7 +25,9 @@ @interface WXEditComponent : WXComponent //attribute -@property (nonatomic, strong) UIColor *placeholderColor; +@property (atomic, strong) UIColor *placeholderColor; +@property (atomic, strong) UIColor *darkSchemePlaceholderColor; +@property (atomic, strong) UIColor *lightSchemePlaceholderColor; @property (nonatomic, strong) NSString *placeholderString; @property (nonatomic, strong) UILabel *placeHolderLabel; diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm index 56c5ef3..d980ca7 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm @@ -28,6 +28,7 @@ #import "WXComponent+PseudoClassManagement.h" #import "WXTextInputComponent.h" #import "WXComponent+Layout.h" +#import "WXComponent_internal.h" @interface WXEditComponent() { @@ -52,7 +53,9 @@ @property (nonatomic) WXTextStyle fontStyle; @property (nonatomic) CGFloat fontWeight; @property (nonatomic, strong) NSString *fontFamily; -@property (nonatomic, strong) UIColor *colorForStyle; +@property (atomic, strong) UIColor *colorForStyle; +@property (atomic, strong) UIColor *darkSchemeColorForStyle; +@property (atomic, strong) UIColor *lightSchemeColorForStyle; @property (nonatomic)NSTextAlignment textAlignForStyle; //event @@ -142,7 +145,16 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) // handle styles if (styles[@"color"]) { -_colorForStyle = [WXConvert UIColor:styles[@"color"]]; +self.colorForStyle = [WXConvert UIColor:styles[@"color"]]; +} +else { +self.colorForStyle = [UIColor blackColor]; +} +if (styles[@"weexDarkSchemeColor"]) { +self.darkSchemeColorForStyle = [WXConvert UIColor:styles[@"weexDarkSchemeColor"]]; +} +if (styles[@"weexLightSchemeColor"]) { +self.lightSchemeColorForStyle = [WXConvert UIColor:styles[@"weexLightSchemeColor"]]; } if (styles[@"fontSize"]) { _fontSize = [WXConvert WXPixelType:styles[@"fontSize"] scaleFactor:self.weexInstance.pixelScaleFactor]; @@ -160,9 +172,15 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) _textAlignForStyle = [WXConvert NSTextAlignment:styles[@"textAlign"]]; } if (styles[@"placeholderColor"]) { -_placeholderColor = [WXConvert UIColor:styles[@"placeholderColor"]]; +self.placeholderColor = [WXConvert UIColor:styles[@"placeholderColor"]]; }else { -_placeholderColor = [UIColor colorWithRed:0x99/255.0 green:0x99/255.0 blue:0x99/255.0 alpha:1.0]; +self.placeholderColor = [UIColor colorWithRed:0x99/255.0 green:0x99/255.0 blue:0x99/255.0 alpha:1.0]; +} +if (styles[@"weexDarkSchemePlaceholderColor"]) { +self.darkSchemePlaceholderColor = [WXConvert UIColor:styles[@"weexDarkSchemePlaceholderColor"]]; +} +if (styles[@"weexLightSchemePlaceholderColor"]) { +self.lightSchemePlaceholderColor = [WXConvert UIColor:styles[@"weexLightSchemePlaceholderColor"]]; } } @@ -187,7 +205,7 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) [self setTextFont]; [self setPlaceholderAttributedString]; [self setTextAlignment]; -[self setTextColor:_colorForStyle]; +[self setTextColor:[self.weexInstance chooseColor:self.colorForStyle lightSchemeColor:self.lightSchemeColorForStyle darkSchemeColor:self.darkSchemeColorForStyle invert:self.invertForDarkScheme scene:WXColorSceneText]]; [self setText:_valu
[incubator-weex] branch master updated: fix bug wkwebview crash
This is an automated email from the ASF dual-hosted git repository. moshen 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 2379171 fix bug wkwebview crash new 10f7406 Merge pull request #3080 from yaochenfeng/feature/web 2379171 is described below commit 23791716ae6487cd782a932ec3c2355b5ec6cc79 Author: yaochenfeng <282696...@qq.com> AuthorDate: Fri Dec 13 19:22:57 2019 +0800 fix bug wkwebview crash --- ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m | 72 +++--- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m index 1b37c28..f053a39 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m @@ -43,8 +43,6 @@ @interface WXWebComponent () -@property (nonatomic, strong) JSContext *jsContext; - @property (nonatomic, strong) WXWebView *webview; @property (nonatomic, strong) NSString *url; @@ -98,7 +96,7 @@ WX_EXPORT_METHOD(@selector(goForward)) - (UIView *)loadView { -return [[WXWebView alloc] initWithFrame:self.view.frame configuration:[self baseConfiguration]]; +return [[WXWebView alloc] initWithFrame:CGRectZero configuration:[self baseConfiguration]]; } - (void)viewDidLoad @@ -107,39 +105,39 @@ WX_EXPORT_METHOD(@selector(goForward)) _webview.navigationDelegate = self; [_webview setBackgroundColor:[UIColor clearColor]]; _webview.opaque = NO; -_jsContext = [_webview valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; -__weak typeof(self) weakSelf = self; +//_jsContext = [_webview valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; +//__weak typeof(self) weakSelf = self; // This method will be abandoned slowly. -_jsContext[@"$notifyWeex"] = ^(JSValue *data) { -if (weakSelf.notifyEvent) { -[weakSelf fireEvent:@"notify" params:[data toDictionary]]; -} -}; - -//Weex catch postMessage event from web -_jsContext[@"postMessage"] = ^() { - -NSArray *args = [JSContext currentArguments]; - -if (args && args.count < 2) { -return; -} - -NSDictionary *data = [args[0] toDictionary]; -NSString *origin = [args[1] toString]; - -if (data == nil) { -return; -} - -NSDictionary *initDic = @{ @"type" : @"message", - @"data" : data, - @"origin" : origin -}; - -[weakSelf fireEvent:@"message" params:initDic]; -}; +//_jsContext[@"$notifyWeex"] = ^(JSValue *data) { +//if (weakSelf.notifyEvent) { +//[weakSelf fireEvent:@"notify" params:[data toDictionary]]; +//} +//}; +// +////Weex catch postMessage event from web +//_jsContext[@"postMessage"] = ^() { +// +//NSArray *args = [JSContext currentArguments]; +// +//if (args && args.count < 2) { +//return; +//} +// +//NSDictionary *data = [args[0] toDictionary]; +//NSString *origin = [args[1] toString]; +// +//if (data == nil) { +//return; +//} +// +//NSDictionary *initDic = @{ @"type" : @"message", +// @"data" : data, +// @"origin" : origin +//}; +// +//[weakSelf fireEvent:@"message" params:initDic]; +//}; self.source = _inInitsource; if (_url) { @@ -235,7 +233,7 @@ WX_EXPORT_METHOD(@selector(goForward)) { NSString *json = [WXUtility JSONString:data]; NSString *code = [NSString stringWithFormat:@"(function(){var evt=null;var data=%@;if(typeof CustomEvent==='function'){evt=new CustomEvent('notify',{detail:data})}else{evt=document.createEvent('CustomEvent');evt.initCustomEvent('notify',true,true,data)}document.dispatchEvent(evt)}())", json]; -[_jsContext evaluateScript:code]; +[_webview evaluateJavaScript:code completionHandler:nil]; } // Weex postMessage to web @@ -259,7 +257,7 @@ WX_EXPORT_METHOD(@selector(goForward)) NSString *json = [WXUtility JSONString:initDic]; NSString *code = [NSString stringWithFormat:@"(function (){window.dispatchEvent(new MessageEvent('message', %@));}())", json]; -[_jsContext evaluateScript:code]; +[_webview evaluateJavaScript:code completionHandler:nil]; } #pragma mark Webview Delegate @@ -272,7 +270,7 @@ WX_EXPORT_METHOD(@selector(goForward)) [self.webview evaluateJavaScript:@"document.title" completionHandler:^(id _Nullable result, NSError * _Nullable error) { [info setObject:result ? result : @"" forKey:@"title"]; if (completion) { -completion(result); +completion(info); } }]; }
[incubator-weex] branch master updated: [iOS] fix waterfall component repaint bug
This is an automated email from the ASF dual-hosted git repository. moshen 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 81abb4a [iOS] fix waterfall component repaint bug new 0ea76d5 Merge pull request #3073 from jianhan-he/master 81abb4a is described below commit 81abb4a9bc88d0b4aa81adfcff072484d421ec44 Author: linghe.lh AuthorDate: Wed Dec 11 16:18:23 2019 +0800 [iOS] fix waterfall component repaint bug --- .../Component/Recycler/WXRecyclerComponent.mm | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm index bc246b4..22be575 100644 --- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm @@ -252,18 +252,26 @@ typedef enum : NSUInteger { } if (attributes[@"columnWidth"]) { -layout.columnWidth = [WXConvert WXLength:attributes[@"columnWidth"] isFloat:YES scaleFactor:scaleFactor]; -needUpdateLayout = YES; +WXLength* columnWidth = [WXConvert WXLength:attributes[@"columnWidth"] isFloat:YES scaleFactor:scaleFactor]; +if (![columnWidth isEqualToLength:layout.columnWidth]) { +layout.columnWidth = columnWidth; +needUpdateLayout = YES; +} } if (attributes[@"columnCount"]) { -layout.columnCount = [WXConvert WXLength:attributes[@"columnCount"] isFloat:NO scaleFactor:1.0]; - -needUpdateLayout = YES; +WXLength* columCount = [WXConvert WXLength:attributes[@"columnCount"] isFloat:NO scaleFactor:1.0]; +if (![columCount isEqualToLength:layout.columnCount]) { +layout.columnCount = columCount; +needUpdateLayout = YES; +} } if (attributes[@"columnGap"]) { -layout.columnGap = [self _floatValueForColumnGap:([WXConvert WXLength:attributes[@"columnGap"] isFloat:YES scaleFactor:scaleFactor])]; -needUpdateLayout = YES; +float columnGap = [self _floatValueForColumnGap:([WXConvert WXLength:attributes[@"columnGap"] isFloat:YES scaleFactor:scaleFactor])]; +if (columnGap != layout.columnGap) { +layout.columnGap = columnGap; +needUpdateLayout = YES; +} } if (attributes[@"leftGap"]) { layout.leftGap = [WXConvert WXPixelType:attributes[@"leftGap"] scaleFactor:scaleFactor];
[incubator-weex] branch master updated: 修复当数据改变时index无效
This is an automated email from the ASF dual-hosted git repository. moshen 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 3b61758 修复当数据改变时index无效 new 69c9ed6 Merge pull request #1695 from ttarigo/master 3b61758 is described below commit 3b61758cf57542ff41fef8c84d2c461be05c1484 Author: ttarigo AuthorDate: Fri Nov 2 11:55:23 2018 +0800 修复当数据改变时index无效 --- ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm index 402e592..5bd794b 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm @@ -528,7 +528,9 @@ typedef NS_ENUM(NSInteger, Direction) { WXRecycleSliderView *recycleSliderView = (WXRecycleSliderView *)_view; [recycleSliderView removeItemView:view]; -[recycleSliderView setCurrentIndex:0]; +if (self.childrenView.count <= _index) { +[recycleSliderView setCurrentIndex:0]; +} } - (void)updateAttributes:(NSDictionary *)attributes
[incubator-weex] branch master updated (e629d29 -> 8c74b32)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from e629d29 Merge pull request #3061 from wqyfavor/fix-dark new cd6e78e Make WXWebView inherit from WKWebView instead of UIWebView and make WXWebComponent implement WKNavigationDelegate instead of UIWebViewDelegate new 2d4869e Add WebKit framework to WeexSDKTests target new 8c74b32 Merge pull request #3053 from AMoraga/feature/wkwebview The 11930 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 4 + ios/sdk/WeexSDK/Sources/Component/WXWebComponent.h | 3 +- ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m | 85 +- ios/sdk/WeexSDK/Sources/Utility/WXVersion.m| 4 +- 4 files changed, 58 insertions(+), 38 deletions(-)
[incubator-weex] branch master updated: [iOS] Fix dark scheme.
This is an automated email from the ASF dual-hosted git repository. moshen 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 7793f07 [iOS] Fix dark scheme. new e629d29 Merge pull request #3061 from wqyfavor/fix-dark 7793f07 is described below commit 7793f071ad27274b8a2a63d3d74ee1d018d94052 Author: qianyuan.wqy AuthorDate: Thu Dec 5 16:54:47 2019 +0800 [iOS] Fix dark scheme. --- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm index cb6251c..a2dab80 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm @@ -406,31 +406,12 @@ static BOOL bNeedRemoveEvents = YES; _layer.borderWidth = _borderTopWidth; [self _resetNativeBorderRadius]; _layer.opacity = _opacity; - -/* Also set background color to view to fix that problem that system may - set dynamic color to UITableView. Without these codes, event if we set - clear color to layer, the table view could not be transparent. */ + if ([WXUtility isDarkSchemeSupportEnabled]) { UIColor* choosedColor = [self.weexInstance chooseColor:self.styleBackgroundColor lightSchemeColor:self.lightSchemeBackgroundColor darkSchemeColor:self.darkSchemeBackgroundColor invert:_invertForDarkScheme scene:[self colorSceneType]]; -if (choosedColor == [UIColor clearColor]) { -_view.backgroundColor = choosedColor; -} -_layer.backgroundColor = choosedColor.CGColor; +_view.backgroundColor = choosedColor; } else { -/* On iOS10, there is an annoying problem that if we only - set backgroundColor to layer(not to view), for UIScrollView - the background color would be black. So we have to set - background color to UIView itself on iOS10(or lower). - - For iOS13, we have SDK which hooked setBackgroundColor - of UIView to support autoinverting(no in WeexSDK). - But that SDK would finally set a UIDynamicColor to view. - Weex can handle dark mode, so we don't want background - color of a UIView in Weex page to be set to UIDynamicColor. - So in code above, we only set color to layer but which - also caused the black problem that on iOS10. - */ _view.backgroundColor = self.styleBackgroundColor; } }
[incubator-weex] branch master updated: [iOS] Add unregisterSchemeChangeListener method.
This is an automated email from the ASF dual-hosted git repository. moshen 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 4471d24 [iOS] Add unregisterSchemeChangeListener method. new aa93abc Merge pull request #3051 from wqyfavor/dark-scheme-module-unreg-method 4471d24 is described below commit 4471d24004968f064ce39ffccfdd2612bb234ea7 Author: qianyuan.wqy AuthorDate: Tue Dec 3 14:27:21 2019 +0800 [iOS] Add unregisterSchemeChangeListener method. --- ios/sdk/WeexSDK/Sources/Module/WXDarkSchemeModule.m | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Module/WXDarkSchemeModule.m b/ios/sdk/WeexSDK/Sources/Module/WXDarkSchemeModule.m index 92d268f..8df9787 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXDarkSchemeModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXDarkSchemeModule.m @@ -29,6 +29,7 @@ WX_EXPORT_METHOD_SYNC(@selector(isUsingDarkScheme)) WX_EXPORT_METHOD(@selector(registerSchemeChangeListener:)) +WX_EXPORT_METHOD(@selector(unregisterSchemeChangeListener)) - (BOOL)isUsingDarkScheme { @@ -49,4 +50,9 @@ WX_EXPORT_METHOD(@selector(registerSchemeChangeListener:)) } } +- (void)unregisterSchemeChangeListener +{ +_schemeChangedCallback = nil; +} + @end
[incubator-weex] branch master updated: Optimize for custom render target.
This is an automated email from the ASF dual-hosted git repository. moshen 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 152c0a1 Optimize for custom render target. new d05ecc0 Merge pull request #3049 from wqyfavor/optimize-heron 152c0a1 is described below commit 152c0a1f015a801cf39169b834a01186dda2b67d Author: qianyuan.wqy AuthorDate: Mon Dec 2 20:26:19 2019 +0800 Optimize for custom render target. --- .../Source/core/render/page/render_page_custom.cpp | 31 -- .../Source/core/render/target/render_target.h | 16 +-- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/weex_core/Source/core/render/page/render_page_custom.cpp b/weex_core/Source/core/render/page/render_page_custom.cpp index 2317511..3d464ff 100644 --- a/weex_core/Source/core/render/page/render_page_custom.cpp +++ b/weex_core/Source/core/render/page/render_page_custom.cpp @@ -21,11 +21,6 @@ #include "render_page_custom.h" namespace WeexCore { - -template -static std::shared_ptr SharedMove(T& source) { -return std::make_shared(std::move(source)); -} RenderPageCustom::RenderPageCustom(const std::string& page_id, const std::string& page_type, const PageOptions& options): RenderPageBase(page_id, page_type) { valid_ = true; @@ -37,7 +32,7 @@ namespace WeexCore { targetOptions.is_round_off = options.is_round_off; targetOptions.viewport_width = options.viewport_width; targetOptions.device_width = options.device_width; -target_->createPage(page_id, targetOptions);; +target_->createPage(page_id, targetOptions); } } @@ -46,10 +41,8 @@ namespace WeexCore { std::map* attrs, std::set* events) { if (target_) { -auto managedStyles = SharedMove(*styles); -auto managedAttrs = SharedMove(*attrs); -auto managedEvents = SharedMove(*events); -target_->createBody(page_id_, ref, type, managedStyles, managedAttrs, managedEvents); +target_->createBody(page_id_, ref, type, styles, attrs, events); +return true; } delete styles; delete attrs; @@ -63,10 +56,8 @@ namespace WeexCore { std::map* attrs, std::set* events) { if (target_) { -auto managedStyles = SharedMove(*styles); -auto managedAttrs = SharedMove(*attrs); -auto managedEvents = SharedMove(*events); -target_->addElement(page_id_, ref, type, parent_ref, index, managedStyles, managedAttrs, managedEvents); +target_->addElement(page_id_, ref, type, parent_ref, index, styles, attrs, events); +return true; } delete styles; delete attrs; @@ -90,11 +81,11 @@ namespace WeexCore { bool RenderPageCustom::UpdateStyle(const std::string &ref, std::vector> *styles) { if (target_) { -std::shared_ptr> managedStyles = std::make_shared>(); +std::map* stylesMap = new std::map(); for (auto& p : *styles) { -(*managedStyles)[std::move(p.first)] = std::move(p.second); +(*stylesMap)[std::move(p.first)] = std::move(p.second); } -target_->updateStyles(page_id_, ref, managedStyles); +target_->updateStyles(page_id_, ref, stylesMap); } delete styles; return true; @@ -102,11 +93,11 @@ namespace WeexCore { bool RenderPageCustom::UpdateAttr(const std::string &ref, std::vector> *attrs) { if (target_) { -std::shared_ptr> managedAttrs = std::make_shared>(); +std::map* attrsMap = new std::map(); for (auto& p : *attrs) { -(*managedAttrs)[std::move(p.first)] = std::move(p.second); +(*attrsMap)[std::move(p.first)] = std::move(p.second); } -target_->updateAttributes(page_id_, ref, managedAttrs); +target_->updateAttributes(page_id_, ref, attrsMap); } delete attrs; return true; diff --git a/weex_core/Source/core/render/target/render_target.h b/weex_core/Source/core/render/target/render_target.h index 81f7fc4..6b89455 100644 --- a/weex_core/Source/core/render/target/render_target.h +++ b/weex_core/Source/core/render/target/render_target.h @@ -56,23 +56,23 @@ namespace WeexCore { virtual void deletePage(const std::string& page) = 0; virtual void createBody(const std::string& page, const std::string& ref, const std::string& type, -
[incubator-weex] branch master updated: [iOS] Clip module should be used in main thread.
This is an automated email from the ASF dual-hosted git repository. moshen 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 91729bc [iOS] Clip module should be used in main thread. new fba862c Merge pull request #3048 from wqyfavor/fix-clipboard 91729bc is described below commit 91729bc8fe753fcd4f0f6e0ff93cf50cbe1b507c Author: qianyuan.wqy AuthorDate: Mon Dec 2 15:55:51 2019 +0800 [iOS] Clip module should be used in main thread. --- ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m b/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m index 7b7fcb1..c07d364 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m @@ -24,8 +24,8 @@ WX_EXPORT_METHOD(@selector(setString:)) WX_EXPORT_METHOD(@selector(getString:)) -- (dispatch_queue_t)targetExecuteQueue { -return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); +- (NSThread *)targetExecuteThread { +return [NSThread mainThread]; } - (void)setString:(NSString *)content @@ -37,9 +37,10 @@ WX_EXPORT_METHOD(@selector(getString:)) - (void)getString:(WXModuleKeepAliveCallback)callback{ UIPasteboard *clipboard = [UIPasteboard generalPasteboard]; NSDictionary *result = [@{} mutableCopy]; -if(clipboard.string) +NSString* content = [clipboard string]; +if(content) { -[result setValue:clipboard.string forKey:@"data"]; +[result setValue:content forKey:@"data"]; [result setValue:@"success" forKey:@"result"]; }else {
[incubator-weex] branch master updated: Use xcode11 for travis CI.
This is an automated email from the ASF dual-hosted git repository. moshen 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 edea907 Use xcode11 for travis CI. new e52c25b Merge pull request #3043 from wqyfavor/update-xcode-ci-version edea907 is described below commit edea9077dde5ad8572ddea5eabaf5479e1d8f286 Author: qianyuan.wqy AuthorDate: Fri Nov 29 14:43:34 2019 +0800 Use xcode11 for travis CI. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index fde27b6..8c25f1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ matrix: - env: TEST_SUITE=danger - env: TEST_SUITE=jsfm - env: TEST_SUITE=ios +os: osx osx_image: xcode11.2 language: objective-c - env: TEST_SUITE=android ABI=armeabi-v7a @@ -35,6 +36,7 @@ matrix: - extra-android-m2repository # static check - env: TEST_SUITE=static_code_analysis OCLINT=true +os: osx osx_image: xcode11.2 language: objective-c - env: TEST_SUITE=static_code_analysis ANDROID_LINT=true
[incubator-weex] branch master updated: Use xcode11 for travis CI.
This is an automated email from the ASF dual-hosted git repository. moshen 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 d27dad8 Use xcode11 for travis CI. new 54ae7cc Merge pull request #3042 from wqyfavor/update-xcode-ci-version d27dad8 is described below commit d27dad8a122004e0914e4e3ce5418f7cdd154163 Author: qianyuan.wqy AuthorDate: Fri Nov 29 14:09:59 2019 +0800 Use xcode11 for travis CI. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e709618..fde27b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ matrix: - env: TEST_SUITE=danger - env: TEST_SUITE=jsfm - env: TEST_SUITE=ios +osx_image: xcode11.2 language: objective-c - env: TEST_SUITE=android ABI=armeabi-v7a language: android @@ -34,7 +35,7 @@ matrix: - extra-android-m2repository # static check - env: TEST_SUITE=static_code_analysis OCLINT=true -osx_image: xcode7.2 +osx_image: xcode11.2 language: objective-c - env: TEST_SUITE=static_code_analysis ANDROID_LINT=true language: android
[incubator-weex] branch dark-mode-dev created (now 6bd805e)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch dark-mode-dev in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 6bd805e Support dark mode. This branch includes the following new commits: new 6bd805e Support dark mode. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: Support dark mode.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch dark-mode-dev in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 6bd805e7ba3ac2045504656cfb35ffc0359b26b1 Author: qianyuan.wqy AuthorDate: Tue Nov 12 16:26:14 2019 +0800 Support dark mode. --- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 18 +++ .../Sources/Component/RecycleList/WXJSASTParser.mm | 2 +- .../Sources/Component/WXComponent_internal.h | 7 ++ .../WeexSDK/Sources/Component/WXImageComponent.m | 121 - ios/sdk/WeexSDK/Sources/Component/WXRichText.mm| 34 +- .../WeexSDK/Sources/Component/WXTextComponent.mm | 86 ++- .../WeexSDK/Sources/Display/WXComponent+Display.m | 89 +-- ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 2 + .../WXDarkThemeDefaultImpl.h} | 11 +- .../WXDarkThemeDefaultImpl.m} | 21 +++- .../WeexSDK/Sources/Manager/WXComponentManager.mm | 6 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h| 18 +++ ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 30 - ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 28 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 85 ++- .../WeexSDK/Sources/Model/WXSDKInstance_private.h | 2 + ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 35 +- ios/sdk/WeexSDK/Sources/Module/WXTransition.mm | 65 +-- .../{WXDestroyProtocol.h => WXDarkThemeProtocol.h} | 23 +++- ios/sdk/WeexSDK/Sources/Utility/WXUtility.h| 8 ++ ios/sdk/WeexSDK/Sources/Utility/WXUtility.m| 19 +++- .../Sources/View/WXComponent+ViewManagement.mm | 46 +++- ios/sdk/WeexSDK/Sources/View/WXRootView.m | 36 ++ ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 + 24 files changed, 663 insertions(+), 130 deletions(-) diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index e006b27..3502f78 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -618,6 +618,12 @@ D735F1B222D761F800B53CDF /* log_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D735F1AC22D761F800B53CDF /* log_utils.cpp */; }; D735F1B322D761F800B53CDF /* log_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D735F1AC22D761F800B53CDF /* log_utils.cpp */; }; D77286FF22C9B22C00E1DA7D /* eagle_bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BD9205FA223651D800EDF93D /* eagle_bridge.cpp */; }; + D7C96CF3237AA13400A4599C /* WXDarkThemeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D7C96CF2237AA13400A4599C /* WXDarkThemeProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D7C96CF4237AA13400A4599C /* WXDarkThemeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D7C96CF2237AA13400A4599C /* WXDarkThemeProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D7C96CF7237AA16100A4599C /* WXDarkThemeDefaultImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = D7C96CF5237AA16100A4599C /* WXDarkThemeDefaultImpl.h */; }; + D7C96CF8237AA16100A4599C /* WXDarkThemeDefaultImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = D7C96CF5237AA16100A4599C /* WXDarkThemeDefaultImpl.h */; }; + D7C96CF9237AA16100A4599C /* WXDarkThemeDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = D7C96CF6237AA16100A4599C /* WXDarkThemeDefaultImpl.m */; }; + D7C96CFA237AA16100A4599C /* WXDarkThemeDefaultImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = D7C96CF6237AA16100A4599C /* WXDarkThemeDefaultImpl.m */; }; DC03ADB91D508719003F76E7 /* WXTextAreaComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = DC03ADB71D508719003F76E7 /* WXTextAreaComponent.mm */; }; DC03ADBA1D508719003F76E7 /* WXTextAreaComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = DC03ADB81D508719003F76E7 /* WXTextAreaComponent.h */; }; DC15A3DB2010BC93009C8977 /* weex-main-jsfm.js in Resources */ = {isa = PBXBuildFile; fileRef = DC15A3D92010BC93009C8977 /* weex-main-jsfm.js */; }; @@ -1351,6 +1357,9 @@ D3FC0DF61C508B2A002B9E31 /* WXTimerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTimerModule.m; sourceTree = ""; }; D735F1AB22D761F800B53CDF /* log_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log_utils.h; sourceTree = ""; }; D735F1AC22D761F800B53CDF /* log_utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log_utils.cpp; sourceTree = ""; }; + D7C96CF2237AA13400A4599C /* WXDarkThemeProtoco
[incubator-weex-site] branch master updated: Update doc of events.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex-site.git The following commit(s) were added to refs/heads/master by this push: new f4be3c7 Update doc of events. f4be3c7 is described below commit f4be3c7b011618bd148f0964660111537698ee0e Author: qianyuan.wqy AuthorDate: Mon Nov 4 15:37:16 2019 +0800 Update doc of events. --- docs/docs/events/common-events.md| 4 ++-- docs/zh/docs/events/common-events.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/events/common-events.md b/docs/docs/events/common-events.md index 8a10b1b..2aeddaa 100644 --- a/docs/docs/events/common-events.md +++ b/docs/docs/events/common-events.md @@ -16,13 +16,13 @@ Weex provide the ability to let events trigger action, like starting a JavaScrip When a parent view has multiple peer views, iOS will select the highest level View to respond to the event, and the underlying view event will never be responded. -Weex add attribute `eventPenetrationEnabled` to `` component. When the value is `true`, the view's children views still respond to the event normally, while the view itself will not respond to the event, but pass the event to the lower level View. +Weex add attribute `eventPenetrationEnabled` to `` component. When the value is `true`(default would be `false`), the view's children views still respond to the event normally, while the view itself will not respond to the event, but pass the event to the lower level View. [Event penetration](https://jsplayground.taobao.org/raxplayground/c230a32e-489c-4fda-ae90-40faa6aaafbc??from=) ## View interactivity -Weex add attribute `userInteractionEnabled` to `` component. When the value is `true`, neither the view nor its children views respond to the event. The event is passed to the lower layer View. +Weex add attribute `userInteractionEnabled` to `` component. When the value is `false`(default would be `true`), neither the view nor its children views respond to the event. The event is passed to the lower layer View. ## Click event diff --git a/docs/zh/docs/events/common-events.md b/docs/zh/docs/events/common-events.md index 98cc1c9..37957e8 100644 --- a/docs/zh/docs/events/common-events.md +++ b/docs/zh/docs/events/common-events.md @@ -10,13 +10,13 @@ Weex 提供了通过事件触发动作的能力,例如在用户点击组件时 当一个父View存在多个同级子View时,由于`iOS`会选择层级最高的View来响应事件,底层的View的事件永远都不会响应。 -Weex在``组件中增加了`eventPenetrationEnabled`属性,当值为`true`时,View的子View仍能正常响应事件,但View自身将不会响应事件,而是将事件向下层View传递。 +Weex在``组件中增加了`eventPenetrationEnabled`属性,当值为`true`(默认为`false`)时,View的子View仍能正常响应事件,但View自身将不会响应事件。 [示例](https://jsplayground.taobao.org/raxplayground/c230a32e-489c-4fda-ae90-40faa6aaafbc??from=) ## View交互性 -Weex在``组件中增加了`userInteractionEnabled`属性,当值为`true`时,View及其子View均不响应事件 事件向下层View传递 +Weex在``组件中增加了`userInteractionEnabled`属性,当值为`false`(默认为`true`)时,View及其子View均不响应事件,事件向下层View传递 ## click
[incubator-weex] branch fix-nan-timer updated (2045413 -> d2a0351)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-nan-timer in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 2045413 [iOS] Fix crash that creating timer with NAN interval. add d2a0351 [iOS] Shield oc lint. No new revisions were added by this update. Summary of changes: ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-weex] branch fix-nan-timer created (now 2045413)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-nan-timer in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 2045413 [iOS] Fix crash that creating timer with NAN interval. This branch includes the following new commits: new 2045413 [iOS] Fix crash that creating timer with NAN interval. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Fix crash that creating timer with NAN interval.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-nan-timer in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 2045413e34f9ba210dd3951575c0e2a8ded896f4 Author: qianyuan.wqy AuthorDate: Thu Oct 24 15:57:04 2019 +0800 [iOS] Fix crash that creating timer with NAN interval. --- ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m index d036409..2d8b7fa 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m @@ -161,6 +161,12 @@ WX_EXPORT_METHOD(@selector(clearInterval:)) - (void)createTimerWithCallback:(NSString *)callbackID time:(NSTimeInterval)milliseconds target:(id)target selector:(SEL)selector shouldRepeat:(BOOL)shouldRepeat { +WXAssert(!isnan(milliseconds), @"Timer interval is NAN."); +if (isnan(milliseconds)) { +WXLogError(@"Create timer with NAN interval."); +return; +} + NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:milliseconds/1000.0f target:target selector:selector userInfo:nil repeats:shouldRepeat]; [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
[incubator-weex] 01/01: Merge pull request #2975 from apache/fix-text-crash
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 62932128021d677475dc80c13f983a0d2f9a1894 Merge: cadd403 5177d07 Author: wqyfavor AuthorDate: Sun Oct 20 23:00:38 2019 +0800 Merge pull request #2975 from apache/fix-text-crash Fix text component's property multi-thread crash. .../WeexSDK/Sources/Component/WXTextComponent.mm | 37 -- 1 file changed, 20 insertions(+), 17 deletions(-)
[incubator-weex] branch master updated (cadd403 -> 6293212)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from cadd403 update HOW-TO-BUILD.md (#2969) add 5177d07 Fix text component's property multi-thread crash. new 6293212 Merge pull request #2975 from apache/fix-text-crash The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../WeexSDK/Sources/Component/WXTextComponent.mm | 37 -- 1 file changed, 20 insertions(+), 17 deletions(-)
[incubator-weex] branch fix-text-crash created (now 5177d07)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-text-crash in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 5177d07 Fix text component's property multi-thread crash. This branch includes the following new commits: new 5177d07 Fix text component's property multi-thread crash. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: Fix text component's property multi-thread crash.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-text-crash in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 5177d07f42d146e69c47e76f3c17aaeb054e0fd5 Author: qianyuan.wqy AuthorDate: Sun Oct 20 18:58:05 2019 +0800 Fix text component's property multi-thread crash. --- .../WeexSDK/Sources/Component/WXTextComponent.mm | 37 -- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm index 7827816..3a95fac 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm @@ -119,7 +119,7 @@ static NSString *const WXTextTruncationToken = @"\u2026"; static CGFloat WXTextDefaultLineThroughWidth = 1.2; @interface WXTextComponent() -@property (nonatomic, strong) NSString *useCoreTextAttr; +@property (atomic, strong) NSString *fontFamily; @end @implementation WXTextComponent @@ -129,7 +129,6 @@ static CGFloat WXTextDefaultLineThroughWidth = 1.2; NSTextStorage *_textStorage; float _textStorageWidth; float _color[4]; -NSString *_fontFamily; float _fontSize; float _fontWeight; WXTextStyle _fontStyle; @@ -150,6 +149,8 @@ static CGFloat WXTextDefaultLineThroughWidth = 1.2; pthread_mutexattr_t _propertMutexAttr; BOOL _observerIconfont; BOOL _enableCopy; + +BOOL _useCoreText; } - (instancetype)initWithRef:(NSString *)ref @@ -169,9 +170,9 @@ static CGFloat WXTextDefaultLineThroughWidth = 1.2; _textAlign = NSTextAlignmentNatural; if ([attributes objectForKey:@"coretext"]) { -_useCoreTextAttr = [WXConvert NSString:attributes[@"coretext"]]; +_useCoreText = [WXConvert BOOL:attributes[@"coretext"]]; } else { -_useCoreTextAttr = nil; +_useCoreText = YES; } _color[0] = -1.0; @@ -185,18 +186,12 @@ static CGFloat WXTextDefaultLineThroughWidth = 1.2; - (BOOL)useCoreText { -if ([_useCoreTextAttr isEqualToString:@"true"]) { -return YES; -} -if ([_useCoreTextAttr isEqualToString:@"false"]) { -return NO; -} -return YES; +return _useCoreText; } - (void)dealloc { -if (_fontFamily && _observerIconfont) { +if (self.fontFamily && _observerIconfont) { [[NSNotificationCenter defaultCenter] removeObserver:self name:WX_ICONFONT_DOWNLOAD_NOTIFICATION object:nil]; } pthread_mutex_destroy(&_ctAttributedStringMutex); @@ -246,7 +241,15 @@ do {\ - (void)fillCSSStyles:(NSDictionary *)styles { -WX_STYLE_FILL_TEXT(fontFamily, fontFamily, NSString, YES) //!OCLint +do { +id value = styles[@"fontFamily"]; +if (value) { +self.fontFamily = [WXConvert NSString:value]; +[self setNeedsRepaint]; +[self setNeedsLayout]; +} +} while(0); + WX_STYLE_FILL_TEXT_PIXEL(fontSize, fontSize, YES) //!OCLint WX_STYLE_FILL_TEXT(fontWeight, fontWeight, WXTextWeight, YES) //!OCLint WX_STYLE_FILL_TEXT(fontStyle, fontStyle, WXTextStyle, YES) //!OCLint @@ -277,7 +280,7 @@ do {\ } } -if (_fontFamily && !_observerIconfont) { +if (self.fontFamily && !_observerIconfont) { // notification received when custom icon font file download finish [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(repaintText:) name:WX_ICONFONT_DOWNLOAD_NOTIFICATION object:nil]; _observerIconfont = YES; @@ -473,7 +476,7 @@ do {\ - (void)repaintText:(NSNotification *)notification { -if (![_fontFamily isEqualToString:notification.userInfo[@"fontFamily"]]) { +if (![self.fontFamily isEqualToString:notification.userInfo[@"fontFamily"]]) { return; } [self setNeedsRepaint]; @@ -499,7 +502,7 @@ do {\ } // set font -UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:WXTextStyleNormal fontFamily:_fontFamily scaleFactor:self.weexInstance.pixelScaleFactor useCoreText:[self useCoreText]]; +UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:WXTextStyleNormal fontFamily:self.fontFamily scaleFactor:self.weexInstance.pixelScaleFactor useCoreText:[self useCoreText]]; CTFontRef ctFont; if (_fontStyle == WXTextStyleItalic) { @@ -587,7 +590,7 @@ do {\ } // set font -UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:_fontStyle fontFamily:_fontFamily scaleFactor:self.weexInstance.pixelScaleFactor]; +UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight textStyle:
[incubator-weex] branch fix-rtl-crash created (now 43f5edb)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-rtl-crash in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 43f5edb Add clearBFCs method and clear BFCs after self-layout of scroller node. This branch includes the following new commits: new 43f5edb Add clearBFCs method and clear BFCs after self-layout of scroller node. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: Add clearBFCs method and clear BFCs after self-layout of scroller node.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-rtl-crash in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 43f5edb6f8daece2797adc10947e19844dfa14ba Author: qianyuan.wqy AuthorDate: Wed Oct 9 11:05:13 2019 +0800 Add clearBFCs method and clear BFCs after self-layout of scroller node. --- ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm | 5 + weex_core/Source/core/layout/layout.h| 4 2 files changed, 9 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm index 4d3f4c9..981a7af 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm @@ -1152,6 +1152,11 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) _flexCssNode->calculateLayout(renderPageSize); _flexCssNode->setParent(parent, _flexCssNode); +/* We must clear BFCs becuase we have set parent of _flexCSSNode to nullptr and + manually called its calculateLayout method. This will cause a non-bfc layout node + to have items in its BFCs vector. Later, a wild pointer may cause crash. */ +_flexCssNode->clearBFCs(); + // set origin and size back _flexCssNode->rewriteLayoutResult(left, top, width, height); } diff --git a/weex_core/Source/core/layout/layout.h b/weex_core/Source/core/layout/layout.h index 6217972..e8d58f7 100644 --- a/weex_core/Source/core/layout/layout.h +++ b/weex_core/Source/core/layout/layout.h @@ -731,6 +731,10 @@ namespace WeexCore { markDirty(); } + +inline void clearBFCs() { +BFCs.clear(); +} inline void addChildAt(WXCoreLayoutNode* const child, Index index) { mChildList.insert(mChildList.begin() + index, child);
[incubator-weex] branch wqyfavor-patch-1 deleted (was 7bb97fc)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch wqyfavor-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. was 7bb97fc [iOS] Fix slider crash on iOS9 The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[incubator-weex] 01/01: Merge pull request #2952 from apache/wqyfavor-patch-1
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 07d22958cdd758669ca4b7828bd374b5334584d7 Merge: 9cb3909 7bb97fc Author: wqyfavor AuthorDate: Tue Oct 8 22:44:39 2019 +0800 Merge pull request #2952 from apache/wqyfavor-patch-1 [iOS] Fix slider crash on iOS9 .../WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 16 1 file changed, 12 insertions(+), 4 deletions(-)
[incubator-weex] branch master updated (9cb3909 -> 07d2295)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 9cb3909 Merge pull request #2946 from YorkShen/release/20190925 add 7bb97fc [iOS] Fix slider crash on iOS9 new 07d2295 Merge pull request #2952 from apache/wqyfavor-patch-1 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 16 1 file changed, 12 insertions(+), 4 deletions(-)
[incubator-weex] branch wqyfavor-patch-1 created (now 7bb97fc)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch wqyfavor-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 7bb97fc [iOS] Fix slider crash on iOS9 This branch includes the following new commits: new 7bb97fc [iOS] Fix slider crash on iOS9 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Fix slider crash on iOS9
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch wqyfavor-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 7bb97fc6035864f2801f8cce27d71dcd3ae872d1 Author: wqyfavor AuthorDate: Tue Oct 8 21:52:52 2019 +0800 [iOS] Fix slider crash on iOS9 --- .../WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm index d3ba26c..5519de8 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm @@ -148,10 +148,6 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)setCurrentIndex:(NSInteger)currentIndex { -if (_currentIndex == currentIndex) { -return; -} - if (currentIndex >= _itemViews.count || currentIndex < 0) { currentIndex = 0; } @@ -368,12 +364,24 @@ typedef NS_ENUM(NSInteger, Direction) { } - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { +/* In this case, we forbid animation temporarily so that + setContentOffset in setCurrentIndex won't cause endless loop + on some devices. + We have to use _forbidSlideAnimation in setCurrentIndex because + sometimes JS will trigger the slider to slide to some posistion + with animation. + */ +BOOL oldValue = _forbidSlideAnimation; +_forbidSlideAnimation = YES; + if (_infinite) { [self resetScrollView]; } else { NSInteger index = _scrollView.contentOffset.x / self.width; [self setCurrentIndex:index]; } + +_forbidSlideAnimation = oldValue; } @end
[incubator-weex] branch fix-background-color-name-collision created (now 3fa4382)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-background-color-name-collision in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 3fa4382 [iOS] Rename the backgroundColor property name. This branch includes the following new commits: new 3fa4382 [iOS] Rename the backgroundColor property name. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Rename the backgroundColor property name.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-background-color-name-collision in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 3fa4382b54e33273f41fbeb533610be4b3e1c711 Author: qianyuan.wqy AuthorDate: Fri Oct 4 17:53:45 2019 +0800 [iOS] Rename the backgroundColor property name. --- ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h | 4 ++-- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m | 10 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 8 ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm | 8 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h index 93f896d..a97dfcb 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h @@ -49,7 +49,7 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); /** * View */ -UIColor *_backgroundColor; +UIColor *_styleBackgroundColor; NSString *_backgroundImage; NSString *_clipRadius; WXClipType _clipToBounds; @@ -178,7 +178,7 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); /** DO NOT use "_backgroundColor" directly. The same reason as '_transform'. */ -@property (atomic, strong) UIColor* backgroundColor; +@property (atomic, strong) UIColor* styleBackgroundColor; ///-- /// @name Package Internal Methods diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 2a74f62..d209068 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -289,7 +289,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { - (void)_collectCompositingDisplayBlocks:(NSMutableArray *)displayBlocks context:(CGContextRef)context isCancelled:(BOOL(^)(void))isCancelled { // TODO: compositingChild has no chance to applyPropertiesToView, need update here? -UIColor *backgroundColor = self.backgroundColor; +UIColor *backgroundColor = self.styleBackgroundColor; BOOL clipsToBounds = _clipToBounds; CGRect frame = self.calculatedFrame; CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height); @@ -349,8 +349,8 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetAlpha(context, _opacity); // fill background color -if (self.backgroundColor && CGColorGetAlpha(self.backgroundColor.CGColor) > 0) { -CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); +if (self.styleBackgroundColor && CGColorGetAlpha(self.styleBackgroundColor.CGColor) > 0) { +CGContextSetFillColorWithColor(context, self.styleBackgroundColor.CGColor); UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; [bezierPath fill]; WXPerformBlockOnMainThread(^{ @@ -594,7 +594,7 @@ do {\ _layer.borderWidth = _borderTopWidth; _layer.borderColor = _borderTopColor.CGColor; if ((_transition.transitionOptions & WXTransitionOptionsBackgroundColor) != WXTransitionOptionsBackgroundColor ) { -_layer.backgroundColor = self.backgroundColor.CGColor; +_layer.backgroundColor = self.styleBackgroundColor.CGColor; } } } @@ -606,7 +606,7 @@ do {\ WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius]; WXRadii *radii = borderRect.radii; BOOL hasBorderRadius = [radii hasBorderRadius]; -return (!hasBorderRadius) && _opacity == 1.0 && CGColorGetAlpha(self.backgroundColor.CGColor) == 1.0 && [self _needsDrawBorder]; +return (!hasBorderRadius) && _opacity == 1.0 && CGColorGetAlpha(self.styleBackgroundColor.CGColor) == 1.0 && [self _needsDrawBorder]; } - (CAShapeLayer *)drawBorderRadiusMaskLayer:(CGRect)rect diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm index ebb5c00..3235dbd 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm @@ -70,7 +70,7 @@ static BOOL bNeedRemoveEvents = YES; } @synthesize transform = _transform; -@synthesize backgroundColor = _backgroundColor; +@synthesize styleBackgroundColor = _styleBackgroundColor; #pragma mark Life Cycle @@ -392,7 +392,7 @@ static BOOL
[incubator-weex] branch master updated: [iOS] Release property name after set property
This is an automated email from the ASF dual-hosted git repository. moshen 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 a32c578 [iOS] Release property name after set property new c9abe38 Merge pull request #2887 from zhongwuzw/fix_js_string_release a32c578 is described below commit a32c5782c4974edabdc1163bf5d59be564ca445e Author: zhongwuzw AuthorDate: Mon Sep 9 15:22:58 2019 +0800 [iOS] Release property name after set property --- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index 89287e5..195b7c8 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -567,6 +567,7 @@ _Pragma("clang diagnostic pop") \ JSObjectSetPrototype(instanceContextRef, JSValueToObject(instanceContextRef, [instanceContextEnvironment valueForProperty:key].JSValueRef, NULL), JSObjectGetPrototype(instanceContextRef, instanceGlobalObject)); } JSObjectSetProperty(instanceContextRef, instanceGlobalObject, propertyName, [instanceContextEnvironment valueForProperty:key].JSValueRef, 0, NULL); +JSStringRelease(propertyName); } if (WX_SYS_VERSION_LESS_THAN(@"10.2")) {
[incubator-weex] branch master updated: [iOS] Break retain cycle when set function of JSContext
This is an automated email from the ASF dual-hosted git repository. moshen 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 cbb8af1 [iOS] Break retain cycle when set function of JSContext new 6be3e96 Merge pull request #2891 from zhongwuzw/break_jsContext_retain_cycle cbb8af1 is described below commit cbb8af1a41520a4fbbc763c62f535e1cc89ca9ac Author: zhongwuzw AuthorDate: Mon Sep 9 20:29:44 2019 +0800 [iOS] Break retain cycle when set function of JSContext --- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index 89287e5..8c00fa3 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -145,12 +145,12 @@ _Pragma("clang diagnostic pop") \ }]; [_jsBridge registerCallUpdateComponentData:^NSInteger(NSString *instanceId, NSString *componentId, NSString *jsonData) { -if (_dataRenderHandler) { +if (weakSelf.dataRenderHandler) { WXPerformBlockOnComponentThread(^{ long start = [WXUtility getUnixFixTimeMillis]; WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId]; [instance.apmInstance addUpdateComponentDataTimestamp:start]; -[_dataRenderHandler callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData]; +[weakSelf.dataRenderHandler callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData]; [instance.apmInstance addUpdateComponentDataTime:[WXUtility getUnixFixTimeMillis] - start]; }); }
[incubator-weex] branch use-property-backgroundcolor created (now bc80ae9)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch use-property-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at bc80ae9 [iOS Use property to access 'backgroundColor'. This branch includes the following new commits: new bc80ae9 [iOS Use property to access 'backgroundColor'. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS Use property to access 'backgroundColor'.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch use-property-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit bc80ae9c1dd43bf1d908b04ce432c64293d76c27 Author: qianyuan.wqy AuthorDate: Mon Sep 30 20:31:24 2019 +0800 [iOS Use property to access 'backgroundColor'. --- .../Sources/Component/WXComponent_internal.h | 7 ++- .../WeexSDK/Sources/Display/WXComponent+Display.m | 22 ++ ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 9 - .../Sources/View/WXComponent+ViewManagement.mm | 14 -- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h index c58a796..93f896d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h @@ -170,11 +170,16 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); NSMutableDictionary *_eventParameters; } -/* _transform may be modified in mutiple threads. DO NOT use "_transform = XXX" directly. +/* DO NOT use "_transform = XXX" directly. Ivar access in ObjC is compiled to code with additional release or retain. So use Ivar in mutiple thread may lead to crash. Use an ATOMIC property is well enough. */ @property (atomic, strong) WXTransform *transform; +/** + DO NOT use "_backgroundColor" directly. The same reason as '_transform'. + */ +@property (atomic, strong) UIColor* backgroundColor; + ///-- /// @name Package Internal Methods ///-- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 021bf07..2a74f62 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -289,7 +289,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { - (void)_collectCompositingDisplayBlocks:(NSMutableArray *)displayBlocks context:(CGContextRef)context isCancelled:(BOOL(^)(void))isCancelled { // TODO: compositingChild has no chance to applyPropertiesToView, need update here? -UIColor *backgroundColor = _backgroundColor; +UIColor *backgroundColor = self.backgroundColor; BOOL clipsToBounds = _clipToBounds; CGRect frame = self.calculatedFrame; CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height); @@ -349,15 +349,13 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetAlpha(context, _opacity); // fill background color -@synchronized (self) { -if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) { -CGContextSetFillColorWithColor(context, _backgroundColor.CGColor); -UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; -[bezierPath fill]; -WXPerformBlockOnMainThread(^{ -_view.backgroundColor = UIColor.clearColor; -}); -} +if (self.backgroundColor && CGColorGetAlpha(self.backgroundColor.CGColor) > 0) { +CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); +UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; +[bezierPath fill]; +WXPerformBlockOnMainThread(^{ +_view.backgroundColor = UIColor.clearColor; +}); } // Top if (_borderTopWidth > 0) { @@ -596,7 +594,7 @@ do {\ _layer.borderWidth = _borderTopWidth; _layer.borderColor = _borderTopColor.CGColor; if ((_transition.transitionOptions & WXTransitionOptionsBackgroundColor) != WXTransitionOptionsBackgroundColor ) { -_layer.backgroundColor = _backgroundColor.CGColor; +_layer.backgroundColor = self.backgroundColor.CGColor; } } } @@ -608,7 +606,7 @@ do {\ WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius]; WXRadii *radii = borderRect.radii; BOOL hasBorderRadius = [radii hasBorderRadius]; -return (!hasBorderRadius) && _opacity == 1.0 && CGColorGetAlpha(_backgroundColor.CGColor) == 1.0 && [self _needsDrawBorder]; +return (!hasBorderRadius) && _opacity == 1.0 && CGColorGetAlpha(self.backgroundColor.CGColor) == 1.0 && [self _needsDrawBorder]; } - (CAShapeLaye
[incubator-weex] branch master updated (6e38fe3 -> c112f2b)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 6e38fe3 Merge pull request #2945 from apache/double11-fix5 add 65e7acb Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2943)" add 3a8a7ff Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2942)" add e2ca906 Revert "[iOS] Fix problem that _backgroundColor causing multithread crashing. (#2934)" add ce42fd6 [iOS] Use lock to add mutex for _backgroundColor property usage. add 3919fdb [iOS] Remove useless switch. add 97840a1 [iOS] Remove useless switch. new c112f2b Merge pull request #2947 from apache/revert-backgroundcolor The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../Sources/Component/WXComponent_internal.h | 10 +-- .../WeexSDK/Sources/Display/WXComponent+Display.m | 73 ++ ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 11 ++-- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h| 2 - ios/sdk/WeexSDK/Sources/Utility/WXConvert.m| 30 - .../Sources/View/WXComponent+ViewManagement.mm | 19 +++--- 6 files changed, 43 insertions(+), 102 deletions(-)
[incubator-weex] 01/01: Merge pull request #2947 from apache/revert-backgroundcolor
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit c112f2b8af2cf2d2105a16e7991d69517e605c30 Merge: 6e38fe3 97840a1 Author: wqyfavor AuthorDate: Mon Sep 30 17:09:43 2019 +0800 Merge pull request #2947 from apache/revert-backgroundcolor Revert backgroundcolor .../Sources/Component/WXComponent_internal.h | 10 +-- .../WeexSDK/Sources/Display/WXComponent+Display.m | 73 ++ ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 11 ++-- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h| 2 - ios/sdk/WeexSDK/Sources/Utility/WXConvert.m| 30 - .../Sources/View/WXComponent+ViewManagement.mm | 19 +++--- 6 files changed, 43 insertions(+), 102 deletions(-)
[incubator-weex] branch revert-backgroundcolor updated (3919fdb -> 97840a1)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 3919fdb [iOS] Remove useless switch. add 97840a1 [iOS] Remove useless switch. No new revisions were added by this update. Summary of changes: ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-weex] branch revert-backgroundcolor updated (ce42fd6 -> 3919fdb)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from ce42fd6 [iOS] Use lock to add mutex for _backgroundColor property usage. add 3919fdb [iOS] Remove useless switch. No new revisions were added by this update. Summary of changes: ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m | 9 + 1 file changed, 1 insertion(+), 8 deletions(-)
[incubator-weex] 03/04: Revert "[iOS] Fix problem that _backgroundColor causing multithread crashing. (#2934)"
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit e2ca9062283d9768dfdd68f259f7b9fb3f98f6bf Author: qianyuan.wqy AuthorDate: Mon Sep 30 16:11:58 2019 +0800 Revert "[iOS] Fix problem that _backgroundColor causing multithread crashing. (#2934)" This reverts commit 87454ac332908c2d21bebc694e8db0538b05a3a0. --- .../Sources/Component/WXComponent_internal.h | 10 ++-- .../WeexSDK/Sources/Display/WXComponent+Display.m | 61 +- ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m | 9 +++- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 9 ++-- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h| 2 - ios/sdk/WeexSDK/Sources/Utility/WXConvert.m| 30 --- .../Sources/View/WXComponent+ViewManagement.mm | 13 +++-- 7 files changed, 36 insertions(+), 98 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h index e124c5b..c58a796 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h @@ -49,7 +49,7 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); /** * View */ -uint32_t _backgroundColor; +UIColor *_backgroundColor; NSString *_backgroundImage; NSString *_clipRadius; WXClipType _clipToBounds; @@ -114,10 +114,10 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); BOOL _isCompositingChild; WXThreadSafeCounter *_displayCounter; -uint32_t _borderTopColor; -uint32_t _borderRightColor; -uint32_t _borderLeftColor; -uint32_t _borderBottomColor; +UIColor *_borderTopColor; +UIColor *_borderRightColor; +UIColor *_borderLeftColor; +UIColor *_borderBottomColor; CGFloat _borderTopWidth; CGFloat _borderRightWidth; diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index c4eb81f..9acb010 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -28,7 +28,6 @@ #import "UIBezierPath+Weex.h" #import "WXRoundedRect.h" #import "WXSDKInstance.h" -#import "WXConvert.h" #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" @@ -290,7 +289,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { - (void)_collectCompositingDisplayBlocks:(NSMutableArray *)displayBlocks context:(CGContextRef)context isCancelled:(BOOL(^)(void))isCancelled { // TODO: compositingChild has no chance to applyPropertiesToView, need update here? -UIColor *backgroundColor = [WXConvert UIColorFromRGBA:_backgroundColor]; +UIColor *backgroundColor = _backgroundColor; BOOL clipsToBounds = _clipToBounds; CGRect frame = self.calculatedFrame; CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height); @@ -350,9 +349,8 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetAlpha(context, _opacity); // fill background color -UIColor* backgroundColor = [WXConvert UIColorFromRGBA:_backgroundColor]; -if (CGColorGetAlpha(backgroundColor.CGColor) > 0) { -CGContextSetFillColorWithColor(context, backgroundColor.CGColor); +if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) { +CGContextSetFillColorWithColor(context, _backgroundColor.CGColor); UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; [bezierPath fill]; WXPerformBlockOnMainThread(^{ @@ -369,7 +367,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetLineDash(context, 0, 0, 0); } CGContextSetLineWidth(context, _borderTopWidth); -CGContextSetStrokeColorWithColor(context, [WXConvert UIColorFromRGBA:_borderTopColor].CGColor); +CGContextSetStrokeColorWithColor(context, _borderTopColor.CGColor); CGContextAddArc(context, size.width-topRight, topRight, topRight-_borderTopWidth/2, -M_PI_4+(_borderRightWidth>0?0:M_PI_4), -M_PI_2, 1); CGContextMoveToPoint(context, size.width-topRight, _borderTopWidth/2); CGContextAddLineToPoint(context, topLeft, _borderTopWidth/2); @@ -390,7 +388,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetLineDash(context, 0, 0, 0); } CGContextSetLineWidth(context, _borderLeftWidth); -CGContextSetStrokeColorWithColor(context, [WXConvert UIColorFromRGBA:_borderLeftColor].CGColor); +CGContextSetStrokeColorWithColor(context,
[incubator-weex] 01/04: Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2943)"
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 65e7acbe14de7f7bc87b577f7a30ace98cea5b32 Author: qianyuan.wqy AuthorDate: Mon Sep 30 16:11:08 2019 +0800 Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2943)" This reverts commit f2786a1842f7f52a2e7e23f9018f15eb07f8b99b. --- ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index 4ad089f..117f2a4 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m @@ -440,7 +440,7 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue) g = g8 / 255.f; b = b8 / 255.f; a = a8 / 255.f; -return a < (0.5 / 255.f) ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; +return a < 0.5 ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; } + (uint32_t)RGBAColorFromUIColor:(UIColor*)color
[incubator-weex] branch revert-backgroundcolor created (now ce42fd6)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at ce42fd6 [iOS] Use lock to add mutex for _backgroundColor property usage. This branch includes the following new commits: new 65e7acb Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2943)" new 3a8a7ff Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2942)" new e2ca906 Revert "[iOS] Fix problem that _backgroundColor causing multithread crashing. (#2934)" new ce42fd6 [iOS] Use lock to add mutex for _backgroundColor property usage. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 02/04: Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2942)"
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 3a8a7ffd8fda70a1867b6e8c99f6e9007dd28adc Author: qianyuan.wqy AuthorDate: Mon Sep 30 16:11:22 2019 +0800 Revert "[iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2942)" This reverts commit 2c169da9bf875c2864bd02fe07af61f17ad888fe. --- ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index 117f2a4..6861b08 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m @@ -440,7 +440,7 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue) g = g8 / 255.f; b = b8 / 255.f; a = a8 / 255.f; -return a < 0.5 ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; +return [UIColor colorWithRed:r green:g blue:b alpha:a]; } + (uint32_t)RGBAColorFromUIColor:(UIColor*)color
[incubator-weex] 04/04: [iOS] Use lock to add mutex for _backgroundColor property usage.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch revert-backgroundcolor in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit ce42fd61096c05184097681292502dcc3dc146aa Author: qianyuan.wqy AuthorDate: Mon Sep 30 16:44:16 2019 +0800 [iOS] Use lock to add mutex for _backgroundColor property usage. --- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m| 16 +--- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 4 +++- .../WeexSDK/Sources/View/WXComponent+ViewManagement.mm | 12 +--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 9acb010..021bf07 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -349,13 +349,15 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetAlpha(context, _opacity); // fill background color -if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) { -CGContextSetFillColorWithColor(context, _backgroundColor.CGColor); -UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; -[bezierPath fill]; -WXPerformBlockOnMainThread(^{ -_view.backgroundColor = UIColor.clearColor; -}); +@synchronized (self) { +if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) { +CGContextSetFillColorWithColor(context, _backgroundColor.CGColor); +UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; +[bezierPath fill]; +WXPerformBlockOnMainThread(^{ +_view.backgroundColor = UIColor.clearColor; +}); +} } // Top if (_borderTopWidth > 0) { diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm index a60251c..9e44231 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm @@ -857,7 +857,9 @@ static BOOL bNeedRemoveEvents = YES; UIColor * endColor = (UIColor*)linearGradient[@"endColor"]; CAGradientLayer * gradientLayer = [WXUtility gradientLayerFromColors:@[startColor, endColor] locations:nil frame:strongSelf.view.bounds gradientType:(WXGradientType)[linearGradient[@"gradientType"] integerValue]]; if (gradientLayer) { -_backgroundColor = [UIColor colorWithPatternImage:[strongSelf imageFromLayer:gradientLayer]]; +@synchronized (strongSelf) { +_backgroundColor = [UIColor colorWithPatternImage:[strongSelf imageFromLayer:gradientLayer]]; +} strongSelf.view.backgroundColor = _backgroundColor; [strongSelf setNeedsDisplay]; } diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm index 3d97548..4c184a0 100644 --- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm +++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.mm @@ -193,7 +193,9 @@ do {\ { WX_CHECK_COMPONENT_TYPE(self.componentType) if (styles[@"backgroundColor"]) { -_backgroundColor = [WXConvert UIColor:styles[@"backgroundColor"]]; +@synchronized (self) { +_backgroundColor = [WXConvert UIColor:styles[@"backgroundColor"]]; +} } if (styles[@"opacity"]) { _opacity = [WXConvert CGFloat:styles[@"opacity"]]; @@ -211,7 +213,9 @@ do {\ } if (styles[@"backgroundColor"]) { -_backgroundColor = [WXConvert UIColor:styles[@"backgroundColor"]]; +@synchronized (self) { +_backgroundColor = [WXConvert UIColor:styles[@"backgroundColor"]]; +} [self setNeedsDisplay]; } @@ -307,7 +311,9 @@ do {\ - (void)_resetStyles:(NSArray *)styles { if (styles && [styles containsObject:@"backgroundColor"]) { -_backgroundColor = [UIColor clearColor]; +@synchronized (self) { +_backgroundColor = [UIColor clearColor]; +} [self setNeedsDisplay]; } if (styles && [styles containsObject:@"boxShadow"]) {
[incubator-weex] 01/01: Merge pull request #2945 from apache/double11-fix5
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 6e38fe39d223688268de2504475d19318ebf6116 Merge: f2786a1 cb7fe03 Author: wqyfavor AuthorDate: Mon Sep 30 14:11:12 2019 +0800 Merge pull request #2945 from apache/double11-fix5 [iOS] Protect endless iteration when setting index for slider view. ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 4 1 file changed, 4 insertions(+)
[incubator-weex] branch master updated (f2786a1 -> 6e38fe3)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from f2786a1 [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. (#2943) add cb7fe03 [iOS] Protect endless iteration when setting index for slider view. new 6e38fe3 Merge pull request #2945 from apache/double11-fix5 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 4 1 file changed, 4 insertions(+)
[incubator-weex] branch double11-fix5 created (now cb7fe03)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch double11-fix5 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at cb7fe03 [iOS] Protect endless iteration when setting index for slider view. This branch includes the following new commits: new cb7fe03 [iOS] Protect endless iteration when setting index for slider view. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Protect endless iteration when setting index for slider view.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix5 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit cb7fe03233744d34849c92b1cc20be2a5a86e4a8 Author: qianyuan.wqy AuthorDate: Mon Sep 30 11:16:57 2019 +0800 [iOS] Protect endless iteration when setting index for slider view. --- ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 4 1 file changed, 4 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm index 865778c..d3ba26c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm @@ -148,6 +148,10 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)setCurrentIndex:(NSInteger)currentIndex { +if (_currentIndex == currentIndex) { +return; +} + if (currentIndex >= _itemViews.count || currentIndex < 0) { currentIndex = 0; }
[incubator-weex] branch double11-fix4 created (now 6d69956)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch double11-fix4 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 6d69956 [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. This branch includes the following new commits: new 6d69956 [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix4 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 6d69956799be1e618b0caccfe5178640fdfd248b Author: qianyuan.wqy AuthorDate: Sun Sep 29 13:28:59 2019 +0800 [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. --- ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index 117f2a4..4ad089f 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m @@ -440,7 +440,7 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue) g = g8 / 255.f; b = b8 / 255.f; a = a8 / 255.f; -return a < 0.5 ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; +return a < (0.5 / 255.f) ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; } + (uint32_t)RGBAColorFromUIColor:(UIColor*)color
[incubator-weex] 01/01: [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix3 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit d4667ac3b6cb335b2d96bc7942742e652f5b Author: qianyuan.wqy AuthorDate: Fri Sep 27 10:32:04 2019 +0800 [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. --- ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index 6861b08..117f2a4 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m @@ -440,7 +440,7 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue) g = g8 / 255.f; b = b8 / 255.f; a = a8 / 255.f; -return [UIColor colorWithRed:r green:g blue:b alpha:a]; +return a < 0.5 ? [UIColor clearColor] : [UIColor colorWithRed:r green:g blue:b alpha:a]; } + (uint32_t)RGBAColorFromUIColor:(UIColor*)color
[incubator-weex] branch double11-fix3 created (now d4667ac)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch double11-fix3 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at d4667ac [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. This branch includes the following new commits: new d4667ac [iOS] Fix the problem that background color should use [UIColor clearColor] instance when transparent. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch double11-fix2 updated: [iOS] Fix the issue that iOS13 logic not working if config center is not set.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix2 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git The following commit(s) were added to refs/heads/double11-fix2 by this push: new 4222c2b [iOS] Fix the issue that iOS13 logic not working if config center is not set. 4222c2b is described below commit 4222c2bd3d4378b8baeb6559747c17fcc2a99895 Author: qianyuan.wqy AuthorDate: Thu Sep 26 14:03:01 2019 +0800 [iOS] Fix the issue that iOS13 logic not working if config center is not set. --- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 4 1 file changed, 4 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 360ad4f..7a22748 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -606,6 +606,10 @@ typedef enum : NSUInteger { BOOL alwaysUseMRCForObjectToWeexCore = [[configCenter configForKey:@"iOS_weex_ext_config.alwaysUseMRC" defaultValue:@(NO) isDefault:NULL] boolValue]; ConvertSwitches(isIOS13, useMRCForInvalidJSONObject, alwaysUseMRCForObjectToWeexCore); } +else { +BOOL isIOS13 = [[[UIDevice currentDevice] systemVersion] integerValue] == 13; +ConvertSwitches(isIOS13, YES, NO); +} return NO; }
[incubator-weex] 01/01: [iOS] Fix issue JS thread may be deallocated not in JS thread.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix2 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit b11decf9226542a38e164b937a817732520af026 Author: qianyuan.wqy AuthorDate: Thu Sep 26 14:02:31 2019 +0800 [iOS] Fix issue JS thread may be deallocated not in JS thread. --- ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm index 9293fa5..9caff56 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm @@ -80,6 +80,7 @@ { _jsContext.instanceId = nil; __block JSContext* theContext = _jsContext; +_jsContext = nil; // Make sure that the context MUST be freed in JS thread. WXPerformBlockOnBridgeThreadForInstance(^{ theContext = nil; // release the context in js thread to avoid main-thread deadlock }, _weexInstanceId);
[incubator-weex] branch double11-fix2 created (now b11decf)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch double11-fix2 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at b11decf [iOS] Fix issue JS thread may be deallocated not in JS thread. This branch includes the following new commits: new b11decf [iOS] Fix issue JS thread may be deallocated not in JS thread. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Fix problem that _backgroundColor causing multithread crashing.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit bfdf15c53a6bf08ac394e3703ef91971a9afaa27 Author: qianyuan.wqy AuthorDate: Wed Sep 25 12:29:04 2019 +0800 [iOS] Fix problem that _backgroundColor causing multithread crashing. --- .../Sources/Component/WXComponent_internal.h | 10 ++-- .../WeexSDK/Sources/Display/WXComponent+Display.m | 61 +- ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m | 9 +--- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 9 ++-- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h| 2 + ios/sdk/WeexSDK/Sources/Utility/WXConvert.m| 30 +++ .../Sources/View/WXComponent+ViewManagement.mm | 13 ++--- 7 files changed, 98 insertions(+), 36 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h index c58a796..e124c5b 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h @@ -49,7 +49,7 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); /** * View */ -UIColor *_backgroundColor; +uint32_t _backgroundColor; NSString *_backgroundImage; NSString *_clipRadius; WXClipType _clipToBounds; @@ -114,10 +114,10 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate); BOOL _isCompositingChild; WXThreadSafeCounter *_displayCounter; -UIColor *_borderTopColor; -UIColor *_borderRightColor; -UIColor *_borderLeftColor; -UIColor *_borderBottomColor; +uint32_t _borderTopColor; +uint32_t _borderRightColor; +uint32_t _borderLeftColor; +uint32_t _borderBottomColor; CGFloat _borderTopWidth; CGFloat _borderRightWidth; diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 9acb010..c4eb81f 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -28,6 +28,7 @@ #import "UIBezierPath+Weex.h" #import "WXRoundedRect.h" #import "WXSDKInstance.h" +#import "WXConvert.h" #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" @@ -289,7 +290,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { - (void)_collectCompositingDisplayBlocks:(NSMutableArray *)displayBlocks context:(CGContextRef)context isCancelled:(BOOL(^)(void))isCancelled { // TODO: compositingChild has no chance to applyPropertiesToView, need update here? -UIColor *backgroundColor = _backgroundColor; +UIColor *backgroundColor = [WXConvert UIColorFromRGBA:_backgroundColor]; BOOL clipsToBounds = _clipToBounds; CGRect frame = self.calculatedFrame; CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height); @@ -349,8 +350,9 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetAlpha(context, _opacity); // fill background color -if (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) > 0) { -CGContextSetFillColorWithColor(context, _backgroundColor.CGColor); +UIColor* backgroundColor = [WXConvert UIColorFromRGBA:_backgroundColor]; +if (CGColorGetAlpha(backgroundColor.CGColor) > 0) { +CGContextSetFillColorWithColor(context, backgroundColor.CGColor); UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; [bezierPath fill]; WXPerformBlockOnMainThread(^{ @@ -367,7 +369,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetLineDash(context, 0, 0, 0); } CGContextSetLineWidth(context, _borderTopWidth); -CGContextSetStrokeColorWithColor(context, _borderTopColor.CGColor); +CGContextSetStrokeColorWithColor(context, [WXConvert UIColorFromRGBA:_borderTopColor].CGColor); CGContextAddArc(context, size.width-topRight, topRight, topRight-_borderTopWidth/2, -M_PI_4+(_borderRightWidth>0?0:M_PI_4), -M_PI_2, 1); CGContextMoveToPoint(context, size.width-topRight, _borderTopWidth/2); CGContextAddLineToPoint(context, topLeft, _borderTopWidth/2); @@ -388,7 +390,7 @@ typedef NS_ENUM(NSInteger, WXComponentBorderRecord) { CGContextSetLineDash(context, 0, 0, 0); } CGContextSetLineWidth(context, _borderLeftWidth); -CGContextSetStrokeColorWithColor(context, _borderLeftColor.CGColor); +CGContextSetStrokeColorWithColor(context, [WXConvert UIColorFromRGBA:_borderLeftColor].CGColor); CGContextAddArc(context, topLeft, topLeft, topLeft-_borderLe
[incubator-weex] branch double11-fix created (now bfdf15c)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch double11-fix in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at bfdf15c [iOS] Fix problem that _backgroundColor causing multithread crashing. This branch includes the following new commits: new bfdf15c [iOS] Fix problem that _backgroundColor causing multithread crashing. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch master updated: [iOS] Protect for invalid JSON object on iOS13 which will crash.
This is an automated email from the ASF dual-hosted git repository. moshen 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 1461699 [iOS] Protect for invalid JSON object on iOS13 which will crash. new 315f88f Merge pull request #2931 from wqyfavor/fix_json_crash_ios13 1461699 is described below commit 146169900bdc8093cec47817d3dccfc9d763be23 Author: qianyuan.wqy AuthorDate: Mon Sep 23 21:08:16 2019 +0800 [iOS] Protect for invalid JSON object on iOS13 which will crash. --- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 8 ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h| 1 + ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m| 2 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 6 +++ ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h | 8 .../WeexSDK/Sources/Utility/WXConvertUtility.mm| 53 ++ 6 files changed, 78 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm index e241609..d739d63 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm @@ -1302,6 +1302,7 @@ break; \ _customPages[sId] = page; } +SetConvertCurrentPage(pageId); [WXCustomPageBridge parseRenderObject:data parentRef:"" index:0 genObject:^(const std::string &ref, const std::string &type, const std::string &parentRef, std::map *styles, std::map *attrs, std::set *events, int index) { if (parentRef.empty()) { // is root body @@ -1343,6 +1344,7 @@ break; \ { RenderPageCustom* page = [self getPage:pageId]; if (page && page->IsValid()) { +SetConvertCurrentPage(pageId); page->UpdateAttr([ref UTF8String] ?: "", [WXCustomPageBridge parseMapValuePairs:data]); } } @@ -1351,6 +1353,7 @@ break; \ { RenderPageCustom* page = [self getPage:pageId]; if (page && page->IsValid()) { +SetConvertCurrentPage(pageId); page->UpdateStyle([ref UTF8String] ?: "", [WXCustomPageBridge parseMapValuePairs:data]); } } @@ -1406,6 +1409,7 @@ break; \ if (target && target->shouldHandleModuleMethod([moduleName UTF8String] ?: "", [methodName UTF8String] ?: "")) { __block const char* seralizedArguments = nullptr; __block const char* seralizedOptions = nullptr; +SetConvertCurrentPage(pageId); ConvertToCString(arguments, ^(const char * value) { if (value != nullptr) { seralizedArguments = strdup(value); @@ -1495,6 +1499,7 @@ break; \ if (target) { __block const char* seralizedArguments = nullptr; __block const char* seralizedOptions = nullptr; +SetConvertCurrentPage(pageId); ConvertToCString(arguments, ^(const char * value) { if (value != nullptr) { seralizedArguments = strdup(value); @@ -1847,6 +1852,7 @@ static WeexCore::ScriptBridge* jsBridge = nullptr; return; } +SetConvertCurrentPage(pageId); const std::string page([pageId UTF8String] ?: ""); RenderManager::GetInstance()->CreatePage(page, [&] (RenderPage* pageInstance) -> RenderObject* { pageInstance->set_before_layout_needed(false); // we do not need before and after layout @@ -1868,11 +1874,13 @@ static WeexCore::ScriptBridge* jsBridge = nullptr; + (void)callUpdateAttrs:(NSString*)pageId ref:(NSString*)ref data:(NSDictionary*)data { +SetConvertCurrentPage(pageId); WeexCore::RenderManager::GetInstance()->UpdateAttr([pageId UTF8String] ?: "", [ref UTF8String] ?: "", [self _parseMapValuePairs:data]); } + (void)callUpdateStyle:(NSString*)pageId ref:(NSString*)ref data:(NSDictionary*)data { +SetConvertCurrentPage(pageId); WeexCore::RenderManager::GetInstance()->UpdateStyle([pageId UTF8String] ?: "", [ref UTF8String] ?: "", [self _parseMapValuePairs:data]); } diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h index 449ab92..17fa069 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h @@ -107,6 +107,7 @@ typedef NS_ENUM(int, WXSDKErrCode) WX_KEY_EXCEPTION_EMPTY_SCREEN_NATIVE = -9701, WX_KEY_EXCEPTION_NO_BUNDLE_TYPE = -9801, +WX_KEY_EXCEPTION_INVALID_JSON_OBJECT = -9802, WX_KEY_EXCEPTION_HERON_ERROR = -9900, WX_KEY_EXCEPTION_HERON_RENDER_ERROR = -9901, diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m index 8d7bc9d..0f06927 100644 --- a/ios/sdk/WeexS
[incubator-weex] branch remove-too-many-timers-report updated (6ceb5c5 -> 728aa0d)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch remove-too-many-timers-report in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 6ceb5c5 [iOS] Remove 'Too many timers' report. add 728aa0d [iOS] Remove 'Too many timers' report. No new revisions were added by this update. Summary of changes: ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m | 1 - 1 file changed, 1 deletion(-)
[incubator-weex] 01/01: [iOS] Remove 'Too many timers' report.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch remove-too-many-timers-report in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 6ceb5c5f92ebcddb0290b520851e8a9e7e076d51 Author: qianyuan.wqy AuthorDate: Mon Sep 23 10:15:24 2019 +0800 [iOS] Remove 'Too many timers' report. --- ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h| 1 - ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 9 - 2 files changed, 10 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h index b628b06..449ab92 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h @@ -106,7 +106,6 @@ typedef NS_ENUM(int, WXSDKErrCode) WX_KEY_EXCEPTION_EMPTY_SCREEN_JS = -9700, WX_KEY_EXCEPTION_EMPTY_SCREEN_NATIVE = -9701, -WX_KEY_EXCEPTION_TOO_MANY_TIMERS = -9800, WX_KEY_EXCEPTION_NO_BUNDLE_TYPE = -9801, WX_KEY_EXCEPTION_HERON_ERROR = -9900, diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m index e6c158f..d036409 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m @@ -77,7 +77,6 @@ @implementation WXTimerModule { -BOOL _tooManyTimersReported; NSMutableDictionary *_timers; } @@ -178,14 +177,6 @@ WX_EXPORT_METHOD(@selector(clearInterval:)) } } [_timers removeObjectsForKeys:invalidTimerIds]; - -// If alive timer count still exceeds 30, we report once for this page. -if ([_timers count] > 30) { -if (!_tooManyTimersReported) { -[WXExceptionUtils commitCriticalExceptionRT:self.weexInstance.instanceId errCode:[NSString stringWithFormat:@"%d", WX_KEY_EXCEPTION_TOO_MANY_TIMERS] function:@"" exception:@"Too many timers." extParams:nil]; -_tooManyTimersReported = YES; -} -} } } }
[incubator-weex] branch remove-too-many-timers-report created (now 6ceb5c5)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch remove-too-many-timers-report in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 6ceb5c5 [iOS] Remove 'Too many timers' report. This branch includes the following new commits: new 6ceb5c5 [iOS] Remove 'Too many timers' report. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch record-last-url created (now 6648d44)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch record-last-url in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 6648d44 [iOS] Add last page info. This branch includes the following new commits: new 6648d44 [iOS] Add last page info. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: [iOS] Add last page info.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch record-last-url in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 6648d4401705aea4027cef01700867d414e59517 Author: qianyuan.wqy AuthorDate: Wed Sep 18 14:55:30 2019 +0800 [iOS] Add last page info. --- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 6 ++ ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 21 + 2 files changed, 27 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h index 9705761..16e1aa6 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h @@ -440,6 +440,12 @@ typedef enum : NSUInteger { */ - (void)setViewportWidth:(CGFloat)width; +/** + * @abstract Get information about the last rendered page. + Useful fot debugging and fixing online bugs. + */ ++ (NSDictionary*)lastPageInfo; + /** * Deprecated */ diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 8f4bf9e..1a09028 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -60,6 +60,9 @@ NSString *const bundleResponseUrlOptionKey = @"bundleResponseUrl"; NSTimeInterval JSLibInitTime = 0; +static NSString* lastPageInfoLock = @""; +static NSDictionary* lastPageInfo = nil; + typedef enum : NSUInteger { WXLoadTypeNormal, WXLoadTypeBack, @@ -316,6 +319,11 @@ typedef enum : NSUInteger { return; } WXLogInfo(@"pageid: %@ renderWithURL: %@", _instanceId, url.absoluteString); + +@synchronized (lastPageInfoLock) { +lastPageInfo = @{@"pageId": [_instanceId copy], @"url": [url absoluteString] ?: @""}; +} + [WXCoreBridge install]; if (_useBackupJsThread) { [[WXSDKManager bridgeMgr] executeJSTaskQueue]; @@ -339,6 +347,10 @@ typedef enum : NSUInteger { _options = [options isKindOfClass:[NSDictionary class]] ? options : nil; _jsData = data; WXLogInfo(@"pageid: %@ renderView pageNmae: %@ options: %@", _instanceId, _pageName, options); + +@synchronized (lastPageInfoLock) { +lastPageInfo = @{@"pageId": [_instanceId copy], @"options": options ? [options description] : @""}; +} [WXCoreBridge install]; if (_useBackupJsThread) { @@ -1141,6 +1153,15 @@ typedef enum : NSUInteger { } } ++ (NSDictionary*)lastPageInfo +{ +NSDictionary* result; +@synchronized (lastPageInfoLock) { +result = [lastPageInfo copy]; +} +return result; +} + @end @implementation WXSDKInstance (Deprecated)
[incubator-weex] branch master updated: [iOS] close MultiJSThread and add some log
This is an automated email from the ASF dual-hosted git repository. moshen 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 08345d7 [iOS] close MultiJSThread and add some log new 984c2f2 Merge pull request #2909 from jianhan-he/master 08345d7 is described below commit 08345d7c6d1fb005a9d70986366508e07d55dc66 Author: linghe.lh AuthorDate: Mon Sep 16 18:58:21 2019 +0800 [iOS] close MultiJSThread and add some log --- ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m | 2 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m index 207abab..ff89cfc 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m @@ -69,7 +69,7 @@ static NSThread *WXBackupBridgeThread; self = [super init]; if (self) { _bridgeCtx = [[WXBridgeContext alloc] init]; -_supportMultiJSThread = YES; +_supportMultiJSThread = NO; _jsTaskQueue = [NSMutableArray array]; } return self; diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index adc6293..8f4bf9e 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -315,6 +315,7 @@ typedef enum : NSUInteger { WXLogError(@"Url must be passed if you use renderWithURL"); return; } +WXLogInfo(@"pageid: %@ renderWithURL: %@", _instanceId, url.absoluteString); [WXCoreBridge install]; if (_useBackupJsThread) { [[WXSDKManager bridgeMgr] executeJSTaskQueue]; @@ -337,6 +338,8 @@ typedef enum : NSUInteger { { _options = [options isKindOfClass:[NSDictionary class]] ? options : nil; _jsData = data; +WXLogInfo(@"pageid: %@ renderView pageNmae: %@ options: %@", _instanceId, _pageName, options); + [WXCoreBridge install]; if (_useBackupJsThread) { [[WXSDKManager bridgeMgr] executeJSTaskQueue];
[incubator-weex] branch master updated (5e8d9ac -> 7ea24be)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 5e8d9ac [Android] Fix Crash in NotifyLayout (#2902) new 263521e bugfix ios 8.11.1 multithreading crash by eagle destroy instance new e788595 bugfix ios 8.11.1 crash by destroy instance on multithreading new 7ea24be Merge pull request #2905 from pengtaopt/feature/bugfix_ios_8.11.1_comp_thread The 11764 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m| 21 + ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 1 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 10 +- weex-playground | 2 +- .../core/bridge/platform/core_side_in_platform.cpp | 8 ++-- 5 files changed, 18 insertions(+), 24 deletions(-)
[incubator-weex] 01/01: Initialize weex using portrait screen size.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-device-portrait in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit b77f9e7fbaff12d6f900ee70ab482cda201e7dfc Author: qianyuan.wqy AuthorDate: Mon Sep 16 11:04:45 2019 +0800 Initialize weex using portrait screen size. --- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm index 44cd38b..fb3a03c 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm @@ -1538,11 +1538,14 @@ static WeexCore::ScriptBridge* jsBridge = nullptr; env->AddOption("scale", "1"); env->AddOption("pixel_scale", std::to_string([[UIScreen mainScreen] scale])); +// Here we initialize weex device width and height using portrait by default. CGSize screenSize = [UIScreen mainScreen].bounds.size; -env->SetDeviceWidth(std::to_string(screenSize.width)); -env->SetDeviceHeight(std::to_string(screenSize.height)); -env->AddOption("screen_width_pixels", std::to_string(screenSize.width)); -env->AddOption("screen_height_pixels", std::to_string(screenSize.height)); +CGFloat w = MIN(screenSize.width, screenSize.height); +CGFloat h = MAX(screenSize.width, screenSize.height); +env->SetDeviceWidth(std::to_string(w)); +env->SetDeviceHeight(std::to_string(h)); +env->AddOption("screen_width_pixels", std::to_string(w)); +env->AddOption("screen_height_pixels", std::to_string(h)); weex::base::LogImplement::getLog()->setLogImplement(new WeexCore::LogBridgeIOS()); @@ -1552,8 +1555,6 @@ static WeexCore::ScriptBridge* jsBridge = nullptr; weex::base::LogImplement::getLog()->setDebugMode(false); #endif - - platformBridge = new WeexCore::PlatformBridge(); platformBridge->set_platform_side(new WeexCore::IOSSide()); platformBridge->set_core_side(new WeexCore::CoreSideInPlatform());
[incubator-weex] branch fix-device-portrait created (now b77f9e7)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-device-portrait in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at b77f9e7 Initialize weex using portrait screen size. This branch includes the following new commits: new b77f9e7 Initialize weex using portrait screen size. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: Optimize iOS logs.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch optimize-tlog in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 3adeb8a1d4c1e6d36aadea50e15944243867298c Author: qianyuan.wqy AuthorDate: Wed Sep 11 18:35:56 2019 +0800 Optimize iOS logs. --- ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m | 5 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 14 ++- .../WeexSDK/Sources/Performance/WXApmForInstance.m | 1 + weex_core/Source/core/bridge/script_bridge.h | 1 - .../render/action/render_action_createfinish.cpp | 1 - .../Source/core/render/manager/render_manager.cpp | 28 ++ 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m index c53229d..207abab 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m @@ -530,6 +530,8 @@ void WXPerformBlockSyncOnBridgeThreadForInstance(void (^block) (void), NSString* - (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion { +WXLogInfo(@"Register service: %@, options: %@", name, options); + if (!name || !serviceScript || !options) { if (completion) { completion(NO); @@ -557,6 +559,7 @@ void WXPerformBlockSyncOnBridgeThreadForInstance(void (^block) (void), NSString* { if (!name) return; +WXLogInfo(@"Unregister service: %@", name); NSString *script = [WXServiceFactory unregisterServiceScript:name]; __weak typeof(self) weakSelf = self; @@ -575,6 +578,7 @@ void WXPerformBlockSyncOnBridgeThreadForInstance(void (^block) (void), NSString* if (!modules) return; modules = [WXUtility convertContainerToImmutable:modules]; +WXLogInfo(@"Register modules: %@", modules); __weak typeof(self) weakSelf = self; WXPerformBlockOnBridgeThread(^(){ @@ -590,6 +594,7 @@ void WXPerformBlockSyncOnBridgeThreadForInstance(void (^block) (void), NSString* if (!components) return; components = [WXUtility convertContainerToImmutable:components]; +WXLogInfo(@"Register components: %@", components); __weak typeof(self) weakSelf = self; WXPerformBlockOnBridgeThread(^(){ diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 0bcda66..1824b13 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -124,6 +124,8 @@ typedef enum : NSUInteger { } } +WXLogInfo(@"Create instance: %@, render type: %@", _instanceId, _renderType); + // TODO self is retained here. [WXSDKManager storeInstance:self forID:_instanceId]; @@ -206,6 +208,12 @@ typedef enum : NSUInteger { return [NSString stringWithFormat:@"<%@: %p; id = %@; rootView = %p; url= %@>", NSStringFromClass([self class]), self, _instanceId, (__bridge void*)_rootView, _scriptURL]; } +- (void)setParentInstance:(WXSDKInstance *)parentInstance +{ +WXLogInfo(@"Embed instance %@ into parent instance %@", _instanceId, parentInstance.instanceId); +_parentInstance = parentInstance; +} + #pragma mark Public Mehtods - (UIView *)rootView @@ -710,12 +718,13 @@ typedef enum : NSUInteger { }; _mainBundleLoader.onFailed = ^(NSError *loadError) { +WXLogError(@"Request failed with error: %@", loadError); + NSString *errorMessage = [NSString stringWithFormat:@"Request to %@ occurs an error:%@, info:%@", request.URL, loadError.localizedDescription, loadError.userInfo]; long wxErrorCode = [loadError.domain isEqualToString:NSURLErrorDomain] && loadError.code == NSURLErrorNotConnectedToInternet ? WX_ERR_NOT_CONNECTED_TO_INTERNET : WX_ERR_JSBUNDLE_DOWNLOAD; WX_MONITOR_FAIL_ON_PAGE(WXMTJSDownload, wxErrorCode, errorMessage, weakSelf.pageName); - NSMutableDictionary *allUserInfo = [[NSMutableDictionary alloc] initWithDictionary:error.userInfo]; [allUserInfo addEntriesFromDictionary:loadError.userInfo]; NSError *errorWithReportMsg = [NSError errorWithDomain:error.domain @@ -766,6 +775,8 @@ typedef enum : NSUInteger { - (void)destroyInstance { +WXLogInfo(@"Destroy instance: %@", _instanceId); + [self.apmInstance endRecord]; NSString *url = @""; if ([WXPrerenderManager isTaskExist:[self.scriptURL absoluteString]]) { @@ -810,6 +821,7 @@ typedef enum : NSUInteger { // Reading config from orange for Release instance in Main Thread or not, for Bug
[incubator-weex] branch optimize-tlog created (now 3adeb8a)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch optimize-tlog in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 3adeb8a Optimize iOS logs. This branch includes the following new commits: new 3adeb8a Optimize iOS logs. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch master updated (6daad9e -> 3d7ea0a)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 6daad9e [Android] Change default value to from NAN to 0 (#2883) add d951f97 Fix bug that when view is not loaded or not attached to a window, the CA animation completion callback is immediately called. new 3d7ea0a Merge pull request #2894 from apache/fix-animation-cpu The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 54 -- 1 file changed, 40 insertions(+), 14 deletions(-)
[incubator-weex] 01/01: Merge pull request #2894 from apache/fix-animation-cpu
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 3d7ea0a9f5decfd613c7ab6d57220164166e3c0c Merge: 6daad9e d951f97 Author: wqyfavor AuthorDate: Wed Sep 11 11:34:17 2019 +0800 Merge pull request #2894 from apache/fix-animation-cpu Fix bug that when view is not loaded or not attached to a window, the… ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 54 -- 1 file changed, 40 insertions(+), 14 deletions(-)
[incubator-weex] 01/01: Fix bug that when view is not loaded or not attached to a window, the CA animation completion callback is immediately called.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-animation-cpu in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit d951f9729d4b355049dda22c771e8abd19e49421 Author: qianyuan.wqy AuthorDate: Wed Sep 11 11:04:18 2019 +0800 Fix bug that when view is not loaded or not attached to a window, the CA animation completion callback is immediately called. --- ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 54 -- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index a1d78b3..8ee1591 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -355,6 +355,21 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) - (void)animation:(WXComponent *)targetComponent args:(NSDictionary *)args callback:(WXModuleKeepAliveCallback)callback { +/* Check if view of targetComponent is created, if not, we do not do animation and + simulate delay of 'duration' and callback. + For a view in list, the view migth be recycled, and if view is not attached to a window, + the CATransaction completion block will be called immediately, which may cause CPU overload + problem if JS code do any logic in the completion callback. + */ + +BOOL shouldDoAnimation = NO; +if ([targetComponent isViewLoaded]) { +UIView* view = targetComponent.view; +if ([view window] != nil) { +shouldDoAnimation = YES; +} +} + /** UIView-style animation functions support the standard timing functions, but they don’t allow you to specify your own cubic Bézier curve. @@ -362,21 +377,31 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) **/ [CATransaction begin]; [CATransaction setAnimationTimingFunction:[WXConvert CAMediaTimingFunction:args[@"timingFunction"]]]; -[CATransaction setCompletionBlock:^{ -if (callback) { -NSDictionary *message; -if (_isAnimationedSuccess) { -message = @{@"result":@"Success", -@"message":@"Success"}; -} -else -{ -message = @{@"result":@"Fail", -@"message":@"Animation did not complete"}; + +if (shouldDoAnimation) { +[CATransaction setCompletionBlock:^{ +if (callback) { +NSDictionary *message; +if (_isAnimationedSuccess) { +message = @{@"result":@"Success", +@"message":@"Success"}; +} +else +{ +message = @{@"result":@"Fail", +@"message":@"Animation did not complete"}; +} +callback(message, NO); } -callback(message,NO); -} -}]; +}]; +} +else if (callback) { +double duration = [[args objectForKey:@"duration"] doubleValue] / 1000.f; +dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ +callback(@{@"result":@"Success", + @"message":@"Success"}, NO); +}); +} BOOL needLayout = NO; WXTransition* transition = nil; @@ -387,6 +412,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) } [CATransaction commit]; + if (needLayout && transition) { WXPerformBlockOnComponentThread(^{ [transition _handleTransitionWithStyles:transitionDic resetStyles:nil target:targetComponent];
[incubator-weex] branch fix-animation-cpu created (now d951f97)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-animation-cpu in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at d951f97 Fix bug that when view is not loaded or not attached to a window, the CA animation completion callback is immediately called. This branch includes the following new commits: new d951f97 Fix bug that when view is not loaded or not attached to a window, the CA animation completion callback is immediately called. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] 01/01: Fix nullable annotation.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-nullable-annotation in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit ee8976f0ad46f1757e37bfa6fb164e3d6f71fbea Author: qianyuan.wqy AuthorDate: Wed Sep 4 12:20:52 2019 +0800 Fix nullable annotation. --- ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.h | 4 ++-- ios/sdk/WeexSDK/Sources/WeexSDK.h | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.h b/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.h index 31fa989..b4a263f 100644 --- a/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.h +++ b/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.h @@ -150,11 +150,11 @@ extern NSString* const VALUE_ERROR_CODE_DEFAULT; #pragma mark - called by IWXHttpAdapter implementer - (void) actionNetRequest; -- (void) actionNetRequestResult:(bool)succeed withErrorCode:(NSString*)errorCode; +- (void) actionNetRequestResult:(bool)succeed withErrorCode:(nullable NSString*)errorCode; #pragma mark - called by IWXImgLoaderAdapter implementer - (void) actionImgLoad; -- (void) actionImgLoadResult:(bool)succeed withErrorCode:(NSString*)errorCode; +- (void) actionImgLoadResult:(bool)succeed withErrorCode:(nullable NSString*)errorCode; #pragma mark record top5 errorMsg - (void) recordErrorMsg:(WXJSExceptionInfo *)exception; diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h index 2956ea4..8e5f6f4 100644 --- a/ios/sdk/WeexSDK/Sources/WeexSDK.h +++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h @@ -23,10 +23,10 @@ FOUNDATION_EXPORT double WeexSDKVersionNumber; FOUNDATION_EXPORT const unsigned char WeexSDKVersionString[]; -#import "style.h" -#import "layout.h" -#import "flex_enum.h" -#import "eagle_bridge.h" +#import +#import +#import +#import #import #import #import
[incubator-weex] branch fix-nullable-annotation created (now ee8976f)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-nullable-annotation in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at ee8976f Fix nullable annotation. This branch includes the following new commits: new ee8976f Fix nullable annotation. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch master updated: [iOS] modify eagle error code group from js to native
This is an automated email from the ASF dual-hosted git repository. moshen 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 d06b96e [iOS] modify eagle error code group from js to native new 2a3f3d0 Merge pull request #2876 from jianhan-he/master d06b96e is described below commit d06b96e3dfcb7ef1d5139f16e51a43822cf367c1 Author: linghe.lh AuthorDate: Tue Sep 3 15:26:59 2019 +0800 [iOS] modify eagle error code group from js to native --- ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m index 28302b9..07ccbe1 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m @@ -92,7 +92,7 @@ @(WX_KEY_EXCEPTION_DEGRADE):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NATIVE),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE)}, @(WX_KEY_EXCEPTION_DEGRADE_CHECK_CONTENT_LENGTH_FAILED):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NET),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_CHECK_CONTENT_LENGTH_FAILED)}, @(WX_KEY_EXCEPTION_DEGRADE_BUNDLE_CONTENTTYPE_ERROR):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NET), ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_BUNDLE_CONTENTTYPE_ERROR)}, - @(WX_KEY_EXCEPTION_DEGRADE_EAGLE_RENDER_ERROR):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_JS),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_EAGLE_RENDER_ERROR)}, + @(WX_KEY_EXCEPTION_DEGRADE_EAGLE_RENDER_ERROR):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NATIVE),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_EAGLE_RENDER_ERROR)}, @(WX_KEY_EXCEPTION_DEGRADE_OTHER_CAUSE):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NATIVE),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_OTHER_CAUSE)}, @(WX_KEY_EXCEPTION_DEGRADE_NET_CODE_CAUSE):@{ERROR_TYPE:@(WX_DEGRADE_ERROR),ERROR_GROUP:@(WX_NET),ERROR_ALIAS:@(WX_UNI_KEY_EXCEPTION_DEGRADE_NET_CODE_CAUSE)},
[incubator-weex] 01/01: Merge pull request #2873 from apache/fix-animation-crash2
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 8169a10607a3e99bcb91e54318c88a535d5161e3 Merge: e50844f 8ce1318 Author: wqyfavor AuthorDate: Mon Sep 2 11:24:52 2019 +0800 Merge pull request #2873 from apache/fix-animation-crash2 Fix potential crash of animation. ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 7 +-- ios/sdk/WeexSDK/Sources/Module/WXTransition.mm| 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-)
[incubator-weex] branch master updated (e50844f -> 8169a10)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from e50844f [Android]move wrap.sh to android/sdk (#2868) add 8ce1318 Fix potential crash of animation. new 8169a10 Merge pull request #2873 from apache/fix-animation-crash2 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 7 +-- ios/sdk/WeexSDK/Sources/Module/WXTransition.mm| 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-)
[incubator-weex] 01/01: Fix potential crash of animation.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch fix-animation-crash2 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 8ce131838c7f54d029c398537e410bfb3e3e551f Author: qianyuan.wqy AuthorDate: Mon Sep 2 11:09:15 2019 +0800 Fix potential crash of animation. --- ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 7 +-- ios/sdk/WeexSDK/Sources/Module/WXTransition.mm| 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm index cd1aa31..f4b29a8 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm @@ -694,8 +694,9 @@ static NSThread *WXComponentThread; [component _updateStylesOnMainThread:normalStyles resetStyles:resetStyles]; [component readyToRender]; +NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:normalStyles]; WXPerformBlockOnComponentThread(^{ -[component _updateStylesOnComponentThread:normalStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles]; +[component _updateStylesOnComponentThread:dupStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles]; }); } @@ -711,8 +712,10 @@ static NSThread *WXComponentThread; NSMutableArray *resetStyles = [NSMutableArray new]; [self filterStyles:styles normalStyles:normalStyles resetStyles:resetStyles]; [component _updateStylesOnComponentThread:normalStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles]; + +NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:normalStyles]; [self _addUITask:^{ -[component _updateStylesOnMainThread:normalStyles resetStyles:resetStyles]; +[component _updateStylesOnMainThread:dupStyles resetStyles:resetStyles]; [component readyToRender]; }]; } diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm b/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm index 15a9e11..8bb616d 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm +++ b/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm @@ -170,8 +170,9 @@ } [targetComponent _updateCSSNodeStyles:styles]; [targetComponent _resetCSSNodeStyles:resetStyles]; +NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:styles]; WXPerformBlockOnMainThread(^{ -[targetComponent _updateViewStyles:styles]; +[targetComponent _updateViewStyles:dupStyles]; }); }
[incubator-weex] branch fix-animation-crash2 created (now 8ce1318)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch fix-animation-crash2 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at 8ce1318 Fix potential crash of animation. This branch includes the following new commits: new 8ce1318 Fix potential crash of animation. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex] branch master updated: [iOS]fix crash when call getlayouttime
This is an automated email from the ASF dual-hosted git repository. moshen 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 c24fd94 [iOS]fix crash when call getlayouttime new e4740f5 Merge pull request #2858 from jianhan-he/master c24fd94 is described below commit c24fd9466bacc425826192c17a0188cafffeaf1f Author: linghe.lh AuthorDate: Thu Aug 29 14:34:54 2019 +0800 [iOS]fix crash when call getlayouttime --- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m index 36a80f9..4a11f4a 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m @@ -132,7 +132,14 @@ [targetComponent.weexInstance.apmInstance updateMaxStats:KEY_PAGE_STATS_EXECUTE_JS_TIME curMaxValue:self.callJsTime]; [targetComponent.weexInstance.apmInstance updateMaxStats:KEY_PAGE_STATS_CREATE_COMPONENT_TIME curMaxValue:self.componentCreateTime]; [targetComponent.weexInstance.apmInstance updateMaxStats:KEY_PAGE_STATS_CREATE_VIEW_TIME curMaxValue:self.viewCreateTime]; -[targetComponent.weexInstance.apmInstance updateMaxStats:KEY_PAGE_STATS_LAYOUT_TIME curMaxValue:[WXCoreBridge getLayoutTime:targetComponent.weexInstance.instanceId]]; +__weak WXComponent* weakComponent = targetComponent; +WXPerformBlockOnComponentThread(^{ + __strong WXComponent* strongComponent = weakComponent; +if (!strongComponent) { +return; +} +[strongComponent.weexInstance.apmInstance updateMaxStats:KEY_PAGE_STATS_LAYOUT_TIME curMaxValue:[WXCoreBridge getLayoutTime:strongComponent.weexInstance.instanceId]]; +}); self.interactionTime = self.interactionTime < diff ? diff :self.interactionTime; }
[incubator-weex] branch master updated (a5698e3 -> 6d1cb9b)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from a5698e3 Merge pull request #2857 from jianhan-he/master new 3c3dd9e 初步optional适配 new 42a7d6f Public Header 添加WXStreamModule.h, 构建成功 new 4912fd1 修改WeexSDKTests,测试通过 new 648e0f5 optional调整 new 6a45fd5 删除test中调用未公开方法 new 3b4cd0a Merge branch 'master' into txink-swift-adapter new 01eea15 Merge branch 'txink-swift-adapter' of https://github.com/Txink/incubator-weex into txink-swift-adapter new 9e5fc1f C++文件改为" " 导入方式 new 6d1cb9b Merge pull request #2849 from Txink/txink-swift-adapter The 11735 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 32 +++-- .../xcshareddata/xcschemes/WeexSDKTests.xcscheme | 29 ++--- ios/sdk/WeexSDK/Sources/Bridge/JSContext+Weex.h| 6 +- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.h| 6 +- .../Component/Recycler/WXRecyclerComponent.h | 6 +- ios/sdk/WeexSDK/Sources/Component/WXAComponent.h | 6 +- .../Sources/Component/WXIndicatorComponent.h | 6 +- .../WeexSDK/Sources/Component/WXListComponent.h| 6 +- .../WeexSDK/Sources/Component/WXRefreshComponent.h | 6 +- ios/sdk/WeexSDK/Sources/Component/WXRichText.h | 6 +- .../Sources/Component/WXScrollerComponent.h| 9 +- .../Sources/Controller/WXBaseViewController.h | 4 + .../Sources/Controller/WXRootViewController.h | 4 + ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h| 8 +- .../WeexSDK/Sources/Eagle/WXDataRenderHandler.h| 12 +- ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h | 14 ++- ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h| 5 +- .../Sources/Handler/WXNavigationDefaultImpl.h | 6 +- .../WeexSDK/Sources/Layout/WXComponent+Layout.h| 6 +- ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.h | 7 +- ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h | 38 +++--- .../WeexSDK/Sources/Manager/WXComponentFactory.h | 12 +- .../WeexSDK/Sources/Manager/WXComponentManager.h | 4 + ios/sdk/WeexSDK/Sources/Manager/WXHandlerFactory.h | 4 + .../WeexSDK/Sources/Manager/WXInvocationConfig.h | 5 +- ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h | 8 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.h| 5 +- ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.h | 8 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 32 ++--- ios/sdk/WeexSDK/Sources/Module/WXInstanceWrap.h| 2 +- ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.h | 6 +- .../WeexSDK/Sources/Module/WXPrerenderManager.h| 10 +- ios/sdk/WeexSDK/Sources/Module/WXStreamModule.h| 8 +- ios/sdk/WeexSDK/Sources/Module/WXTimerModule.h | 2 +- ios/sdk/WeexSDK/Sources/Module/WXVoiceOverModule.h | 6 +- ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.h | 6 +- ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.h | 7 +- ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h| 22 ++-- .../WeexSDK/Sources/Network/WXResourceRequest.h| 6 +- .../Sources/Network/WXResourceRequestHandler.h | 14 ++- .../WeexSDK/Sources/Network/WXResourceResponse.h | 4 + .../WeexSDK/Sources/Performance/WXApmForInstance.h | 6 +- .../WeexSDK/Sources/Protocol/WXAnalyzerProtocol.h | 6 +- ios/sdk/WeexSDK/Sources/Protocol/WXApmProtocol.h | 3 + .../Sources/Protocol/WXAppMonitorProtocol.h| 8 +- .../WeexSDK/Sources/Protocol/WXBridgeProtocol.h| 10 +- .../Sources/Protocol/WXConfigCenterProtocol.h | 8 +- .../Sources/Protocol/WXEventModuleProtocol.h | 6 +- .../Sources/Protocol/WXExtendCallNativeProtocol.h | 4 + .../WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h | 18 +-- .../Sources/Protocol/WXJSExceptionProtocol.h | 6 +- .../Sources/Protocol/WXJSFrameworkLoadProtocol.h | 4 + .../WeexSDK/Sources/Protocol/WXModuleProtocol.h| 12 +- .../Sources/Protocol/WXNavigationProtocol.h| 22 ++-- .../WeexSDK/Sources/Protocol/WXNetworkProtocol.h | 14 ++- .../Sources/Protocol/WXPageEventNotifyEvent.h | 6 +- .../WeexSDK/Sources/Protocol/WXScrollerProtocol.h | 5 +- .../Sources/Protocol/WXURLRewriteProtocol.h| 6 +- .../WeexSDK/Sources/Protocol/WXValidateProtocol.h | 13 +- .../WeexSDK/Sources/Utility/NSObject+WXSwizzle.h | 4 + .../WeexSDK/Sources/Utility/WXAppConfiguration.h | 4 + ios/sdk/WeexSDK/Sources/Utility/WXConvert.h| 8 +- ios/sdk/WeexSDK/Sources/Utility/WXConvertUtility.h | 1 + ios/sdk/WeexSDK/Sources/Utility/WXLog.h| 4 + ios/sdk/WeexSDK/Sources/Utility/WXType.h
[incubator-weex] branch master updated: [iOS] add a callback on wxsdkinstance
This is an automated email from the ASF dual-hosted git repository. moshen 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 dd6a39b [iOS] add a callback on wxsdkinstance new a5698e3 Merge pull request #2857 from jianhan-he/master dd6a39b is described below commit dd6a39bd3259eeab11ad47c203690d35efc60f28 Author: linghe.lh AuthorDate: Wed Aug 28 20:08:02 2019 +0800 [iOS] add a callback on wxsdkinstance --- ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm | 6 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h| 13 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm index ee20118..4d3f4c9 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm @@ -226,7 +226,11 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) //may be list if ([@"scroller" isEqualToString:type]) { [weexInstance.apmInstance updateDiffStats:KEY_PAGE_STATS_SCROLLER_NUM withDiffValue:1]; -} +} + +if (weexInstance.instanceCallback) { +weexInstance.instanceCallback(weexInstance, WXScrollerComponentCreatedCallback, self); +} } return self; diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h index c28a2d6..dcd4ea5 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h @@ -151,6 +151,10 @@ typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code FrameworkVersionErrorCode, }; +typedef enum : NSUInteger { +WXScrollerComponentCreatedCallback +} WXSDKInstanceCallbackType; + @property (nonatomic, assign) WXState state; @@ -226,6 +230,15 @@ typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code @property (nonatomic, copy) void (^onScroll)(CGPoint contentOffset); /** + * The callback of the instance + * + * When the callbackType is WXScrollerComponentCreatedCallback, the result type is WXScrollerComponent. + * + * @return A block that takes instance, callbackType and a result. + **/ +@property (nonatomic, copy) void (^instanceCallback)(WXSDKInstance* instance, WXSDKInstanceCallbackType callbackType, id result); + +/** * the callback to be run repeatedly while the instance is rendering. * * @return A block that takes a CGRect argument, which is the rect rendered
[incubator-weex] branch master updated: [iOS] fix the offset error of textarea
This is an automated email from the ASF dual-hosted git repository. moshen 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 a7d6d3a [iOS] fix the offset error of textarea new fc20444 Merge pull request #2835 from jianhan-he/master a7d6d3a is described below commit a7d6d3a0d9c104ce4457d48943a8c1c35c19be7c Author: linghe.lh AuthorDate: Mon Aug 19 11:33:43 2019 +0800 [iOS] fix the offset error of textarea --- ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm index 8015194..56c5ef3 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm @@ -714,7 +714,8 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) CGRect rootViewFrame = rootView.frame; CGRect inputFrame = [self.view.superview convertRect:self.view.frame toView:rootView]; if (movedUp) { -CGFloat offset = inputFrame.origin.y-(rootViewFrame.size.height-_keyboardSize.height-inputFrame.size.height) + _upriseOffset; +CGFloat inputOffset = inputFrame.size.height - (rootViewFrame.size.height - inputFrame.origin.y); +CGFloat offset = inputFrame.origin.y-(rootViewFrame.size.height-_keyboardSize.height- (inputOffset > 0 ? inputFrame.size.height - inputOffset : inputFrame.size.height)) + _upriseOffset; if (offset > 0) { rect = (CGRect){ .origin.x = 0.f,
[incubator-weex] branch master updated: layout引擎Frame计算修改为向上取整
This is an automated email from the ASF dual-hosted git repository. moshen 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 4b69035 layout引擎Frame计算修改为向上取整 new 4274a32 Merge pull request #2813 from Txink/text-show 4b69035 is described below commit 4b69035332d2f15fb1fe2b00cfbf57cdaede7fe5 Author: Txink <1256065...@qq.com> AuthorDate: Mon Aug 12 14:44:56 2019 +0800 layout引擎Frame计算修改为向上取整 --- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm index 9c95482..3ee9744 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm @@ -646,10 +646,10 @@ break; \ if (!manager.isValid) { return -1; } -CGRect frame = CGRectMake(isnan(WXRoundPixelValue(left))?0:WXRoundPixelValue(left), - isnan(WXRoundPixelValue(top))?0:WXRoundPixelValue(top), - isnan(WXRoundPixelValue(width))?0:WXRoundPixelValue(width), - isnan(WXRoundPixelValue(height))?0:WXRoundPixelValue(height)); +CGRect frame = CGRectMake(isnan(WXCeilPixelValue(left))?0:WXCeilPixelValue(left), + isnan(WXCeilPixelValue(top))?0:WXCeilPixelValue(top), + isnan(WXCeilPixelValue(width))?0:WXCeilPixelValue(width), + isnan(WXCeilPixelValue(height))?0:WXCeilPixelValue(height)); [manager layoutComponent:component frame:frame isRTL:isRTL innerMainSize:renderObject->getLargestMainSize()]; page->CallBridgeTime(getCurrentTime() - startTime); @@ -1551,10 +1551,10 @@ static WeexCore::ScriptBridge* jsBridge = nullptr; float width = render->getLayoutWidth(); BOOL isRTL = render->getLayoutDirectionFromPathNode() == WeexCore::kDirectionRTL; WXComponentManager* manager = [WXSDKManager instanceForID:ns_instanceId].componentManager; -CGRect frame = CGRectMake(isnan(WXRoundPixelValue(left))?0:WXRoundPixelValue(left), - isnan(WXRoundPixelValue(top))?0:WXRoundPixelValue(top), - isnan(WXRoundPixelValue(width))?0:WXRoundPixelValue(width), - isnan(WXRoundPixelValue(height))?0:WXRoundPixelValue(height)); +CGRect frame = CGRectMake(isnan(WXCeilPixelValue(left))?0:WXCeilPixelValue(left), + isnan(WXCeilPixelValue(top))?0:WXCeilPixelValue(top), + isnan(WXCeilPixelValue(width))?0:WXCeilPixelValue(width), + isnan(WXCeilPixelValue(height))?0:WXCeilPixelValue(height)); [manager layoutComponent:component frame:frame isRTL:isRTL innerMainSize:render->getLargestMainSize()]; } render->setHasNewLayout(false);
[incubator-weex] branch master updated (a994ce9 -> 5df2e4e)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from a994ce9 [Android] record ipc exception history and weexCoreThread stackTrace when white screen or js process died/reload (#2826) new 86bc455 [iOS] output render timeline on iOS new 36f47c9 Merge branch 'master' into master new 5df2e4e Merge pull request #2822 from jianhan-he/master The 11710 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 12 +-- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 11 +-- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h | 2 + ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 8 ++ .../WeexSDK/Sources/Manager/WXComponentManager.mm | 4 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 5 +- .../Sources/Model/WXSDKInstance_performance.m | 4 +- ...{WXConsoleLogModule.m => WXConsoleLogModule.mm} | 6 ++ .../WeexSDK/Sources/Performance/WXApmForInstance.h | 5 ++ .../WeexSDK/Sources/Performance/WXApmForInstance.m | 97 ++ .../core/bridge/platform/core_side_in_platform.cpp | 8 ++ .../core/bridge/platform/core_side_in_platform.h | 1 + weex_core/Source/core/bridge/platform_bridge.h | 2 + .../core/network/ios/default_request_handler.mm| 8 ++ 14 files changed, 156 insertions(+), 17 deletions(-) rename ios/sdk/WeexSDK/Sources/Module/{WXConsoleLogModule.m => WXConsoleLogModule.mm} (88%)
[incubator-weex] branch master updated (007539e -> 862a64c)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 007539e Merge pull request #2809 from apache/protect-argument-convert new 7cda54c View支持userInteraction属性 new 71268b5 修改属性为BOOL new b8ac8fa setUserInteractionEnabled new 5f586c3 添加eventPenetrationEnabled属性,属性为true时,当响应者为自身时将事件穿透传递(子视图正常响应) new 11afad8 Avoid wx_component nil new 791118f Merge branch 'master' into view-userInteractionEnabled new 862a64c Merge pull request #2803 from Txink/view-userInteractionEnabled The 11704 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../Sources/Component/WXComponent_internal.h | 2 ++ ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 22 +- ios/sdk/WeexSDK/Sources/View/WXView.m | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-)
[incubator-weex] branch master updated (23c3acf -> 007539e)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 23c3acf Merge pull request #2797 from wrmswindmill/fix-oclint-warning2 add c09b54b [iOS] Protect nil argument for convertContainerToImmutable. new 007539e Merge pull request #2809 from apache/protect-argument-convert The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 6 ++ 1 file changed, 6 insertions(+)
[incubator-weex] 01/01: Merge pull request #2809 from apache/protect-argument-convert
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit 007539e61768f838065123a48a34a59229f39f9e Merge: 23c3acf c09b54b Author: wqyfavor AuthorDate: Mon Aug 12 10:51:41 2019 +0800 Merge pull request #2809 from apache/protect-argument-convert [iOS] Protect nil argument for convertContainerToImmutable. ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 6 ++ 1 file changed, 6 insertions(+)
[incubator-weex] 01/01: [iOS] Protect nil argument for convertContainerToImmutable.
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch protect-argument-convert in repository https://gitbox.apache.org/repos/asf/incubator-weex.git commit c09b54b818e5ca60aa58bcfc202f107e116047ff Author: qianyuan.wqy AuthorDate: Mon Aug 12 10:20:55 2019 +0800 [iOS] Protect nil argument for convertContainerToImmutable. --- ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m index 73c1108..6ec4223 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m @@ -268,6 +268,12 @@ CGFloat WXFloorPixelValue(CGFloat value) if ([source isKindOfClass:[NSArray class]]) { NSMutableArray* tmpArray = [[NSMutableArray alloc] init]; for (id obj in source) { +if (obj == nil) { +/* srouce may be a subclass of NSArray and the subclassed + array may return nil in its overridden objectAtIndex: method. + So obj could be nil!!!. */ +continue; +} [tmpArray addObject:[self convertContainerToImmutable:obj]]; } id immutableArray = [NSArray arrayWithArray:tmpArray];
[incubator-weex] branch protect-argument-convert created (now c09b54b)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch protect-argument-convert in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. at c09b54b [iOS] Protect nil argument for convertContainerToImmutable. This branch includes the following new commits: new c09b54b [iOS] Protect nil argument for convertContainerToImmutable. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-weex-site] branch master updated: update docs about 'wx'
This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex-site.git The following commit(s) were added to refs/heads/master by this push: new b896322 update docs about 'wx' new 9219c4b Merge pull request #464 from katherine95s/update-about-wx b896322 is described below commit b896322c0173bfd83608b323b9ab3d635e39786c Author: Katherine Jiang AuthorDate: Fri Aug 2 17:42:37 2019 +0800 update docs about 'wx' --- docs/docs/styles/common-styles.md| 2 +- docs/docs/styles/css-units.md| 6 +++--- docs/zh/docs/styles/common-styles.md | 2 +- docs/zh/docs/styles/css-units.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/styles/common-styles.md b/docs/docs/styles/common-styles.md index 9af0607..3d38b2e 100644 --- a/docs/docs/styles/common-styles.md +++ b/docs/docs/styles/common-styles.md @@ -7,7 +7,7 @@ The supported styles is listed below, and some component may support custom styl ::: ::: warning -Weex only supports `px` as length unit, `%`, `rem`, `em` are not supported. +Weex supports `px`and `wx`(not affected by screen width and viewPortWidth) as length unit, `%`, `rem`, `em` are not supported. ::: ## Box Model diff --git a/docs/docs/styles/css-units.md b/docs/docs/styles/css-units.md index 3b37b34..69f4755 100644 --- a/docs/docs/styles/css-units.md +++ b/docs/docs/styles/css-units.md @@ -2,10 +2,10 @@ ## CSS `length` unit -`px` is the only supported length units. +`px` 、`wx` are supported as length units. For styles that should not be affected by screen width and viewPortWidth, please use `wx` as unit. ::: danger -Ignoring `px` will cause render error on Webview. +Ignoring `px` or `wx` will cause render error on Webview. ::: ::: warning @@ -217,4 +217,4 @@ The supported color format is listed below: | white | #FF | | whitesmoke | #F5F5F5 | | yellow | #00 | -| yellowgreen | #9ACD32 | \ No newline at end of file +| yellowgreen | #9ACD32 | diff --git a/docs/zh/docs/styles/common-styles.md b/docs/zh/docs/styles/common-styles.md index 36b8221..669189e 100644 --- a/docs/zh/docs/styles/common-styles.md +++ b/docs/zh/docs/styles/common-styles.md @@ -7,7 +7,7 @@ Weex所支持的通用样式已在本文档中全部列出,一些组件可能 ::: ::: warning -Weex 对于长度值目前只支持像素值,不支持相对单位(`em`、`rem`)。 +Weex 对于长度值目前只支持`px`和`wx`(不受屏幕宽度和viewPortWidth影响),不支持相对单位(`em`、`rem`)。 ::: ## 盒模型 diff --git a/docs/zh/docs/styles/css-units.md b/docs/zh/docs/styles/css-units.md index 5754bef..4b7a278 100644 --- a/docs/zh/docs/styles/css-units.md +++ b/docs/zh/docs/styles/css-units.md @@ -2,11 +2,11 @@ ## CSS 长度单位 -在 Weex 中,我们**只支持 `px` 长度单位**。 +在 Weex 中,我们**支持 `px`和`wx` 长度单位**。对于不希望受屏幕宽度和 viewPortWidth 影响的尺寸,请使用 `wx` 单位。 ::: warning 注意 - Weex 不支持类似 `em`、`rem`、`pt`,`%` 这样的 CSS 标准中的其他长度单位; -- 单位 `px` 不可省略,否则在 H5 环境无法正确渲染; +- 单位 `px`或`wx` 不可省略,否则在 H5 环境无法正确渲染; ::: ## CSS 数值单位 @@ -217,4 +217,4 @@ Weex 支持多种颜色单位: | white | #FF | | whitesmoke | #F5F5F5 | | yellow | #00 | -| yellowgreen | #9ACD32 | \ No newline at end of file +| yellowgreen | #9ACD32 |
[incubator-weex] branch master updated (1855247 -> 23c3acf)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 1855247 [Android] fix list op bug in Multithreading (#2798) new b21ef7e update changes for code review new 7e01655 reset Gemfile.lock new da83464 remove codeFormat task in Travis CI new 0cd3e4c update .travis.yml and reset playground new ceef453 use lastest weex-playground new b02199e fix remaining oclint warning new 7317800 fix remaining oclint warning new 6f9c3f0 fix travis ci new 23c3acf Merge pull request #2797 from wrmswindmill/fix-oclint-warning2 The 11695 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml| 4 ++-- Dangerfile | 1 - dangerfile-output.js | 2 +- ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm | 6 +++--- .../WeexSDK/Sources/Component/WXTextComponent.mm | 22 +++--- ios/sdk/WeexSDK/Sources/Component/WXTransform.m| 2 +- .../WeexSDK/Sources/Display/UIBezierPath+Weex.m| 4 ++-- ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 2 +- ios/sdk/WeexSDK/Sources/Utility/WXUtility.m| 4 ++-- .../Source/core/render/manager/render_manager.cpp | 2 +- weex_core/Source/third_party/json11/json11.cc | 4 ++-- weex_core/Source/wson/wson_parser.cpp | 2 +- 12 files changed, 27 insertions(+), 28 deletions(-)
[incubator-weex] branch master updated (3bfb619 -> a8dbedf)
This is an automated email from the ASF dual-hosted git repository. moshen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git. from 3bfb619 [Travis] Add Lint in TravisCI and Update iOS TravisCI (#2731) new bfc7a40 merge new 7a5f6b0 update .travis.yml for oclint new 006c765 .travis.yml new 6dbff5c .travis.yml new 310c32e update new 59ac991 update new 8a36f04 update new 160b8aa update android and ios new e8321bc update android and ios new c0e261f test new 78ffbd5 test new 86de4c3 test -2 new c678b2c test-3 new 76f0e2f test-4 new d4d3efd test-5 new b7d474e Delete 1.sh new a4777c4 upload ios/sdk/.gitignore new bbf9446 update .travis.yml for oclint new d6d127f update .travis.yml for oclint new 7e93ae3 merge new 034d38c Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex new ed2e713 Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex new 6cefc8d Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex new 175b747 .travis.yml new 2a2e998 .travis.yml new 1c99e59 update new 5aa966d update new da83adf update new c2ff7d0 update android and ios new fce5c37 update android and ios new d226c55 test new 70382ff test new c19263c test -2 new 45632bf test-3 new 3825f00 test-4 new cb0687b test-5 new 7804e01 upload ios/sdk/.gitignore new 798e867 test-5 new 345a85e Delete 1.sh new 629b759 Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex new 0adc403 delete new 1467029 Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex new ca1573b test android code format new dc625cf add new line in android/sdk/src/main/java/com/taobao/weex/adapter/ClassLoaderAdapter.java new 82c5bb6 add new line in android/sdk/src/main/java/com/taobao/weex/adapter/ClassLoaderAdapter.java new eed9cc4 add new line in android/sdk/src/main/java/com/taobao/weex/adapter/ClassLoaderAdapter.java new 0cbc129 add new line in android/sdk/src/main/java/com/taobao/weex/adapter/ClassLoaderAdapter.java new 45dbeaf add new line in android/sdk/src/main/java/com/taobao/weex/adapter/ClassLoaderAdapter.java new b6711dc test new dbcaa92 Update .travis.yml new df518ad Merge branch 'lint' of https://github.com/wrmswindmill/incubator-weex into lint new d54f801 test new 18a9573 test new d439e99 test new 9907c91 test new d0407b9 test for dangerfile ruby new a52a635 test for dangerfile ruby new b189e3d test for dangerfile ruby new 2d96450 test for dangerfile ruby new b6cb33b test for dangerfile ruby new 4b30d74 test for dangerfile ruby new 950a8cb add asan new cedf4fb add asan new 69a406b test code format and asan new 7b8def1 test code format and asan new 931cbc0 test code format and asan new 2aff44d test code format and asan2 new 193124d adjust job order new acc85c1 update .travis.yml new 7cba71b test new 615f84d test ios travis new b58efdc Merge pull request #11 from wrmswindmill/lint new 9bb8a10 update new 266bcb6 update2 new ce77b0c update3 new 5b49f35 update3 new d943110 update3 new e199c3f update3 new 98f6545 Merge pull request #12 from wrmswindmill/lint2 new 97ae515 ios uitest fail and exit new ce436aa Update .travis.yml new ddd48f7 Merge remote-tracking branch 'upstream/master' new efc4614 merge new b66e8b8 Update .travis.yml new d691708 Update ClassLoaderAdapter.java new 3531b25 Update ClassLoaderAdapter.java new 8ef0ecc update ClassLoaderAdapter.java new f79edc1 update ClassLoaderAdapter.java new fef51dd Update ClassLoaderAdapter.java new 830bb6f Reset ClassLoaderAdapter.java new 11dd0e5 output oclint message new d25582d update danger from 0.8 to 9.0 And --danger-id new 98dc055 test android lint new bc05793 update new 1943636 remove -i new e91e1e0 update npm to yarn new 3083794 update npm from 7.6 to 8.0 new 935cb49 Merge branch 'master' into fix-danger new daed95c update danger run to danger ci new f3cf951 update new 1d9d5a0 update npm package new e563bbf update node to 12.6 new 51a05c0 reset yarn to npm run danger -- new 09bf60e reset package.json and package-lock.json new 748fa44 change to yarn because npm package error and install android lint plugin new 65647dd update to grep new 4c159fd add java file new 049f481 remove osx_image: xcode7.2 and add cd android new cba1a26 brew update n