incubator-weex git commit: [WEEX-420][iOS] Try to resolve multithread crash during delete layoutNode
Repository: incubator-weex Updated Branches: refs/heads/master e74c60cd3 -> 0cbbfba71 [WEEX-420][iOS] Try to resolve multithread crash during delete layoutNode close #1227 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0cbbfba7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0cbbfba7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0cbbfba7 Branch: refs/heads/master Commit: 0cbbfba71932fd465c95adecf052c2ddd9691827 Parents: e74c60c Author: zhongcang Authored: Wed May 30 20:58:44 2018 +0800 Committer: acton393 Committed: Thu May 31 16:39:13 2018 +0800 -- .../Sources/Component/WXScrollerComponent.mm | 4 +--- .../WeexSDK/Sources/Layout/WXComponent+Layout.h| 3 +++ .../WeexSDK/Sources/Layout/WXComponent+Layout.mm | 17 + ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h | 9 + ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 5 +++-- 5 files changed, 33 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0cbbfba7/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm index fcf554a..9b8a1a2 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm @@ -247,9 +247,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) [self.stickyArray removeAllObjects]; [self.listenerArray removeAllObjects]; if(_flexScrollerCSSNode){ -delete _flexScrollerCSSNode; - -//WeexCore::WXCoreLayoutNode::freeNodeTree(_flexScrollerCSSNode); +[WXComponent recycleNodeOnComponentThread:_flexScrollerCSSNode gabRef:self.ref]; _flexScrollerCSSNode=nullptr; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0cbbfba7/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h index ac8700e..2f77976 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h @@ -59,4 +59,7 @@ extern "C" { - (void)_insertChildCssNode:(WXComponent*)subcomponent atIndex:(NSInteger)index; - (void)_rmChildCssNode:(WXComponent*)subcomponent; - (NSInteger) getActualNodeIndex:(WXComponent*)subcomponent atIndex:(NSInteger) index; +#ifdef __cplusplus ++ (void) recycleNodeOnComponentThread:(WeexCore::WXCoreLayoutNode * ) garbageNode gabRef:(NSString *)ref; +#endif @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0cbbfba7/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm index d1aa7d0..ecca959 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm @@ -637,5 +637,22 @@ static WeexCore::WXCoreSize flexCssNodeMeasure(WeexCore::WXCoreLayoutNode *node, } ++ (void) recycleNodeOnComponentThread:(WeexCore::WXCoreLayoutNode * ) garbageNode gabRef:(NSString *)ref { +if (nullptr == garbageNode) { +#ifdef DEBUG +WXLogDebug(@"flexlayout->recycle garbageNode ref:%@ is null ",ref); +#endif +return; +} +WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexlayout->recycle ref:%@ ,node:%p",ref,garbageNode ); +#endif +if(nullptr != garbageNode){ +delete garbageNode; +} +}); +//domthread +} @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0cbbfba7/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h index b7c299e..216c099 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h +++ b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h @@ -157,7 +157,16 @@ namespace WeexCore { mHasNewLayout = true; dirty = true; measureFunc = nullptr; +if(nullptr != mParent){ +mParent->removeChild(this); +} mParent = nullptr; +for(WXCoreLayoutNode* childNode : mChildList){ +if(nullptr != childNode){ +
incubator-weex git commit: [Weex-398][iOS]Try to fix insert table view cell exception abort on iOS
Repository: incubator-weex Updated Branches: refs/heads/master a820eeb2f -> 162d70588 [Weex-398][iOS]Try to fix insert table view cell exception abort on iOS close #1201 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/162d7058 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/162d7058 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/162d7058 Branch: refs/heads/master Commit: 162d705883a4486318f308605fa094b7dec2a94a Parents: a820eeb Author: Xiaomin <caixiao...@yahoo.com> Authored: Wed May 23 18:40:33 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 24 12:13:01 2018 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/162d7058/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm index 854aa3a..e5a6123 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm @@ -923,6 +923,11 @@ - (void)_insertTableViewCellAtIndexPath:(NSIndexPath *)indexPath keepScrollPosition:(BOOL)keepScrollPosition animation:(UITableViewRowAnimation)animation { +NSInteger numberOfRows = ((WXSectionComponent *)[_sections wx_safeObjectAtIndex:indexPath.section]).rows.count; +if (indexPath.row > numberOfRows || indexPath.row < 0) { +WXLogError(@"inserting cell at row %ld out of range in section:%ld", indexPath.row, indexPath.section); +return; +} [self _performUpdates:^{ if ([_updataType isEqual: @"reload"]) { [_tableView reloadData];
incubator-weex git commit: [WEEX-400][iOS] add more note about access JSContext
Repository: incubator-weex Updated Branches: refs/heads/master 3f11db871 -> a820eeb2f [WEEX-400][iOS] add more note about access JSContext Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/a820eeb2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a820eeb2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a820eeb2 Branch: refs/heads/master Commit: a820eeb2fe21bba19ed9d00527640da3441628da Parents: 3f11db8 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 24 11:53:52 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 24 11:53:52 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 1 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 1 + 2 files changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a820eeb2/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h index b4e7cfc..cc91d75 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h @@ -148,6 +148,7 @@ typedef NS_ENUM(NSInteger, WXErrorCode) {//error.code /** * * @return instance runtime JavaScript. + * you must call it in brige thread. Learn more at WXPerformBlockOnBridgeThread **/ - (id)instanceJavaScriptContext; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a820eeb2/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index ad53d3a..952b446 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -143,6 +143,7 @@ typedef enum : NSUInteger { return _instanceJavaScriptContext; } +WXAssertBridgeThread(); if (_instanceJavaScriptContext) { _instanceJavaScriptContext = nil; }
incubator-weex git commit: [WEEX-400][iOS] try to resolve multi thread acessing jscontext
Repository: incubator-weex Updated Branches: refs/heads/master 641e3826e -> 3f11db871 [WEEX-400][iOS] try to resolve multi thread acessing jscontext Bug:400 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3f11db87 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3f11db87 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3f11db87 Branch: refs/heads/master Commit: 3f11db8718a3e5b850994c7c30c4a0c47f43a589 Parents: 641e382 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 24 11:41:02 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 24 11:41:02 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f11db87/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 3e4f972..ad53d3a 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -500,7 +500,6 @@ typedef enum : NSUInteger { } [[WXSDKManager bridgeMgr] destroyInstance:self.instanceId]; -_instanceJavaScriptContext = nil; if (_componentManager) { [_componentManager invalidate];
incubator-weex git commit: [WEEX-382] [iOS] rm useless log
Repository: incubator-weex Updated Branches: refs/heads/master 8ad1de43e -> 7102479d9 [WEEX-382] [iOS] rm useless log close #1189 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7102479d Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7102479d Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7102479d Branch: refs/heads/master Commit: 7102479d9409e4e6a4671d9c3fe8b7cf860ce42b Parents: 8ad1de4 Author: zhongcang <qh438406...@gmail.com> Authored: Mon May 21 17:48:54 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Mon May 21 17:55:44 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7102479d/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm index 0556ca5..e2ad487 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm @@ -663,7 +663,6 @@ #pragma mark Updating - (void)_updateStylesOnComponentThread:(NSDictionary *)styles resetStyles:(NSMutableArray *)resetStyles isUpdateStyles:(BOOL)isUpdateStyles { -NSLog(@"tempTest updating"); BOOL isTransitionTag = _transition ? [self _isTransitionTag:styles] : NO; if (isTransitionTag) {
incubator-weex git commit: [WEEX-375][iOS] bugfix about page event call in destroyinstance
Repository: incubator-weex Updated Branches: refs/heads/master 8ac198a22 -> 2539b94ff [WEEX-375][iOS] bugfix about page event call in destroyinstance Bug:375 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/2539b94f Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/2539b94f Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/2539b94f Branch: refs/heads/master Commit: 2539b94ff88becf1c82f613ad6cc55538556e84a Parents: 8ac198a Author: acton393 <zhangxing610...@gmail.com> Authored: Fri May 18 10:27:53 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri May 18 10:27:53 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2539b94f/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 88a63f9..3e4f972 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -267,7 +267,7 @@ typedef enum : NSUInteger { } id pageEvent = [WXSDKEngine handlerForProtocol:@protocol(WXPageEventNotifyEventProtocol)]; -if ([pageEvent respondsToSelector:@selector(pageDestroy:)]) { +if ([pageEvent respondsToSelector:@selector(pageStart:)]) { [pageEvent pageStart:self.instanceId]; } @@ -482,7 +482,11 @@ typedef enum : NSUInteger { WXLogError(@"Fail to find instanceï¼"); return; } - + +id pageEvent = [WXSDKEngine handlerForProtocol:@protocol(WXPageEventNotifyEventProtocol)]; +if ([pageEvent respondsToSelector:@selector(pageDestroy:)]) { +[pageEvent pageDestroy:self.instanceId]; +} [[NSNotificationCenter defaultCenter] postNotificationName:WX_INSTANCE_WILL_DESTROY_NOTIFICATION object:nil userInfo:@{@"instanceId":self.instanceId}]; [WXTracingManager destroyTraincgTaskWithInstance:self.instanceId];
[3/4] incubator-weex git commit: [WEEX-377][jsfm] Upgrade js framework to v0.26.5 close #1185
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8ac198a2/pre-build/weex-main-jsfm.js -- diff --git a/pre-build/weex-main-jsfm.js b/pre-build/weex-main-jsfm.js index 0517f35..78d3a32 100644 --- a/pre-build/weex-main-jsfm.js +++ b/pre-build/weex-main-jsfm.js @@ -1,2 +1,2 @@ -(this.nativeLog||function(e){console.log(e)})("START JS FRAMEWORK 0.26.3, Build 2018-04-27 10:31. (Vue: 2.5.13-weex.5, Rax: 0.4.20)");var global=this,process={env:{}},setTimeout=global.setTimeout;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&?define(t):t()}(0,function(){"use strict";var t,c,r,u;function e(e){return e&__esModule&(e,"default")?e.default:e}function n(e,t){return e(t={exports:{}},t.exports),t.exports}Array.from||(Array.from=(t=Object.prototype.toString,c=function(e){return"function"==typeof e||"[object Function]"===t.call(e)},r=Math.pow(2,53)-1,u=function(e){var t,n=(t=Number(e),isNaN(t)?0:0!==t&(t)?(0
[2/4] incubator-weex git commit: [WEEX-377][jsfm] Upgrade js framework to v0.26.5 close #1185
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8ac198a2/pre-build/weex-rax-api.js -- diff --git a/pre-build/weex-rax-api.js b/pre-build/weex-rax-api.js index e532556..7a0ceb5 100644 --- a/pre-build/weex-rax-api.js +++ b/pre-build/weex-rax-api.js @@ -1,2 +1,2 @@ -var global=this,process={env:{}};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&?define(t):t()}(0,function(){"use strict";var e,t,n=(function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var r=e.exports.createUniqueKey="undefined"!=typeof Symbol?Symbol:function(e){return"[["+e+"_"+Math.random().toFixed(8).slice(2)+"]]"},o=e.exports.isObject=function(e){return"object"==typeof e&!==e};e.exports.LISTENERS=r("listeners"),e.exports.CAPTURE=1,e.exports.BUBBLE=2,e.exports.ATTRIBUTE =3,e.exports.newNode=function(e,t,n){var r=o(n);return{listener:e,kind:t,once:r&(n.once),passive:r&(n.passive),next:null}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0){for(var n=Array(arguments.length),r=0;r
[1/4] incubator-weex git commit: [WEEX-377][jsfm] Upgrade js framework to v0.26.5 close #1185
Repository: incubator-weex Updated Branches: refs/heads/master ca21455e7 -> 8ac198a22 http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8ac198a2/pre-build/weex-rax-extra-api.js -- diff --git a/pre-build/weex-rax-extra-api.js b/pre-build/weex-rax-extra-api.js deleted file mode 100644 index 8b49e2e..000 --- a/pre-build/weex-rax-extra-api.js +++ /dev/null @@ -1,2 +0,0 @@ -(this.nativeLog||function(e){console.log(e)})("Prepare Rax Environment APIs (0.4.20), Build 2018-04-27 10:31.");var global=this,process={env:{}};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&?define(t):t()}(0,function(){"use strict";var e,t,n=(function(e){e.exports=function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var t=e&__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.w={},o(o.s=22)}([function(e,t,n){var r=e.exports.createUniqueKey="undefined"!=typeof Symbol?Symbol:function(e){return"[["+e+"_"+Math.random().to Fixed(8).slice(2)+"]]"},o=e.exports.isObject=function(e){return"object"==typeof e&!==e};e.exports.LISTENERS=r("listeners"),e.exports.CAPTURE=1,e.exports.BUBBLE=2,e.exports.ATTRIBUTE=3,e.exports.newNode=function(e,t,n){var r=o(n);return{listener:e,kind:t,once:r&(n.once),passive:r&(n.passive),next:null}}},function(e,t,n){var r=n(0),o=n(9),i=n(8),a=r.isObject,u=r.LISTENERS,s=r.CAPTURE,l=r.BUBBLE,c=r.ATTRIBUTE,f=r.newNode,d=o.defineCustomEventTarget,p=i.createEventWrapper,h=i.STOP_IMMEDIATE_PROPAGATION_FLAG,v=i.PASSIVE_LISTENER_FLAG,y="undefined"!=typeof window& 0!==window.EventTarget,m=e.exports=function e(){var t=arguments;if(!(this instanceof e)){if(1===arguments.length&(arguments[0]))return d(e,arguments[0]);if(0
[4/4] incubator-weex git commit: [WEEX-377][jsfm] Upgrade js framework to v0.26.5 close #1185
[WEEX-377][jsfm] Upgrade js framework to v0.26.5 close #1185 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8ac198a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8ac198a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8ac198a2 Branch: refs/heads/master Commit: 8ac198a220fa96a623cd6ee17b69caba8a23f654 Parents: ca21455 Author: Hanks <zhanghan...@gmail.com> Authored: Thu May 17 14:45:50 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 17 17:56:07 2018 +0800 -- pre-build/weex-main-jsfm.js | 2 +- pre-build/weex-rax-api.js | 2 +- pre-build/weex-rax-extra-api.js | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) --
incubator-weex git commit: [Weex-365][iOS] Try to resolve multithread crash during view unloading close #1177
Repository: incubator-weex Updated Branches: refs/heads/master 44adc5fea -> ca21455e7 [Weex-365][iOS] Try to resolve multithread crash during view unloading close #1177 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ca21455e Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ca21455e Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ca21455e Branch: refs/heads/master Commit: ca21455e71de61f5bcd9a2bf11afd516ced405a0 Parents: 44adc5f Author: maike(麦客) <maike@taobao.com> Authored: Tue May 15 19:41:45 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 17 17:24:30 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ca21455e/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index d2a66e2..88a63f9 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -79,6 +79,7 @@ typedef enum : NSUInteger { BOOL _debugJS; id _instanceJavaScriptContext; // sandbox javaScript context CGFloat _defaultPixelScaleFactor; +BOOL _bReleaseInstanceInMainThread; } - (void)dealloc @@ -125,6 +126,7 @@ typedef enum : NSUInteger { _syncDestroyComponentManager = [[configCenter configForKey:@"iOS_weex_ext_config.syncDestroyComponentManager" defaultValue:@(YES) isDefault:NULL] boolValue]; } _defaultPixelScaleFactor = CGFLOAT_MIN; +_bReleaseInstanceInMainThread = YES; [self addObservers]; } @@ -319,7 +321,10 @@ typedef enum : NSUInteger { [WXTextComponent setRenderUsingCoreText:useCoreText]; BOOL useThreadSafeLock = [[configCenter configForKey:@"iOS_weex_ext_config.useThreadSafeLock" defaultValue:@YES isDefault:NULL] boolValue]; [WXUtility setThreadSafeCollectionUsingLock:useThreadSafeLock]; - + +//Reading config from orange for Release instance in Main Thread or not +_bReleaseInstanceInMainThread = [[configCenter configForKey:@"iOS_weex_ext_config.releaseInstanceInMainThread" defaultValue:@(YES) isDefault:nil] boolValue]; + BOOL shoudMultiContext = NO; shoudMultiContext = [[configCenter configForKey:@"iOS_weex_ext_config.createInstanceUsingMutliContext" defaultValue:@(YES) isDefault:NULL] boolValue]; if(shoudMultiContext && ![WXSDKManager sharedInstance].multiContext) { @@ -477,7 +482,7 @@ typedef enum : NSUInteger { WXLogError(@"Fail to find instanceï¼"); return; } - + [[NSNotificationCenter defaultCenter] postNotificationName:WX_INSTANCE_WILL_DESTROY_NOTIFICATION object:nil userInfo:@{@"instanceId":self.instanceId}]; [WXTracingManager destroyTraincgTaskWithInstance:self.instanceId]; @@ -500,7 +505,15 @@ typedef enum : NSUInteger { WXPerformBlockOnComponentThread(^{ __strong typeof(self) strongSelf = weakSelf; [strongSelf.componentManager unload]; -[WXSDKManager removeInstanceforID:strongSelf.instanceId]; +//Reading config from orange for Release instance in Main Thread or not, for Bug #15172691 +{ +if (!_bReleaseInstanceInMainThread) { +[WXSDKManager removeInstanceforID:strongSelf.instanceId]; +} else { +dispatch_async(dispatch_get_main_queue(), ^{ +[WXSDKManager removeInstanceforID:strongSelf.instanceId]; +}); +} +//+} }); if(url.length > 0){ [WXPrerenderManager addGlobalTask:url callback:nil];
[GitHub] incubator-weex issue #1185: [jsfm] Upgrade js framework to v0.26.5
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1185 hi @Hanks10100 please follow the development-process here http://weex.apache.org/cn/development-process.html ---
incubator-weex git commit: [WEEX-375][iOS] public WXPageEventNotifyProtocol.h file
Repository: incubator-weex Updated Branches: refs/heads/master aeb8758c8 -> 0b9e00eb4 [WEEX-375][iOS] public WXPageEventNotifyProtocol.h file Bug:375 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0b9e00eb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0b9e00eb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0b9e00eb Branch: refs/heads/master Commit: 0b9e00eb478b3ccac9866020fccfb1f31c85dc74 Parents: aeb8758 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 17 14:53:57 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 17 15:00:13 2018 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 4 ++-- ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0b9e00eb/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index a4ce8d2..7a59478 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -609,8 +609,8 @@ DCE2CF9B1F46D4220021BDC4 /* WXVoiceOverModule.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCE2CF9C1F46D4310021BDC4 /* WXVoiceOverModule.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCE2CF9D1F46D4370021BDC4 /* WXVoiceOverModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DCE2CF981F46D4220021BDC4 /* WXVoiceOverModule.m */; }; - DCE7F1EF20AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; }; - DCE7F1F020AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; }; + DCE7F1EF20AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DCE7F1F020AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCEA54621F2B7DB4000ECB23 /* WXTracingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C4E97D311F1EF46D00ABC314 /* WXTracingManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCEA54631F2B7DBA000ECB23 /* WXTracingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C4E97D321F1EF46D00ABC314 /* WXTracingManager.m */; }; DCF087611DCAE161005CD6EB /* WXInvocationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF0875F1DCAE161005CD6EB /* WXInvocationConfig.h */; }; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0b9e00eb/ios/sdk/WeexSDK/Sources/WeexSDK.h -- diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h index dfc0b42..251353c 100644 --- a/ios/sdk/WeexSDK/Sources/WeexSDK.h +++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h @@ -41,6 +41,7 @@ #import "WXResourceLoader.h" #import "WXRecyclerComponent.h" #import "WXPrerenderManager.h" +#import "WXPageEventNotifyEvent.h" #import "WXNetworkProtocol.h" #import "WXNavigationProtocol.h" #import "WXMonitor.h"
incubator-weex git commit: [WEEX-375][iOS] add Protocol for PageEventNotifyEvent
Repository: incubator-weex Updated Branches: refs/heads/master 621a325e3 -> 1649cb68f [WEEX-375][iOS] add Protocol for PageEventNotifyEvent the handler will called in situations such as rootView clicked, scrollView scrolled,a new page start and ended. feature:375 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1649cb68 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1649cb68 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1649cb68 Branch: refs/heads/master Commit: 1649cb68fba6acbade07dc534b6a855afbfab792 Parents: 621a325 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 17 12:14:52 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 17 12:23:55 2018 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 6 .../Sources/Component/WXScrollerComponent.mm| 12 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 6 .../Sources/Protocol/WXPageEventNotifyEvent.h | 32 ios/sdk/WeexSDK/Sources/View/WXRootView.h | 2 +- ios/sdk/WeexSDK/Sources/View/WXRootView.m | 6 6 files changed, 63 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1649cb68/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index d5be6cc..a4ce8d2 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -609,6 +609,8 @@ DCE2CF9B1F46D4220021BDC4 /* WXVoiceOverModule.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCE2CF9C1F46D4310021BDC4 /* WXVoiceOverModule.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCE2CF9D1F46D4370021BDC4 /* WXVoiceOverModule.m in Sources */ = {isa = PBXBuildFile; fileRef = DCE2CF981F46D4220021BDC4 /* WXVoiceOverModule.m */; }; + DCE7F1EF20AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; }; + DCE7F1F020AD358A00D471E7 /* WXPageEventNotifyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */; }; DCEA54621F2B7DB4000ECB23 /* WXTracingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C4E97D311F1EF46D00ABC314 /* WXTracingManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCEA54631F2B7DBA000ECB23 /* WXTracingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C4E97D321F1EF46D00ABC314 /* WXTracingManager.m */; }; DCF087611DCAE161005CD6EB /* WXInvocationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF0875F1DCAE161005CD6EB /* WXInvocationConfig.h */; }; @@ -977,6 +979,7 @@ DCDFED001E68238F00C228D7 /* WXJSExceptionProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXJSExceptionProtocol.h; sourceTree = ""; }; DCE2CF981F46D4220021BDC4 /* WXVoiceOverModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXVoiceOverModule.m; sourceTree = ""; }; DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXVoiceOverModule.h; sourceTree = ""; }; + DCE7F1EE20AD358A00D471E7 /* WXPageEventNotifyEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WXPageEventNotifyEvent.h; path = Protocol/WXPageEventNotifyEvent.h; sourceTree = ""; }; DCF0875F1DCAE161005CD6EB /* WXInvocationConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXInvocationConfig.h; sourceTree = ""; }; DCF087601DCAE161005CD6EB /* WXInvocationConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXInvocationConfig.m; sourceTree = ""; }; DCF0CD9D1EAF3A6B0062CA8F /* native-bundle-main.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "native-bundle-main.js"; path = "../../../../pre-build/native-bundle-main.js"; sourceTree = ""; }; @@ -1345,6 +1348,7 @@ 746
incubator-weex git commit: [WEEX-373][iOS] try to fix the issue about _remove_assocations
Repository: incubator-weex Updated Branches: refs/heads/master 854df9dcd -> 621a325e3 [WEEX-373][iOS] try to fix the issue about _remove_assocations As the the crash stack shows app crash during the deallocating of remove_assocation in JSContext object, so we try to remove the association manually. 0 libobjc.A.dylib 0x0001916318d8 _object_remove_assocations :260 (in libobjc.A.dylib) 1 libobjc.A.dylib 0x00019162c340 _objc_destructInstance :104 (in libobjc.A.dylib) 2 libobjc.A.dylib 0x00019162c398 _object_dispose :28 (in libobjc.A.dylib) 3 0x0001018d5894 NSObjectLifeCycleDealloc NSObjectLifeCycle.m:104 (in) 4 JavaScriptCore 0x0001971876ec -[JSContext dealloc] :196 (in JavaScriptCore) 5 libobjc.A.dylib 0x00019163e134 (anonymous namespace)::AutoreleasePoolPage::pop(void*) :836 (in libobjc.A.dylib) 6 CoreFoundation 0x000192a9ab28 _CFAutoreleasePoolPop :28 (in CoreFoundation) 7 Foundation 0x0001936b35c0 __NSThreadPerformPerform :520 (in Foundation) Bug:373 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/621a325e Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/621a325e Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/621a325e Branch: refs/heads/master Commit: 621a325e3b3a684105980fc9f95ebd776eaa0df1 Parents: 854df9d Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 17 11:50:57 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 17 11:50:57 2018 +0800 -- ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/621a325e/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m -- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m index 342c6c0..885c33e 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m @@ -109,6 +109,11 @@ return self; } +- (void)dealloc +{ +_jsContext.instanceId = nil; +} + - (void)setJSContext:(JSContext *)context { _jsContext = context;
[GitHub] incubator-weex pull request #1183: [WEEX-375][iOS] add Protocol for PageEven...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1183 [WEEX-375][iOS] add Protocol for PageEventNotifyEvent [WEEX-375][iOS] add Protocol for PageEventNotifyEvent the handler will called in situations such as rootView clicked, scrollView scrolled,a new page start and ended. feature:375 You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex ios-securify-event-track Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1183.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1183 commit 24552b1fd41b06c8fb028bcfd2807d93d220fade Author: acton393 <zhangxing610321@...> Date: 2018-05-17T04:14:52Z [WEEX-375][iOS] add Protocol for PageEventNotifyEvent the handler will called in situations such as rootView clicked, scrollView scrolled,a new page start and ended. feature:375 ---
[GitHub] incubator-weex pull request #1182: [WEEX-373][iOS] try to fix the issue abou...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1182 [WEEX-373][iOS] try to fix the issue about _remove_assocations As the the crash stack shows app crash during the deallocating of remove_assocation in JSContext object, so we try to remove the association manually. 0 libobjc.A.dylib 0x0001916318d8 _object_remove_assocations :260 (in libobjc.A.dylib) 1 libobjc.A.dylib 0x00019162c340 _objc_destructInstance :104 (in libobjc.A.dylib) 2 libobjc.A.dylib 0x00019162c398 _object_dispose :28 (in libobjc.A.dylib) 3 0x0001018d5894 NSObjectLifeCycleDealloc NSObjectLifeCycle.m:104 (in) 4 JavaScriptCore 0x0001971876ec -[JSContext dealloc] :196 (in JavaScriptCore) 5 libobjc.A.dylib 0x00019163e134 (anonymous namespace)::AutoreleasePoolPage::pop(void*) :836 (in libobjc.A.dylib) 6 CoreFoundation 0x000192a9ab28 _CFAutoreleasePoolPop :28 (in CoreFoundation) 7 Foundation 0x0001936b35c0 __NSThreadPerformPerform :520 (in Foundation) Bug:373 You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex ios-fix-objc-assocation Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1182.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1182 commit 621a325e3b3a684105980fc9f95ebd776eaa0df1 Author: acton393 <zhangxing610321@...> Date: 2018-05-17T03:50:57Z [WEEX-373][iOS] try to fix the issue about _remove_assocations As the the crash stack shows app crash during the deallocating of remove_assocation in JSContext object, so we try to remove the association manually. 0 libobjc.A.dylib 0x0001916318d8 _object_remove_assocations :260 (in libobjc.A.dylib) 1 libobjc.A.dylib 0x00019162c340 _objc_destructInstance :104 (in libobjc.A.dylib) 2 libobjc.A.dylib 0x00019162c398 _object_dispose :28 (in libobjc.A.dylib) 3 0x0001018d5894 NSObjectLifeCycleDealloc NSObjectLifeCycle.m:104 (in) 4 JavaScriptCore 0x0001971876ec -[JSContext dealloc] :196 (in JavaScriptCore) 5 libobjc.A.dylib 0x00019163e134 (anonymous namespace)::AutoreleasePoolPage::pop(void*) :836 (in libobjc.A.dylib) 6 CoreFoundation 0x000192a9ab28 _CFAutoreleasePoolPop :28 (in CoreFoundation) 7 Foundation 0x0001936b35c0 __NSThreadPerformPerform :520 (in Foundation) Bug:373 ---
incubator-weex git commit: [WEEX-364][iOS] support swift build * [iOS] head newlayout node.h
Repository: incubator-weex Updated Branches: refs/heads/master 71af7585d -> 947767b4c [WEEX-364][iOS] support swift build * [iOS] head newlayout node.h * [iOS] fix compile error close #1176 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/947767b4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/947767b4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/947767b4 Branch: refs/heads/master Commit: 947767b4c5b1cc5e23d4ad6262f6789c1b5b04d6 Parents: 71af758 Author: zouming.zm <zouming...@alibaba-inc.com> Authored: Tue May 15 12:02:03 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue May 15 15:55:12 2018 +0800 -- WeexSDK.podspec | 3 +++ ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 2 +- ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h| 2 +- ios/sdk/WeexSDK/Sources/Layout/WXScrollerComponent+Layout.h | 4 4 files changed, 9 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/947767b4/WeexSDK.podspec -- diff --git a/WeexSDK.podspec b/WeexSDK.podspec index 53f0a17..5fe38ea 100644 --- a/WeexSDK.podspec +++ b/WeexSDK.podspec @@ -36,6 +36,9 @@ Pod::Spec.new do |s| # s.xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) DEBUG=1' } + s.private_header_files = 'ios/sdk/WeexSDK/Sources/Component/RecycleList/WXJSASTParser.h', + 'ios/sdk/WeexSDK/Sources/Layout/WXScrollerComponent+Layout.h' + s.xcconfig = { "OTHER_LINK_FLAG" => '$(inherited) -ObjC'} s.frameworks = 'CoreMedia','MediaPlayer','AVFoundation','AVKit','JavaScriptCore', 'GLKit', 'OpenGLES', 'CoreText', 'QuartzCore', 'CoreGraphics' http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/947767b4/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index 04f689b..d5be6cc 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -508,7 +508,7 @@ DCA445C71EFA57F300D0CFA8 /* Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA3F1CF9ED57008835DC /* Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445C91EFA58CE00D0CFA8 /* native-bundle-main.js in Resources */ = {isa = PBXBuildFile; fileRef = DCF0CD9D1EAF3A6B0062CA8F /* native-bundle-main.js */; }; DCA445CA1EFA58CE00D0CFA8 /* wx_load_er...@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 59AC02501D2A7E6E00355112 /* wx_load_er...@3x.png */; }; - DCA445CB1EFA590600D0CFA8 /* WXComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA571D0520F300452B5D /* WXComponent+Layout.h */; }; + DCA445CB1EFA590600D0CFA8 /* WXComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA571D0520F300452B5D /* WXComponent+Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445CC1EFA592800D0CFA8 /* WXResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 742AD7381DF98C8B007DC46C /* WXResourceLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445CD1EFA592E00D0CFA8 /* WXComponent+Events.h in Headers */ = {isa = PBXBuildFile; fileRef = 7408C48C1CFB345D000BCCD0 /* WXComponent+Events.h */; }; DCA445CE1EFA593500D0CFA8 /* WXComponent+BoxShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C4E375361E5FCBD3009B2D9C /* WXComponent+BoxShadow.h */; }; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/947767b4/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h b/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h index bc7dd06..4289792 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h +++ b/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h @@ -117,7 +117,7 @@ namespace WeexCore { } inline bool isNAN() { - return isnan(mTop) || isnan(mBottom) || isnan(mLeft) || isnan(mRight); +return std::isnan(mTop) || std::isnan(mBottom) || std::isnan(mLeft) || std::isnan(mRight); } inline void reset() { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/947767b4/ios/sdk/WeexSDK/Sources/Layout/WXScrollerComponent+Layout.h -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXScrollerComponent+Layout.h b/ios/sdk/WeexSDK/Sources/Layout/WXScroller
[GitHub] incubator-weex issue #1173: * [Core] Fix max-width problem.
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1173 @YorkShen please rename the title to the format like [WEEX-jiraid][component] summary, pay much more attention to the commit msg, thankshttp://weex.apache.org/development-process.html ---
incubator-weex git commit: [WEEX-362] [iOS] tmp solution if mLayoutResult is nil (mutil thread ?)
Repository: incubator-weex Updated Branches: refs/heads/master b7c069340 -> 88670072a [WEEX-362] [iOS] tmp solution if mLayoutResult is nil (mutil thread ?) close #1174 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/88670072 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/88670072 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/88670072 Branch: refs/heads/master Commit: 88670072a0b472bc8cac2e99f778584933b8ee13 Parents: b7c0693 Author: zhongcang <qh438406...@gmail.com> Authored: Mon May 14 21:38:34 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Mon May 14 21:57:17 2018 +0800 -- ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/88670072/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h index 522bc8c..fac9c4f 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h +++ b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h @@ -257,6 +257,10 @@ namespace WeexCore { inline void reset() { if (isDirty()) { +//todo tmp solution if mLayoutResult is nil (mutil thread ?) +if (nullptr == mLayoutResult) { +mLayoutResult = new WXCorelayoutResult(); +} mLayoutResult->reset(); for (WXCoreFlexLine *flexLine : mFlexLines) { if (flexLine != nullptr) {
incubator-weex git commit: [WEEX-354] [iOS] WXAnalyzer check instance.scriptURL==nil close #1167
Repository: incubator-weex Updated Branches: refs/heads/master 792ac344e -> 0d2681fcd [WEEX-354] [iOS] WXAnalyzer check instance.scriptURL==nil close #1167 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0d2681fc Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0d2681fc Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0d2681fc Branch: refs/heads/master Commit: 0d2681fcd3abef46db2dad5c935a9bee609cc68b Parents: 792ac34 Author: zhongcang <qh438406...@gmail.com> Authored: Fri May 11 13:02:50 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri May 11 14:55:57 2018 +0800 -- ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0d2681fc/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m -- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m index 643b620..8ab9259 100644 --- a/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m @@ -171,7 +171,7 @@ NSMutableDictionary *wrapDic = [data mutableCopy]; [wrapDic setObject:instance.instanceId forKey:@"instanceId"]; -[wrapDic setObject:[instance.scriptURL absoluteString] forKey:@"url"]; +[wrapDic setObject:[instance.scriptURL absoluteString]?:@"unSetscriptURL" forKey:@"url"]; [wrapDic setValue:GROUP_ANALYZER forKey:@"group"]; [wrapDic setValue:module forKey:@"module"]; [wrapDic setValue:type forKey:@"type"];
incubator-weex git commit: [WEEX-345] [iOS] fix animationModule with needLayout bug with nil property
Repository: incubator-weex Updated Branches: refs/heads/master 97af3ab28 -> 792ac344e [WEEX-345] [iOS] fix animationModule with needLayout bug with nil property Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/792ac344 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/792ac344 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/792ac344 Branch: refs/heads/master Commit: 792ac344e38b131f7f819f984488cf62bc82e012 Parents: 97af3ab Author: doumafangAuthored: Fri May 11 10:52:58 2018 +0800 Committer: doumafang Committed: Fri May 11 10:52:58 2018 +0800 -- ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/792ac344/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index 7af5506..c8afd2b 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -309,7 +309,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) - (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)property target:(WXComponent *)target { [_transition.filterStyles setObject:args[@"styles"][property] forKey:property]; -[_transition.oldFilterStyles setObject:target.styles[property] ?:0 forKey:property]; +[_transition.oldFilterStyles setObject:target.styles[property] ?:@0 forKey:property]; [target _modifyStyles:@{property:args[@"styles"][property]}]; [_transitionDic setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; [_transitionDic setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay];
incubator-weex git commit: * [android] Add weex-polyfill.js
Repository: incubator-weex Updated Branches: refs/heads/master 35f3e703f -> 97af3ab28 * [android] Add weex-polyfill.js Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/97af3ab2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/97af3ab2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/97af3ab2 Branch: refs/heads/master Commit: 97af3ab28c7ae340e65b7cbcfef8f369f0974d2e Parents: 35f3e70 Author: miomin <691292...@qq.com> Authored: Thu May 10 20:11:41 2018 +0800 Committer: miomin <691292...@qq.com> Committed: Thu May 10 20:11:41 2018 +0800 -- pre-build/weex-polyfill.js | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/97af3ab2/pre-build/weex-polyfill.js -- diff --git a/pre-build/weex-polyfill.js b/pre-build/weex-polyfill.js new file mode 100644 index 000..3b25d85 --- /dev/null +++ b/pre-build/weex-polyfill.js @@ -0,0 +1,2 @@ +var global = this, process = { env: {} }; !function () { "use strict"; var n, a, r, s; function t(t, n) { return t(n = { exports: {} }, n.exports), n.exports } Array.from || (Array.from = (n = Object.prototype.toString, a = function (t) { return "function" == typeof t || "[object Function]" === n.call(t) }, r = Math.pow(2, 53) - 1, s = function (t) { var n, e = (n = Number(t), isNaN(n) ? 0 : 0 !== n && isFinite(n) ? (0 < n ? 1 : -1) * Math.floor(Math.abs(n)) : n); return Math.min(Math.max(e, 0), r) }, function (t) { var n = Object(t); if (null == t) throw new TypeError("Array.from requires an array-like object - not null or undefined"); var e, r = 1 < arguments.length ? arguments[1] : void 0; if (void 0 !== r) { if (!a(r)) throw new TypeError("Array.from: when provided, the second argument must be a function"); 2 < arguments.length && (e = arguments[2]) } for (var o, i = s(n.length), c = a(this) ? Object(new this(i)) : new Array(i), u = 0; u < i;)o = n[u], c[u] = r ? void 0 === e ? r(o, u) : r.call(e, o, u) : o, u += 1; return c.length = i, c })); var y = t(function (t) { var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = n) }), d = t(function (t) { var n = t.exports = { version: "2.5.4" }; "number" == typeof __e && (__e = n) }), o = (d.version, function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }), m = function (t) { if (!o(t)) throw TypeError(t + " is not an object!"); return t }, e = function (t) { try { return !!t() } catch (t) { return !0 } }, i = !e(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }), c = y.document, u = o(c) && o(c.createElement), f = function (t) { return u ? c.createElement(t) : {} }, l = !i && !e(function () { return 7 != Object.defineProperty(f("div"), "a", { get: function () { return 7 } }).a }), h = Object.defi neProperty, p = { f: i ? Object.defineProperty : function (t, n, e) { if (m(t), n = function (t, n) { if (!o(t)) return t; var e, r; if (n && "function" == typeof (e = t.toString) && !o(r = e.call(t))) return r; if ("function" == typeof (e = t.valueOf) && !o(r = e.call(t))) return r; if (!n && "function" == typeof (e = t.toString) && !o(r = e.call(t))) return r; throw TypeError("Can't convert object to primitive value") }(n, !0), m(e), l) try { return h(t, n, e) } catch (t) { } if ("get" in e || "set" in e) throw TypeError("Accessors not supported!"); return "value" in e && (t[n] = e.value), t } }, w = function (t, n) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: n } }, O = i ? function (t, n, e) { return p.f(t, n, w(1, e)) } : function (t, n, e) { return t[n] = e, t }, v = {}.hasOwnProperty, g = function (t, n) { return v.call(t, n) }, _ = 0, b = Math.random(), j = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++_ + b).to String(36)) }, S = t(function (t) { var i = j("src"), n = "toString", e = Function[n], c = ("" + e).split(n); d.inspectSource = function (t) { return e.call(t) }, (t.exports = function (t, n, e, r) { var o = "function" == typeof e; o && (g(e, "name") || O(e, "name", n)), t[n] !== e && (o && (g(e, i) || O(e, i, t[n] ? "" + t[n] : c.join(String(n, t === y ? t[n] = e : r ? t[n] ? t[n] = e : O(t, n, e) : (delete t[n], O(t, n, e))) })(Function.prototype, n, function () { return "function" == typeof this && this[i] || e.call(this) }) }), T = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t }, P = function (r, o, t) { if (T(r), void 0 === o) return r; switch (t) { case 1: return
incubator-weex git commit: * [iOS] add componentTime/Count monitor
Repository: incubator-weex Updated Branches: refs/heads/master c7880b346 -> 35f3e703f * [iOS] add componentTime/Count monitor * [iOS] modify point * [iOS] rm useless code Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/35f3e703 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/35f3e703 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/35f3e703 Branch: refs/heads/master Commit: 35f3e703f39da229b47f89417dd31ce5097d66fb Parents: c7880b3 Author: zhongcangAuthored: Mon May 7 11:20:01 2018 +0800 Committer: zhongcang Committed: Thu May 10 18:26:23 2018 +0800 -- ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 10 ++ ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h | 8 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m | 4 ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m| 7 +-- ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h | 4 ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m | 7 +-- ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h | 3 +++ 7 files changed, 39 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/35f3e703/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm index c8c6e3f..a955445 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm @@ -548,6 +548,7 @@ static css_node_t * rootNodeGetChild(void *context, int i) - (WXComponent *)_buildComponentForData:(NSDictionary *)data supercomponent:(WXComponent *)supercomponent { +double buildSartTime = CACurrentMediaTime()*1000; NSString *ref = data[@"ref"]; NSString *type = data[@"type"]; NSDictionary *styles = data[@"style"]; @@ -592,6 +593,15 @@ static css_node_t * rootNodeGetChild(void *context, int i) [_indexDict setObject:component forKey:component.ref]; [component readyToRender];// notify redyToRender event when init + +double diffTime = CACurrentMediaTime()*1000 - buildSartTime; +if (!(self.weexInstance.isJSCreateFinish)) { +self.weexInstance.performance.fsComponentCount++; +self.weexInstance.performance.fsComponentCreateTime+=diffTime; +} +self.weexInstance.performance.componentCount++; +self.weexInstance.performance.componentCreateTime+=diffTime; + return component; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/35f3e703/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h index 03f1b99..b731797 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h @@ -48,6 +48,14 @@ //time of user could interace : firsrScreen view or async load veiew(net lazyload) are show) @property (nonatomic, assign) double interactionTime; +//in firsrScreen ,create component count +@property (nonatomic,assign) double fsComponentCount; +//in firsrScreen ,create component time +@property (nonatomic,assign) double fsComponentCreateTime; +//all componentCreate count in instance life +@property (nonatomic,assign) double componentCount; +//all componentCreate time in instance life +@property (nonatomic,assign) double componentCreateTime; @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/35f3e703/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m index 6759fc7..0af52d1 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m @@ -38,6 +38,8 @@ WX_MONITOR_PERF_SET(WXPTFsCallNativeTime, self.performance.fsCallNativeTime, self); WX_MONITOR_PERF_SET(WXPTFsReqNetNum, self.performance.fsReqNetNum, self); WX_MONITOR_PERF_SET(WXPTTimerNum, self.performance.timerNum, self); + WX_MONITOR_PERF_SET(WXPTFsComponentCount,self.performance.fsComponentCount,self); + WX_MONITOR_PERF_SET(WXPTFsComponentCreateTime,self.performance.fsComponentCreateTime,self); } @@ -47,6 +49,8 @@ WX_MONITOR_PERF_SET(WXPTMaxDeepVDom,self.performance.maxVdomDeep,self);
incubator-weex git commit: [WEEX-350][iOS] fix anim crash caused by problem that [WXConvert CGFloat:] return nan when unsupported input
Repository: incubator-weex Updated Branches: refs/heads/master 547da26af -> c7880b346 [WEEX-350][iOS] fix anim crash caused by problem that [WXConvert CGFloat:] return nan when unsupported input Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c7880b34 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c7880b34 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c7880b34 Branch: refs/heads/master Commit: c7880b346b5af741d6c2113efdb22141d28c170b Parents: 547da26 Author: zouming.zmAuthored: Thu May 10 17:40:15 2018 +0800 Committer: zouming.zm Committed: Thu May 10 17:43:47 2018 +0800 -- .../Sources/Layout/WXComponent+Layout.mm| 2 +- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 16 +++ ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 30 +++- 3 files changed, 46 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c7880b34/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm index 2f8368d..01c36ec 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm @@ -540,7 +540,7 @@ do {\ } -(CGFloat)judgePropValuePropValue:(NSString *)propValue defaultValue:(CGFloat)defaultValue{ -CGFloat convertValue = (CGFloat)[WXConvert WXPixelType:propValue scaleFactor:self.weexInstance.pixelScaleFactor]; +CGFloat convertValue = (CGFloat)[WXConvert WXFlexPixelType:propValue scaleFactor:self.weexInstance.pixelScaleFactor]; if (!isnan(convertValue)) { return convertValue; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c7880b34/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h index 775fa05..12c3a1c 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h @@ -28,7 +28,21 @@ @interface WXConvert : NSObject + (BOOL)BOOL:(id)value; + +/** + * @abstract convert value to CGFloat value + * @param valuevalue + * @return CGFloat value + */ + (CGFloat)CGFloat:(id)value; + +/** + * @abstract convert value to CGFloat value, notice that it will return nan if input value is unsupported + * @param valuevalue + * @return CGFloat value or nan(unsupported input) + */ ++ (CGFloat)flexCGFloat:(id)value; + + (NSUInteger)NSUInteger:(id)value; + (NSInteger)NSInteger:(id)value; + (NSString *)NSString:(id)value; @@ -39,6 +53,8 @@ typedef CGFloat WXPixelType; // @parameter scaleFactor: please use weexInstance's pixelScaleFactor property + (WXPixelType)WXPixelType:(id)value scaleFactor:(CGFloat)scaleFactor; +// WXPixelType that use flexCGFloat to convert ++ (WXPixelType)WXFlexPixelType:(id)value scaleFactor:(CGFloat)scaleFactor; + (css_direction_t)css_direction_t:(id)value; + (css_flex_direction_t)css_flex_direction_t:(id)value; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c7880b34/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index a303ddb..0fb2813 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m @@ -63,6 +63,25 @@ WX_NUMBER_CONVERT(NSUInteger, unsignedIntegerValue) { if ([value isKindOfClass:[NSString class]]) { NSString *valueString = (NSString *)value; +if ([valueString hasSuffix:@"px"] || [valueString hasSuffix:@"wx"]) { +valueString = [valueString substringToIndex:(valueString.length - 2)]; +} +if ([value hasPrefix:@"env(safe-area-inset-"] &&[value hasSuffix:@")"]){ +NSUInteger start = [value rangeOfString:@"env(safe-area-inset-"].location +@"env(safe-area-inset-".length; +NSUInteger end = [value rangeOfString:@")" options:NSBackwardsSearch].location; +value = [value substringWithRange:NSMakeRange(start, end-start)]; +return [self safeAreaInset:value]; +} +return [valueString doubleValue]; +} + +return [self double:value]; +} + ++ (CGFloat)flexCGFloat:(id)value +{ +if ([value isKindOfClass:[NSString class]]) { +NSString *valueString = (NSString *)value; if (valueString.length <=0) {
[GitHub] incubator-weex pull request #1145: [WEEX-335][iOS] fix performance point && ...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1145#discussion_r187253448 --- Diff: ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm --- @@ -163,6 +165,13 @@ - (NSUInteger)_childrenCountForLayout - (void)_frameDidCalculated:(BOOL)isChanged { WXAssertComponentThread(); +if (isChanged) { +CGFloat mainScreenWidth = [[UIScreen mainScreen] bounds].size.width; +CGFloat mainScreenHeight = [[UIScreen mainScreen] bounds].size.height; +if (mainScreenHeight/2 < _calculatedFrame.size.height && mainScreenWidth/2 < _calculatedFrame.size.width) { +[self weexInstance].performance.cellExceedNum++; --- End diff -- they are not all cell components ---
incubator-weex git commit: [WEEX-340][iOS]Fix the window problem where weex toast is displayed
Repository: incubator-weex Updated Branches: refs/heads/master 79a046df7 -> 1caeda497 [WEEX-340][iOS]Fix the window problem where weex toast is displayed Because the APP's keyWindow usually change with the business, weex's toast view should be displayed in the window where weex is located. If the window does not exist, it should displayed on the weex root view. U can check this [EXAMPLE](http://dotwe.org/vue/3ce829a89653d651aeadf145af3f98a0) close #1155 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1caeda49 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1caeda49 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1caeda49 Branch: refs/heads/master Commit: 1caeda497c0c7830b4eb2867780773572eba909e Parents: 79a046d Author: jinxiaotong <jinxiaot...@alibaba-inc.com> Authored: Mon May 7 17:23:54 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue May 8 16:13:42 2018 +0800 -- ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1caeda49/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m index 2567519..0c9031a 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXModalUIModule.m @@ -129,7 +129,7 @@ static const CGFloat WXToastDefaultPadding = 30.0; - (void)toast:(NSString *)message duration:(double)duration { WXAssertMainThread(); -UIView *superView = [[UIApplication sharedApplication] keyWindow]; +UIView *superView = self.weexInstance.rootView.window; if (!superView) { superView = self.weexInstance.rootView; }
incubator-weex git commit: [WEEX-345] [iOS] fix animationModule with needLayout bug with nil property close #1156
Repository: incubator-weex Updated Branches: refs/heads/master f4b87eb5f -> 79a046df7 [WEEX-345] [iOS] fix animationModule with needLayout bug with nil property close #1156 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/79a046df Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/79a046df Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/79a046df Branch: refs/heads/master Commit: 79a046df7bc160b535a6997e778104a760d19252 Parents: f4b87eb Author: doumafang <doumaf...@gmail.com> Authored: Tue May 8 15:12:59 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue May 8 15:21:12 2018 +0800 -- ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/79a046df/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index 1513416..7af5506 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -309,7 +309,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) - (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)property target:(WXComponent *)target { [_transition.filterStyles setObject:args[@"styles"][property] forKey:property]; -[_transition.oldFilterStyles setObject:target.styles[property] forKey:property]; +[_transition.oldFilterStyles setObject:target.styles[property] ?:0 forKey:property]; [target _modifyStyles:@{property:args[@"styles"][property]}]; [_transitionDic setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; [_transitionDic setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay];
incubator-weex git commit: [WEEX-343] [iOS] Failure of "scaleY" on animationModule
Repository: incubator-weex Updated Branches: refs/heads/master 02e9a1cf5 -> feb096490 [WEEX-343] [iOS] Failure of "scaleY" on animationModule Because of a very old mistake, when parsing the transform property, the error scaleY is parsed, you can see demo in http://dotwe.org/vue/95a7067fde100e6b8f5219d4bf1913c3 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/feb09649 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/feb09649 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/feb09649 Branch: refs/heads/master Commit: feb096490acf378aed0ee734f963e6c09d6a59b7 Parents: 02e9a1c Author: doumafangAuthored: Mon May 7 16:57:28 2018 +0800 Committer: doumafang Committed: Mon May 7 16:57:28 2018 +0800 -- ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/feb09649/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index a6e2eb5..1513416 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -245,7 +245,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) WXAnimationInfo *newInfo = [info copy]; newInfo.propertyName = @"transform.scale.y"; newInfo.fromValue = @(oldTransform.scaleY); -newInfo.toValue = @(wxTransform.scaleX); +newInfo.toValue = @(wxTransform.scaleY); [infos addObject:newInfo]; }
incubator-weex git commit: [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs
Repository: incubator-weex Updated Branches: refs/heads/master 9425cc92d -> 089b7a785 [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs Bug:309 close #1148 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/089b7a78 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/089b7a78 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/089b7a78 Branch: refs/heads/master Commit: 089b7a7856ac530627138c89ee16d2d0623db203 Parents: 9425cc9 Author: acton393 <zhangxing610...@gmail.com> Authored: Fri May 4 18:37:50 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Mon May 7 15:43:39 2018 +0800 -- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/089b7a78/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m -- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index e50e15a..a44c27d 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -982,7 +982,7 @@ _Pragma("clang diagnostic pop") \ if (instance) { bundleUrl = instance.pageName?:([instance.scriptURL absoluteString]?:@"WX_KEY_EXCEPTION_WXBRIDGE"); -message = [NSString stringWithFormat:@"[WX_KEY_EXCEPTION_WXBRIDGE] [%@:%@:%@] %@\n%@\n%@", exception[@"sourceURL"], exception[@"line"], exception[@"column"], [exception toString], [exception[@"stack"] toObject], instance.scriptURL.absoluteString]; +message = [NSString stringWithFormat:@"[WX_KEY_EXCEPTION_WXBRIDGE] [%@:%@:%@] %@\n%@\n%@\n%@\n%@\n%@", exception[@"sourceURL"], exception[@"line"], exception[@"column"], [exception toString], [exception[@"stack"] toObject], instance.scriptURL.absoluteString, instance.callCreateInstanceContext?:@"", instance.createInstanceContextResult?:@"", instance.executeRaxApiResult?:@""]; userInfo = @{@"jsMainBundleStringContentLength":instance.userInfo[@"jsMainBundleStringContentLength"]?:@"", @"jsMainBundleStringContentMd5":instance.userInfo[@"jsMainBundleStringContentMd5"]?:@""}; }
[GitHub] incubator-weex issue #1147: [Android] Merge WeexCore-master to master once.
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1147 @miomin please rebase your branch and follow the development process at the same time http://weex.apache.org/development-process.html ---
[GitHub] incubator-weex pull request #1148: [WEEX-309][iOS]fill up context informatio...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1148 [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex ios-fill-up-exception Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1148.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1148 commit 2869fefa5661fbbdd8fd4852b0bc0b80391c8707 Author: acton393 <zhangxing610321@...> Date: 2018-05-04T10:37:50Z [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs commit f6de63bf16a6d264a99de401661b439f31d83631 Author: acton393 <zhangxing610321@...> Date: 2018-05-04T10:40:37Z [WEEX-309][iOS]fill up context information when javaScript runtime exception occurs Bug:309 ---
[GitHub] incubator-weex issue #1146: [iOS]bugfix: toast should display on weex window
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1146 hi @x461909066 please follow the development-process here, pay more attention to the commit message format http://weex.apache.org/development-process.html ---
incubator-weex git commit: [WEEX-333][iOS] add protection for bezierPath contains nan point.
Repository: incubator-weex Updated Branches: refs/heads/master cf531a167 -> 9425cc92d [WEEX-333][iOS] add protection for bezierPath contains nan point. Bug:333 [WEEX-333][iOS]fix check valid point logic Bug: 333 close #1144 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9425cc92 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9425cc92 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9425cc92 Branch: refs/heads/master Commit: 9425cc92d19201b59e240c5d86c6ec7575db6309 Parents: cf531a1 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu May 3 17:58:21 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 3 19:58:18 2018 +0800 -- ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m | 16 +--- ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 9 + ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 5 + 3 files changed, 27 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9425cc92/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m index b7aa821..7a74c3f 100644 --- a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m +++ b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m @@ -18,6 +18,7 @@ */ #import "UIBezierPath+Weex.h" +#import "WXUtility.h" @implementation UIBezierPath (Weex) @@ -32,13 +33,23 @@ static const float kCircleControlPoint = 0.447715; bottomRight:(CGFloat)bottomRightRadius { UIBezierPath *path = [UIBezierPath bezierPath]; -[path moveToPoint:CGPointMake(rect.origin.x + topLeftRadius, rect.origin.y)]; +if(isnan(topLeftRadius) || isnan(topRightRadius) || isnan(bottomLeftRadius) || isnan(bottomRightRadius)) { +return path; +} +if (![WXUtility isValidPoint:rect.origin] || isnan(rect.size.height) || isnan(rect.size.width)) { +return path; +} +CGPoint topLeftPoint = CGPointMake(rect.origin.x + topLeftRadius, rect.origin.y); +if (![WXUtility isValidPoint:topLeftPoint]) { +return path; +} +[path moveToPoint:topLeftPoint]; // +--+ // \\ top // // \\+--+// CGPoint topRightPoint = CGPointMake(CGRectGetMaxX(rect) - topRightRadius, rect.origin.y); -if (isnan(topRightPoint.x) || isnan(topRightPoint.y)) { +if (![WXUtility isValidPoint:topRightPoint]) { return path; } [path addLineToPoint:topRightPoint]; @@ -101,5 +112,4 @@ static const float kCircleControlPoint = 0.447715; return path; } - @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9425cc92/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h index b1b852a..aee32c2 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h +++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h @@ -203,6 +203,15 @@ _Nonnull SEL WXSwizzledSelectorForSelector(_Nonnull SEL selector); */ + (BOOL)isBlankString:(NSString * _Nullable)string ; + +/** + check a point is valid or not. A zero point is also valid + + @param point a point value to check + @return true if point.x and point.y are all valid value for a number. + */ ++ (BOOL)isValidPoint:(CGPoint)point; + /** * @abstract Returns a standard error object * http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9425cc92/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m index dd3a35d..567ba9a 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m @@ -352,6 +352,11 @@ CGFloat WXFloorPixelValue(CGFloat value) return false; } ++ (BOOL)isValidPoint:(CGPoint)point +{ +return !(isnan(point.x)) && !(isnan(point.y)); +} + + (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message { message = message ? : @"";
[GitHub] incubator-weex pull request #1144: [WEEX-333][iOS] add protection for bezier...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1144 [WEEX-333][iOS] add protection for bezierPath contains nan point. [WEEX-333][iOS] add protection for bezierPath contains nan point. Bug:333 You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex iOS-bezier-exception Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1144.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1144 commit e56aed9ec4a265536824eb7d7c597e28730c7299 Author: acton393 <zhangxing610321@...> Date: 2018-05-03T09:58:21Z [WEEX-333][iOS] add protection for bezierPath contains nan point. Bug:333 ---
incubator-weex git commit: [WEEX-328][iOS]ScrollComponent called all scrollview delegate close #1142
Repository: incubator-weex Updated Branches: refs/heads/master 67d3f1dc6 -> e315e8ab3 [WEEX-328][iOS]ScrollComponent called all scrollview delegate close #1142 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e315e8ab Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e315e8ab Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e315e8ab Branch: refs/heads/master Commit: e315e8ab3aed5c430e2e4b19f95e43d65bfb6818 Parents: 67d3f1d Author: yuchenghai <xiaochuan@alibaba-inc.com> Authored: Wed May 2 17:22:50 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu May 3 11:58:17 2018 +0800 -- .../Sources/Component/WXScrollerComponent.mm| 35 1 file changed, 35 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e315e8ab/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm index 215d9ff..52bb962 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm @@ -620,6 +620,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) NSDictionary *contentOffsetData = @{@"x":[NSNumber numberWithFloat:-scrollView.contentOffset.x / scaleFactor],@"y":[NSNumber numberWithFloat:-scrollView.contentOffset.y / scaleFactor]}; [self fireEvent:@"scrollstart" params:@{@"contentSize":contentSizeData,@"contentOffset":contentOffsetData} domChanges:nil]; } + +NSHashTable *delegates = [_delegates copy]; +for (id delegate in delegates) { +if ([delegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]) { +[delegate scrollViewWillBeginDragging:scrollView]; +} +} } - (void)scrollViewDidScroll:(UIScrollView *)scrollView @@ -705,6 +712,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) inset.bottom = 0; } [scrollView setContentInset:inset]; + +NSHashTable *delegates = [_delegates copy]; +for (id delegate in delegates) { +if ([delegate respondsToSelector:@selector(scrollViewDidEndScrollingAnimation:)]) { +[delegate scrollViewDidEndScrollingAnimation:scrollView]; +} +} } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView @@ -717,6 +731,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) [self fireEvent:@"scrollend" params:@{@"contentSize":contentSizeData,@"contentOffset":contentOffsetData} domChanges:nil]; } } + +NSHashTable *delegates = [_delegates copy]; +for (id delegate in delegates) { +if ([delegate respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) { +[delegate scrollViewDidEndDecelerating:scrollView]; +} +} } - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset @@ -734,6 +755,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) // drop up } } + +NSHashTable *delegates = [_delegates copy]; +for (id delegate in delegates) { +if ([delegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) { +[delegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; +} +} } - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate @@ -757,6 +785,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) _isScrolling = NO; [self performSelector:@selector(scrollViewDidEndDecelerating:) withObject:nil afterDelay:0.1]; } + +NSHashTable *delegates = [_delegates copy]; +for (id delegate in delegates) { +if ([delegate respondsToSelector:@selector(scrollViewDidEndDragging:willDecelerate:)]) { +[delegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; +} +} } - (void)loadMoreIfNeed
incubator-weex git commit: [WEEX-321] [iOS] fix animationModule with needLayout bug [Forced Update!]
Repository: incubator-weex Updated Branches: refs/heads/master 79b10220d -> cfefd7b64 (forced update) [WEEX-321] [iOS] fix animationModule with needLayout bug You can see demo http://dotwe.org/vue/afb257a664b58c013eb60a4ef2eb8df7 This issue fix when animation 'needLayout:true' bug. close #1139 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cfefd7b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cfefd7b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cfefd7b6 Branch: refs/heads/master Commit: cfefd7b6425c9feeebdf360501ae670a90dcee63 Parents: 21aa9ab Author: doumafang <doumaf...@gmail.com> Authored: Fri Apr 27 21:43:15 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri Apr 27 22:23:21 2018 +0800 -- .../WeexSDK/Sources/Module/WXAnimationModule.m | 43 +++- 1 file changed, 15 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cfefd7b6/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index a619166..a6e2eb5 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -134,8 +134,9 @@ @interface WXAnimationModule () -@property (nonatomic,assign) BOOL needLayout; +@property (nonatomic, assign) BOOL needLayout; @property (nonatomic, strong) WXTransition *transition; +@property (nonatomic, strong) NSMutableDictionary *transitionDic; @property (nonatomic, assign) BOOL isAnimationedSuccess; @end @@ -178,6 +179,9 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) if (args[@"needLayout"]) { _needLayout = [WXConvert BOOL:args[@"needLayout"]]; _transition = [WXTransition new]; +_transitionDic = [NSMutableDictionary new]; +_transition.filterStyles = [NSMutableDictionary new]; +_transition.oldFilterStyles = [NSMutableDictionary new]; } CAMediaTimingFunction *timingFunction = [WXConvert CAMediaTimingFunction:args[@"timingFunction"]]; NSDictionary *styles = args[@"styles"]; @@ -273,7 +277,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) [infos addObject:info]; } else if ([property isEqualToString:@"width"]) { if (_needLayout) { -[self animationWithTransitionTarget:target handleProperty:property withDic:args]; +[self transitionWithArgs:args withProperty:property target:target]; } else { @@ -286,7 +290,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) } } else if ([property isEqualToString:@"height"]) { if (_needLayout) { -[self animationWithTransitionTarget:target handleProperty:property withDic:args]; +[self transitionWithArgs:args withProperty:property target:target]; } else { @@ -302,31 +306,14 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) return infos; } -- (void)animationWithTransitionTarget:(WXComponent *)target handleProperty:(NSString *)property withDic:(NSDictionary *)args +- (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)property target:(WXComponent *)target { -NSDictionary *styles = args[@"styles"]; -_transition.filterStyles = [NSMutableDictionary dictionaryWithDictionary:styles]; -_transition.oldFilterStyles =_transition.oldFilterStyles ? :[NSMutableDictionary dictionaryWithDictionary:target.styles] ; -[_transition.oldFilterStyles setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; -[_transition.oldFilterStyles setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay]; -NSString *oldProperty = _transition.oldFilterStyles[kWXTransitionProperty]; -NSString *newProperty; -if (oldProperty) { -if ([oldProperty containsString:property]) { -newProperty = oldProperty; -} -else -{ -newProperty = [NSString stringWithFormat:@"%@,%@",oldProperty,property]; -} -} -else -{ -newProperty = property; -} -[_transition.oldFilterStyles setObject:newProperty forKey:kWXTransitionProperty]; -[_transition.oldFilterStyles setObject:args[@"timingFunction"] forKey:kWXTransitionTimingFunction]; -[target _modifyStyles:styles]; +[_transition.filterStyles setObject:args[@"styles&
incubator-weex git commit: [WEEX-321] [iOS] fix animationModule with needLayout bug
Repository: incubator-weex Updated Branches: refs/heads/master 21aa9ab57 -> 79b10220d [WEEX-321] [iOS] fix animationModule with needLayout bug You can see demo http://dotwe.org/vue/afb257a664b58c013eb60a4ef2eb8df7 This issue fix when animation 'needLayout:true' bug. Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/79b10220 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/79b10220 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/79b10220 Branch: refs/heads/master Commit: 79b10220dc38bacde0c5e6fc2dbef63d62d78d97 Parents: 21aa9ab Author: doumafang <doumaf...@gmail.com> Authored: Fri Apr 27 21:43:15 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri Apr 27 22:20:10 2018 +0800 -- .../WeexSDK/Sources/Module/WXAnimationModule.m | 43 +++- 1 file changed, 15 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/79b10220/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index a619166..a6e2eb5 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -134,8 +134,9 @@ @interface WXAnimationModule () -@property (nonatomic,assign) BOOL needLayout; +@property (nonatomic, assign) BOOL needLayout; @property (nonatomic, strong) WXTransition *transition; +@property (nonatomic, strong) NSMutableDictionary *transitionDic; @property (nonatomic, assign) BOOL isAnimationedSuccess; @end @@ -178,6 +179,9 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) if (args[@"needLayout"]) { _needLayout = [WXConvert BOOL:args[@"needLayout"]]; _transition = [WXTransition new]; +_transitionDic = [NSMutableDictionary new]; +_transition.filterStyles = [NSMutableDictionary new]; +_transition.oldFilterStyles = [NSMutableDictionary new]; } CAMediaTimingFunction *timingFunction = [WXConvert CAMediaTimingFunction:args[@"timingFunction"]]; NSDictionary *styles = args[@"styles"]; @@ -273,7 +277,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) [infos addObject:info]; } else if ([property isEqualToString:@"width"]) { if (_needLayout) { -[self animationWithTransitionTarget:target handleProperty:property withDic:args]; +[self transitionWithArgs:args withProperty:property target:target]; } else { @@ -286,7 +290,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) } } else if ([property isEqualToString:@"height"]) { if (_needLayout) { -[self animationWithTransitionTarget:target handleProperty:property withDic:args]; +[self transitionWithArgs:args withProperty:property target:target]; } else { @@ -302,31 +306,14 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) return infos; } -- (void)animationWithTransitionTarget:(WXComponent *)target handleProperty:(NSString *)property withDic:(NSDictionary *)args +- (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)property target:(WXComponent *)target { -NSDictionary *styles = args[@"styles"]; -_transition.filterStyles = [NSMutableDictionary dictionaryWithDictionary:styles]; -_transition.oldFilterStyles =_transition.oldFilterStyles ? :[NSMutableDictionary dictionaryWithDictionary:target.styles] ; -[_transition.oldFilterStyles setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; -[_transition.oldFilterStyles setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay]; -NSString *oldProperty = _transition.oldFilterStyles[kWXTransitionProperty]; -NSString *newProperty; -if (oldProperty) { -if ([oldProperty containsString:property]) { -newProperty = oldProperty; -} -else -{ -newProperty = [NSString stringWithFormat:@"%@,%@",oldProperty,property]; -} -} -else -{ -newProperty = property; -} -[_transition.oldFilterStyles setObject:newProperty forKey:kWXTransitionProperty]; -[_transition.oldFilterStyles setObject:args[@"timingFunction"] forKey:kWXTransitionTimingFunction]; -[target _modifyStyles:styles]; +[_transition.filterStyles setObject:args[@"styles"][property] forKey:prope
incubator-weex git commit: * [iOS] public WXRecyclerComponent.h
Repository: incubator-weex Updated Branches: refs/heads/master b77b42599 -> 21aa9ab57 * [iOS] public WXRecyclerComponent.h * [iOS] fix build error Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/21aa9ab5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/21aa9ab5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/21aa9ab5 Branch: refs/heads/master Commit: 21aa9ab5779dc7b7d5189ca882dad392ecdf40a4 Parents: b77b425 Author: zhongcangAuthored: Thu Apr 26 21:30:15 2018 +0800 Committer: zhongcang Committed: Thu Apr 26 22:12:10 2018 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/21aa9ab5/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index e017293..04f689b 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -36,6 +36,8 @@ 17E5ACDB2091F05700EE81F1 /* WXComponent+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 176BE43B209172330086B6AF /* WXComponent+Layout.mm */; }; 17E5ACDC2091F05E00EE81F1 /* WXCoreLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B4FE20452E1700A2296A /* WXCoreLayout.cpp */; }; 17E5ACDD2091F06300EE81F1 /* WXCoreStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B50120452E1800A2296A /* WXCoreStyle.cpp */; }; + 17E5ACE2209211BD00EE81F1 /* WXTransition.mm in Sources */ = {isa = PBXBuildFile; fileRef = 333D9A261F41507A007CED39 /* WXTransition.mm */; }; + 17E5ACE3209211C200EE81F1 /* WXTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 333D9A251F41507A007CED39 /* WXTransition.h */; }; 17F2D6E72087227300084378 /* WXAnalyzerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1C1A2BED1D91172800539AA1 /* WXConvertTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1A2BEC1D91172800539AA1 /* WXConvertTests.m */; }; 1D3000F11D40B9AC004F3B4F /* WXClipboardModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D3000EF1D40B9AB004F3B4F /* WXClipboardModule.h */; }; @@ -150,7 +152,7 @@ 744D61151E4AF23E00B624B3 /* WXDiffUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 744D61131E4AF23E00B624B3 /* WXDiffUtil.m */; }; 745B2D681E5A8E1E0092D38A /* WXMultiColumnLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D5E1E5A8E1E0092D38A /* WXMultiColumnLayout.h */; }; 745B2D691E5A8E1E0092D38A /* WXMultiColumnLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D5F1E5A8E1E0092D38A /* WXMultiColumnLayout.m */; }; - 745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; }; + 745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 745B2D6B1E5A8E1E0092D38A /* WXRecyclerComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D611E5A8E1E0092D38A /* WXRecyclerComponent.mm */; }; 745B2D6C1E5A8E1E0092D38A /* WXRecyclerDataController.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D621E5A8E1E0092D38A /* WXRecyclerDataController.h */; }; 745B2D6D1E5A8E1E0092D38A /* WXRecyclerDataController.m in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D631E5A8E1E0092D38A /* WXRecyclerDataController.m */; }; @@ -1946,6 +1948,7 @@ DCA445FF1EFA5A4600D0CFA8 /* WXInstanceWrap.h in Headers */, DCE2CF9C1F46D4310021BDC4 /* WXVoiceOverModule.h in Headers */, C42E8FAB1F3C7C09001EBE9D /* WXExtendCallNativeProtocol.h in Headers */, + 17E5ACE3209211C200EE81F1 /* WXTransition.h in Headers */, DCA445F31EFA5A2500D0CFA8 /* WXFooterComponent.h in Headers */, DCA446151EFA5A9000D0CFA8 /* WXBridgeContext.h in Headers */, DCA4461A1EFA5AA000D0CFA8 /* WXInvocationConfig.h in Headers */, @@ -2224,6 +2227,7 @@ 742AD7321DF98C45007DC46C /* WXResourceRequestHandlerDefaultImpl.m in Sources
[08/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm new file mode 100644 index 000..86124ff --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm @@ -0,0 +1,1812 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXSliderNeighborComponent.h" +#import "WXConvert.h" +#import "WXUtility.h" +#import "WXComponent_internal.h" +#import "WXIndicatorComponent.h" +#import "WXSDKInstance.h" +#import "NSTimer+Weex.h" +#import "WXComponent+Layout.h" + +#define MAX_VISIBLE_ITEMS 30 +#define MIN_TOGGLE_DURATION 0.2 +#define MAX_TOGGLE_DURATION 0.4 +#define SCROLL_DURATION 0.4 +#define INSERT_DURATION 0.4 +#define DECELERATE_THRESHOLD 0.1 +#define SCROLL_SPEED_THRESHOLD 2.0 +#define SCROLL_DISTANCE_THRESHOLD 0.1 +#define DECELERATION_MULTIPLIER 30.0 +#define FLOAT_ERROR_MARGIN 0.01 + +@protocol WXSliderNeighborDelegate, WXSliderNeighborDataSource; + +@interface WXSliderNeighborView: UIView +@property (nonatomic, strong) WXIndicatorView *indicator; +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id dataSource; +@property (nonatomic, assign) CGFloat perspective; +@property (nonatomic, readonly, getter = isDragging) BOOL dragging; +@property (nonatomic, readonly, getter = isScrolling) BOOL scrolling; +@property (nonatomic, assign) CGFloat autoscroll; +@property (nonatomic, assign) CGFloat scrollOffset; +@property (nonatomic, assign) CGFloat previousTranslation; +@property (nonatomic, assign, getter = isVertical) BOOL vertical; +@property (nonatomic, assign) CGFloat decelerationRate; +@property (nonatomic, assign, getter = isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, assign, getter = isPagingEnabled) BOOL pagingEnabled; +@property (nonatomic, assign) BOOL bounces; +@property (nonatomic, assign) BOOL didDrag; +@property (nonatomic, readonly, getter = isDecelerating) BOOL decelerating; +@property (nonatomic, strong, readonly) UIView *contentView; +@property (nonatomic, strong) NSMutableDictionary *itemViews; +@property (nonatomic, readonly) NSInteger numberOfVisibleItems; +@property (nonatomic, readonly) NSInteger numberOfItems; +@property (nonatomic, readonly) NSInteger numberOfPlaceholders; +@property (nonatomic, strong) NSMutableSet *itemViewPool; +@property (nonatomic, strong) NSMutableSet *placeholderViewPool; +@property (nonatomic, assign) NSTimeInterval startTime; +@property (nonatomic, assign) NSTimeInterval lastTime; +@property (nonatomic, assign) CGFloat startVelocity; +@property (nonatomic, assign) CGFloat offsetMultiplier; +@property (nonatomic, assign) CGFloat startOffset; +@property (nonatomic, assign) CGFloat endOffset; +@property (nonatomic, assign) CGSize contentOffset; +@property (nonatomic, assign) CGSize viewpointOffset; +@property (nonatomic, assign) CGFloat scrollSpeed; +@property (nonatomic, assign) CGFloat bounceDistance; +@property (nonatomic, assign) BOOL stopAtItemBoundary; +@property (nonatomic, assign) BOOL scrollToItemBoundary; +@property (nonatomic, assign) BOOL centerItemWhenSelected; +@property (nonatomic, assign) NSTimeInterval scrollDuration; +@property (nonatomic, readonly, getter = isWrapEnabled) BOOL wrapEnabled; +@property (nonatomic, strong) NSTimer *timer; +@property (nonatomic, assign) NSInteger numberOfPlaceholdersToShow; +@property (nonatomic, assign) CGFloat previousScrollOffset; +@property (nonatomic, assign) NSTimeInterval toggleTime; +@property (nonatomic, readonly) CGFloat toggle; +@property (nonatomic, assign) NSInteger previousItemIndex; +@property (nonatomic, readonly) CGFloat itemWidth; +@property (nonatomic, assign) BOOL inited; +@end + +@implementation WXSliderNeighborView + +- (instancetype)init { + +self = [super init]; +if (!self) { +} +_decelerationRate = 0.01; +_scrollEnabled = YES; +_bounces = YES; +_offsetMultiplier = 1.0; +_perspective = -1.0/500.0; +_contentOffset = CGSizeZero; +
[09/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.m deleted file mode 100644 index 5bfee0a..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.m +++ /dev/null @@ -1,1803 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "WXSliderNeighborComponent.h" -#import "WXConvert.h" -#import "WXUtility.h" -#import "WXComponent_internal.h" -#import "WXIndicatorComponent.h" -#import "WXSDKInstance.h" -#import "NSTimer+Weex.h" - -#define MAX_VISIBLE_ITEMS 30 -#define MIN_TOGGLE_DURATION 0.2 -#define MAX_TOGGLE_DURATION 0.4 -#define SCROLL_DURATION 0.4 -#define INSERT_DURATION 0.4 -#define DECELERATE_THRESHOLD 0.1 -#define SCROLL_SPEED_THRESHOLD 2.0 -#define SCROLL_DISTANCE_THRESHOLD 0.1 -#define DECELERATION_MULTIPLIER 30.0 -#define FLOAT_ERROR_MARGIN 0.01 - -@protocol WXSliderNeighborDelegate, WXSliderNeighborDataSource; - -@interface WXSliderNeighborView: UIView -@property (nonatomic, strong) WXIndicatorView *indicator; -@property (nonatomic, weak) id delegate; -@property (nonatomic, weak) id dataSource; -@property (nonatomic, assign) CGFloat perspective; -@property (nonatomic, readonly, getter = isDragging) BOOL dragging; -@property (nonatomic, readonly, getter = isScrolling) BOOL scrolling; -@property (nonatomic, assign) CGFloat autoscroll; -@property (nonatomic, assign) CGFloat scrollOffset; -@property (nonatomic, assign) CGFloat previousTranslation; -@property (nonatomic, assign, getter = isVertical) BOOL vertical; -@property (nonatomic, assign) CGFloat decelerationRate; -@property (nonatomic, assign, getter = isScrollEnabled) BOOL scrollEnabled; -@property (nonatomic, assign, getter = isPagingEnabled) BOOL pagingEnabled; -@property (nonatomic, assign) BOOL bounces; -@property (nonatomic, assign) BOOL didDrag; -@property (nonatomic, readonly, getter = isDecelerating) BOOL decelerating; -@property (nonatomic, strong, readonly) UIView *contentView; -@property (nonatomic, strong) NSMutableDictionary *itemViews; -@property (nonatomic, readonly) NSInteger numberOfVisibleItems; -@property (nonatomic, readonly) NSInteger numberOfItems; -@property (nonatomic, readonly) NSInteger numberOfPlaceholders; -@property (nonatomic, strong) NSMutableSet *itemViewPool; -@property (nonatomic, strong) NSMutableSet *placeholderViewPool; -@property (nonatomic, assign) NSTimeInterval startTime; -@property (nonatomic, assign) NSTimeInterval lastTime; -@property (nonatomic, assign) CGFloat startVelocity; -@property (nonatomic, assign) CGFloat offsetMultiplier; -@property (nonatomic, assign) CGFloat startOffset; -@property (nonatomic, assign) CGFloat endOffset; -@property (nonatomic, assign) CGSize contentOffset; -@property (nonatomic, assign) CGSize viewpointOffset; -@property (nonatomic, assign) CGFloat scrollSpeed; -@property (nonatomic, assign) CGFloat bounceDistance; -@property (nonatomic, assign) BOOL stopAtItemBoundary; -@property (nonatomic, assign) BOOL scrollToItemBoundary; -@property (nonatomic, assign) BOOL centerItemWhenSelected; -@property (nonatomic, assign) NSTimeInterval scrollDuration; -@property (nonatomic, readonly, getter = isWrapEnabled) BOOL wrapEnabled; -@property (nonatomic, strong) NSTimer *timer; -@property (nonatomic, assign) NSInteger numberOfPlaceholdersToShow; -@property (nonatomic, assign) CGFloat previousScrollOffset; -@property (nonatomic, assign) NSTimeInterval toggleTime; -@property (nonatomic, readonly) CGFloat toggle; -@property (nonatomic, assign) NSInteger previousItemIndex; -@property (nonatomic, readonly) CGFloat itemWidth; -@property (nonatomic, assign) BOOL inited; -@end - -@implementation WXSliderNeighborView - -- (instancetype)init { - -self = [super init]; -if (!self) { -} -_decelerationRate = 0.01; -_scrollEnabled = YES; -_bounces = YES; -_offsetMultiplier = 1.0; -_perspective = -1.0/500.0; -_contentOffset = CGSizeZero; -_viewpointOffset = CGSizeZero; -
[14/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m -- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index b76ac90..e50e15a 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -136,6 +136,9 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:elementData[@"ref"] className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"addElement" options:nil]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: addElement : %@",elementData[@"type"]); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -159,6 +162,9 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:bodyData[@"ref"] className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"createBody" options:@{@"threadName":WXTJSBridgeThread}]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: createBody %@ ref:%@",bodyData[@"type"],bodyData[@"ref"]); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -183,6 +189,9 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:ref className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"removeElement" options:nil]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: removeElement ref:%@",ref); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -206,6 +215,9 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:ref className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"moveElement" options:nil]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: moveElement ,ref:%@ to ref:%@",ref,parentRef); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -228,6 +240,9 @@ _Pragma("clang diagnostic pop") \ [WXTracingManager startTracingWithInstanceId:instanceId ref:ref className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"updateAttrs" options:@{@"threadName":WXTJSBridgeThread}]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: updateAttrs ref:%@,attr:%@",ref,attrsData); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -251,6 +266,10 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:ref className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"updateStyles" options:@{@"threadName":WXTJSBridgeThread}]; WXPerformBlockOnComponentThread(^{ + +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: updateStyles ref:%@,styles:%@",ref,stylesData); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -273,6 +292,10 @@ _Pragma("clang diagnostic pop") \ } WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: addEvent ref:%@",ref); +#endif + WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -295,6 +318,9 @@ _Pragma("clang diagnostic pop") \ } WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action :removeEvent ref:%@",ref); +#endif WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -317,6 +343,10 @@ _Pragma("clang diagnostic pop") \ } [WXTracingManager startTracingWithInstanceId:instanceId ref:nil className:nil name:WXTJSCall phase:WXTracingEnd functionName:@"createFinish" options:@{@"threadName":WXTJSBridgeThread}]; WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +WXLogDebug(@"flexLayout -> action: createFinish :%@",instanceId); +#endif + WXComponentManager *manager = instance.componentManager; if (!manager.isValid) { return; @@ -339,6 +369,9 @@
[16/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
[WEEX-311] [iOS] use new layoutEngin to replace yoga * [iOS] support new flex-layout engine * [iOS] update layout engin * [iOS] fix recycleList copy node error * [iOS] rm useless code * [iOS] rtl old layout engin * [iOS] rm uselse code * [iOS] format log * [iOS] rm useless code close #1135 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b77b4259 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b77b4259 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b77b4259 Branch: refs/heads/master Commit: b77b42599e763b2e25a63d6a9c576eeb388494dd Parents: bf14bcd Author: MrRaindrop <tekk...@gmail.com> Authored: Tue Oct 31 22:15:05 2017 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 20:38:59 2018 +0800 -- WeexSDK.podspec |2 +- ios/playground/WeexDemo/WXExtModule.m |7 + ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 327 ++-- .../WeexSDK/Sources/Bridge/WXBridgeContext.m| 38 + .../Component/RecycleList/WXCellSlotComponent.m | 94 - .../RecycleList/WXCellSlotComponent.mm | 117 ++ .../RecycleList/WXRecycleListComponent.m| 618 -- .../RecycleList/WXRecycleListComponent.mm | 619 ++ .../Component/Recycler/WXRecyclerComponent.m| 738 --- .../Component/Recycler/WXRecyclerComponent.mm | 768 .../WeexSDK/Sources/Component/WXCellComponent.m | 145 -- .../Sources/Component/WXCellComponent.mm| 174 ++ .../Sources/Component/WXComponent_internal.h| 11 +- .../Sources/Component/WXCycleSliderComponent.m | 681 --- .../Sources/Component/WXCycleSliderComponent.mm | 692 +++ .../WeexSDK/Sources/Component/WXEditComponent.m | 918 - .../Sources/Component/WXEditComponent.mm| 971 ++ .../Sources/Component/WXHeaderComponent.m | 87 - .../Sources/Component/WXHeaderComponent.mm | 110 ++ .../WeexSDK/Sources/Component/WXListComponent.m | 975 -- .../Sources/Component/WXListComponent.mm| 997 ++ .../Sources/Component/WXLoadingComponent.m | 152 -- .../Sources/Component/WXLoadingComponent.mm | 164 ++ .../Sources/Component/WXRefreshComponent.m | 207 -- .../Sources/Component/WXRefreshComponent.mm | 224 +++ .../Sources/Component/WXScrollerComponent.h |2 - .../Sources/Component/WXScrollerComponent.m | 884 - .../Sources/Component/WXScrollerComponent.mm| 951 + .../Component/WXSliderNeighborComponent.m | 1803 - .../Component/WXSliderNeighborComponent.mm | 1812 ++ .../Sources/Component/WXSwitchComponent.m | 151 -- .../Sources/Component/WXSwitchComponent.mm | 162 ++ .../Sources/Component/WXTextAreaComponent.m | 233 --- .../Sources/Component/WXTextAreaComponent.mm| 261 +++ .../WeexSDK/Sources/Component/WXTextComponent.m | 1076 --- .../Sources/Component/WXTextComponent.mm| 1170 +++ ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m|2 + .../WeexSDK/Sources/Layout/WXComponent+Layout.h | 60 +- .../Sources/Layout/WXComponent+Layout.mm| 963 ++ ios/sdk/WeexSDK/Sources/Layout/WXCoreFlexEnum.h | 107 ++ ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.cpp | 1038 ++ ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.h | 1073 +++ ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.cpp | 247 +++ ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.h| 285 +++ ios/sdk/WeexSDK/Sources/Layout/WXLayoutDefine.h |6 + .../Sources/Layout/WXScrollerComponent+Layout.h | 42 + .../Layout/WXScrollerComponent+Layout.mm| 53 + .../Sources/Manager/WXComponentManager.m| 958 - .../Sources/Manager/WXComponentManager.mm | 1158 +++ ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 13 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 842 ios/sdk/WeexSDK/Sources/Model/WXComponent.mm| 953 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 16 +- ios/sdk/WeexSDK/Sources/Module/WXTransition.m | 519 - ios/sdk/WeexSDK/Sources/Module/WXTransition.mm | 519 + ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 23 + ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 17 +- .../Sources/View/WXComponent+ViewManagement.m | 346 .../Sources/View/WXComponent+ViewManagement.mm | 347 ios/sdk/WeexSDK/Sources/View/WXRootView.m |2 +- ios/sdk/WeexSDK/Sources/WeexSDK.h |4 + 61 files changed, 16358 insertions(+), 11576 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/Wee
[04/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.cpp -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.cpp b/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.cpp new file mode 100644 index 000..11f8dc8 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Layout/WXCoreStyle.cpp @@ -0,0 +1,247 @@ +#include "WXCoreStyle.h" + +namespace WeexCore { + + bool WXCoreMargin::setMargin(const WXCoreMarginEdge , float margin) { +bool dirty = false; +switch (edge) { + case kMarginALL: +if (mMarginLeft != margin +|| mMarginTop != margin +|| mMarginRight != margin +|| mMarginBottom != margin) { + mMarginLeft = margin; + mMarginTop = margin; + mMarginRight = margin; + mMarginBottom = margin; + dirty = true; +} +break; + case kMarginLeft: +if (mMarginLeft != margin) { + mMarginLeft = margin; + dirty = true; +} +break; + case kMarginTop: +if (mMarginTop != margin) { + mMarginTop = margin; + dirty = true; +} +break; + case kMarginRight: +if (mMarginRight != margin) { + mMarginRight = margin; + dirty = true; +} +break; + case kMarginBottom: +if (mMarginBottom != margin) { + mMarginBottom = margin; + dirty = true; +} +break; +} +return dirty; + } + + float WXCoreMargin::getMargin(const WXCoreMarginEdge )const { +float margin = 0; +switch (edge) { + case kMarginLeft: +margin = mMarginLeft; +break; + case kMarginTop: +margin = mMarginTop; +break; + case kMarginRight: +margin = mMarginRight; +break; + case kMarginBottom: +margin = mMarginBottom; +break; + default: +break; +} +return margin; + } + + bool WXCorePadding::setPadding(const WXCorePaddingEdge , float padding) { +bool dirty = false; +switch (edge) { + case kPaddingALL: +if (mPaddingLeft != padding +|| mPaddingTop != padding +|| mPaddingRight != padding +|| mPaddingBottom != padding) { + mPaddingLeft = padding; + mPaddingTop = padding; + mPaddingRight = padding; + mPaddingBottom = padding; + dirty = true; +} +break; + case kPaddingLeft: +if (mPaddingLeft != padding) { + mPaddingLeft = padding; + dirty = true; +} +break; + case kPaddingTop: +if (mPaddingTop != padding) { + mPaddingTop = padding; + dirty = true; +} +break; + case kPaddingRight: +if (mPaddingRight != padding) { + mPaddingRight = padding; + dirty = true; +} +break; + case kPaddingBottom: +if (mPaddingBottom != padding) { + mPaddingBottom = padding; + dirty = true; +} +break; +} +return dirty; + } + + float WXCorePadding::getPadding(const WXCorePaddingEdge )const { +float padding = 0; +switch (edge) { + case kPaddingLeft: +padding = mPaddingLeft; +break; + case kPaddingTop: +padding = mPaddingTop; +break; + case kPaddingRight: +padding = mPaddingRight; +break; + case kPaddingBottom: +padding = mPaddingBottom; +break; + default: +break; +} +return padding; + } + + bool WXCoreBorderWidth::setBorderWidth(const WXCoreBorderWidthEdge , float borderWidth) { +bool dirty = false; +switch (edge) { + case kBorderWidthALL: +if (mBorderWidthLeft != borderWidth +|| mBorderWidthTop != borderWidth +|| mBorderWidthRight != borderWidth +|| mBorderWidthBottom != borderWidth) { + mBorderWidthLeft = borderWidth; + mBorderWidthTop = borderWidth; + mBorderWidthRight = borderWidth; + mBorderWidthBottom = borderWidth; + dirty = true; +} +break; + case kBorderWidthLeft: +if (mBorderWidthLeft != borderWidth) { + mBorderWidthLeft = borderWidth; + dirty = true; +} +break; + case kBorderWidthTop: +if (mBorderWidthTop != borderWidth) { + mBorderWidthTop = borderWidth; + dirty = true; +} +break; + case kBorderWidthRight: +if (mBorderWidthRight != borderWidth) { + mBorderWidthRight = borderWidth; + dirty = true; +} +break; + case kBorderWidthBottom: +if (mBorderWidthBottom != borderWidth) { + mBorderWidthBottom = borderWidth; + dirty = true; +} +break; +} +
[06/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm new file mode 100644 index 000..c951068 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm @@ -0,0 +1,1170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXTextComponent.h" +#import "WXSDKInstance_private.h" +#import "WXComponent_internal.h" +#import "WXLayer.h" +#import "WXUtility.h" +#import "WXConvert.h" +#import "WXRuleManager.h" +#import "WXDefine.h" +#import "WXView.h" +#import "WXComponent+Layout.h" +#import +#import +#import "WXComponent+Layout.h" + +// WXText is a non-public is not permitted +@interface WXTextView : WXView +@property (nonatomic, strong) NSTextStorage *textStorage; +@end + +@implementation WXTextView + +- (instancetype)initWithFrame:(CGRect)frame +{ +if ((self = [super initWithFrame:frame])) { +self.accessibilityTraits |= UIAccessibilityTraitStaticText; + +self.opaque = NO; +self.contentMode = UIViewContentModeRedraw; +self.textStorage = [NSTextStorage new]; +} +return self; +} + ++ (Class)layerClass +{ +return [WXLayer class]; +} + +- (void)copy:(id)sender +{ +[[UIPasteboard generalPasteboard] setString:((WXTextComponent*)self.wx_component).text]; +} + +- (void)setTextStorage:(NSTextStorage *)textStorage +{ +if (_textStorage != textStorage) { +_textStorage = textStorage; +[self.wx_component setNeedsDisplay]; +} +} + +- (BOOL)canBecomeFirstResponder +{ +return YES; +} + +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender +{ +if (action == @selector(copy:)) { +return [[self.wx_component valueForKey:@"_enableCopy"] boolValue]; +} +return [super canPerformAction:action withSender:sender]; +} + +- (NSString *)description +{ +NSString *superDescription = super.description; +NSRange semicolonRange = [superDescription rangeOfString:@";"]; +NSString * content = _textStorage.string; +if ([(WXTextComponent*)self.wx_component useCoreText]) { +content = ((WXTextComponent*)self.wx_component).text; +} +NSString *replacement = [NSString stringWithFormat:@"; text: %@; frame:%f,%f,%f,%f", content, self.frame.origin.x, self.frame.origin.y, self.frame.size.width, self.frame.size.height]; +return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement]; +} + +- (NSString *)accessibilityValue +{ +if (self.wx_component && self.wx_component->_ariaLabel) { +return [super accessibilityValue]; +} +if (![(WXTextComponent*)self.wx_component useCoreText]) { +return _textStorage.string; +} +return ((WXTextComponent*)self.wx_component).text; +} + +- (NSString *)accessibilityLabel +{ +if (self.wx_component) { +if (self.wx_component->_ariaLabel) { +return self.wx_component->_ariaLabel; +} +} +return [super accessibilityLabel]; +} + +@end + +static BOOL textRenderUsingCoreText = YES; + +NSString *const WXTextTruncationToken = @"\u2026"; +CGFloat WXTextDefaultLineThroughWidth = 1.2; + +@interface WXTextComponent() +@property (nonatomic, strong) NSString *useCoreTextAttr; +@end + +@implementation WXTextComponent +{ +UIEdgeInsets _border; +UIEdgeInsets _padding; +NSTextStorage *_textStorage; +CGFloat _textStorageWidth; + +UIColor *_color; +NSString *_fontFamily; +CGFloat _fontSize; +CGFloat _fontWeight; +WXTextStyle _fontStyle; +NSUInteger _lines; +NSTextAlignment _textAlign; +NSString *_direction; +WXTextDecoration _textDecoration; +NSString *_textOverflow; +CGFloat _lineHeight; +CGFloat _letterSpacing; +BOOL _truncationLine; // support trunk tail + +NSAttributedString * _ctAttributedString; +NSString *_wordWrap; + +pthread_mutex_t _ctAttributedStringMutex; +pthread_mutexattr_t _propertMutexAttr; +BOOL _observerIconfont; +BOOL
[12/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m deleted file mode 100644 index f2d6c99..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m +++ /dev/null @@ -1,918 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "WXEditComponent.h" -#import "WXConvert.h" -#import "WXUtility.h" -#import "WXSDKInstance.h" -#import "WXSDKInstance_private.h" -#import "WXDefine.h" -#import "WXAssert.h" -#import "WXComponent_internal.h" -#import "WXComponent+PseudoClassManagement.h" -#import "WXTextInputComponent.h" - -@interface WXEditComponent() - -//@property (nonatomic, strong) WXTextInputView *inputView; -@property (nonatomic, strong) WXDatePickerManager *datePickerManager; -@property (nonatomic, strong) NSDictionary *attr; -//attribute -@property (nonatomic) NSNumber *maxLength; -@property (nonatomic) NSString * value; -@property (nonatomic) BOOL autofocus; -@property(nonatomic) UIReturnKeyType returnKeyType; -@property (nonatomic) BOOL disabled; -@property (nonatomic, copy) NSString *inputType; -@property (nonatomic) NSUInteger rows; -@property (nonatomic) BOOL hideDoneButton; - -//style -@property (nonatomic) WXPixelType fontSize; -@property (nonatomic) WXTextStyle fontStyle; -@property (nonatomic) CGFloat fontWeight; -@property (nonatomic, strong) NSString *fontFamily; -@property (nonatomic, strong) UIColor *colorForStyle; -@property (nonatomic)NSTextAlignment textAlignForStyle; - -//event -@property (nonatomic) BOOL inputEvent; -@property (nonatomic) BOOL clickEvent; -@property (nonatomic) BOOL focusEvent; -@property (nonatomic) BOOL blurEvent; -@property (nonatomic) BOOL changeEvent; -@property (nonatomic) BOOL returnEvent; -@property (nonatomic) BOOL keyboardEvent; -@property (nonatomic, strong) NSString *changeEventString; -@property (nonatomic, assign) CGSize keyboardSize; - -// formatter -@property (nonatomic, strong) NSString * formatRule; -@property (nonatomic, strong) NSString * formatReplace; -@property (nonatomic, strong) NSString * recoverRule; -@property (nonatomic, strong) NSString * recoverReplace; -@property (nonatomic, strong) NSDictionary * formaterData; - -// disable move rootView up as the keyboard show up. -@property (nonatomic, assign) BOOL disableMoveViewUp; - -@end - -@implementation WXEditComponent -{ -UIEdgeInsets _border; -UIEdgeInsets _padding; -} - -WX_EXPORT_METHOD(@selector(focus)) -WX_EXPORT_METHOD(@selector(blur)) -WX_EXPORT_METHOD(@selector(setSelectionRange:selectionEnd:)) -WX_EXPORT_METHOD(@selector(getSelectionRange:)) -WX_EXPORT_METHOD(@selector(setTextFormatter:)) - -- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance -{ -self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]; -if (self) { -_inputEvent = NO; -_focusEvent = NO; -_blurEvent = NO; -_changeEvent = NO; -_returnEvent = NO; -_clickEvent = NO; -_keyboardEvent = NO; -// handle attributes -_autofocus = [attributes[@"autofocus"] boolValue]; -_disabled = [attributes[@"disabled"] boolValue]; -_value = [WXConvert NSString:attributes[@"value"]]?:@""; -_placeholderString = [WXConvert NSString:attributes[@"placeholder"]]?:@""; -if(attributes[@"type"]) { -_inputType = [WXConvert NSString:attributes[@"type"]]; -_attr = attributes; -} -if (attributes[@"maxlength"]) { -_maxLength = [NSNumber numberWithUnsignedInteger:[attributes[@"maxlength"] integerValue]]; -} -if (attributes[@"returnKeyType"]) { -_returnKeyType = [WXConvert UIReturnKeyType:attributes[@"returnKeyType"]]; -} -if (attributes[@"rows"]) { -_rows = [attributes[@"rows"]
[02/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm new file mode 100644 index 000..0556ca5 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm @@ -0,0 +1,953 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXComponent.h" +#import "WXComponent_internal.h" +#import "WXComponentManager.h" +#import "WXSDKManager.h" +#import "WXSDKInstance.h" +#import "WXSDKInstance_private.h" +#import "WXDefine.h" +#import "WXLog.h" +#import "WXWeakObjectWrapper.h" +#import "WXUtility.h" +#import "WXConvert.h" +#import "WXMonitor.h" +#import "WXAssert.h" +#import "WXThreadSafeMutableDictionary.h" +#import "WXThreadSafeMutableArray.h" +#import "WXTransform.h" +#import "WXRoundedRect.h" +#import +#import "WXComponent+PseudoClassManagement.h" +#import "WXComponent+BoxShadow.h" +#import "WXTracingManager.h" +#import "WXComponent+Events.h" +#import "WXComponent+Layout.h" + +#pragma clang diagnostic ignored "-Wincomplete-implementation" +#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" + +@interface WXComponent () + +@end + +@implementation WXComponent +{ +@private +NSString *_ref; +NSMutableDictionary *_styles; +NSMutableDictionary *_attributes; +NSMutableArray *_events; + +// Protects properties styles/attributes/events/subcomponents which will be accessed from multiple threads. +pthread_mutex_t _propertyMutex; +pthread_mutexattr_t _propertMutexAttr; + +__weak WXComponent *_supercomponent; +__weak id _ancestorScroller; +__weak WXSDKInstance *_weexInstance; +} + +#pragma mark Life Cycle + +- (instancetype)initWithRef:(NSString *)ref + type:(NSString *)type + styles:(NSDictionary *)styles + attributes:(NSDictionary *)attributes + events:(NSArray *)events + weexInstance:(WXSDKInstance *)weexInstance +{ +if (self = [super init]) { +pthread_mutexattr_init(&_propertMutexAttr); +pthread_mutexattr_settype(&_propertMutexAttr, PTHREAD_MUTEX_RECURSIVE); +pthread_mutex_init(&_propertyMutex, &_propertMutexAttr); + +_ref = ref; +_type = type; +_weexInstance = weexInstance; +_componentType = WXComponentTypeCommon; +_styles = [self parseStyles:styles]; +_attributes = attributes ? [NSMutableDictionary dictionaryWithDictionary:attributes] : [NSMutableDictionary dictionary]; +_events = events ? [NSMutableArray arrayWithArray:events] : [NSMutableArray array]; +_subcomponents = [NSMutableArray array]; +_absolutePosition = CGPointMake(NAN, NAN); + +_displayType = WXDisplayTypeBlock; +_isNeedJoinLayoutSystem = YES; +_isLayoutDirty = YES; +_isViewFrameSyncWithCalculated = YES; +_ariaHidden = nil; +_accessible = nil; +_accessibilityHintContent = nil; + +_async = NO; + +if (styles[kWXTransitionProperty]) { +_transition = [[WXTransition alloc]initWithStyles:styles]; +} + +//TODO set indicator style +if ([type isEqualToString:@"indicator"]) { +_styles[@"position"] = @"absolute"; +if (!_styles[@"left"] && !_styles[@"right"]) { +_styles[@"left"] = @0.0f; +} +if (!_styles[@"top"] && !_styles[@"bottom"]) { +_styles[@"top"] = @0.0f; +} +} + +if (attributes[@"ariaHidden"]) { + +_ariaHidden = [WXConvert NSString:attributes[@"ariaHidden"]]; +} +if (attributes[@"role"]) { +_roles = attributes[@"role"]; +} +if (attributes[@"ariaLabel"]) { +_ariaLabel = [WXConvert NSString:attributes[@"ariaLabel"]]; +} +if (attributes[@"accessible"]) { +_accessible = [WXConvert NSString:attributes[@"accessible"]]; +} +
[15/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index a4c0db2..e017293 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -11,6 +11,11 @@ 170B4664208733AF00562666 /* WXAnalyzerCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 170B4665208733BF00562666 /* WXAnalyzerCenter+Transfer.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */; }; 170B4668208733E500562666 /* WXAnalyzerCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */; }; + 176BE43C209172330086B6AF /* WXComponent+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 176BE43B209172330086B6AF /* WXComponent+Layout.mm */; }; + 176BE43D209172A30086B6AF /* WXScrollerComponent+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B4FF20452E1800A2296A /* WXScrollerComponent+Layout.mm */; }; + 176BE43E209172E20086B6AF /* WXScrollerComponent+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B4FF20452E1800A2296A /* WXScrollerComponent+Layout.mm */; }; + 178EDF0D204FEC1300917F6B /* WXScrollerComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50020452E1800A2296A /* WXScrollerComponent+Layout.h */; }; + 178EDF0F204FF11700917F6B /* WXCoreLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50420452E1800A2296A /* WXCoreLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17B122212090AA9300387E33 /* WXSDKInstance_performance.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B1221F2090AA9300387E33 /* WXSDKInstance_performance.m */; }; 17B12090AA9300387E33 /* WXSDKInstance_performance.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B122202090AA9300387E33 /* WXSDKInstance_performance.h */; }; 17B122252090AAB000387E33 /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B122232090AAB000387E33 /* WXSDKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -20,6 +25,17 @@ 17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17C74F0D2072145100AB4CAB /* WXAnalyzerCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */; }; 17C74F0F2072147B00AB4CAB /* WXAnalyzerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17C7B50620452E1800A2296A /* WXCoreLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B4FE20452E1700A2296A /* WXCoreLayout.cpp */; }; + 17C7B50820452E1800A2296A /* WXScrollerComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50020452E1800A2296A /* WXScrollerComponent+Layout.h */; }; + 17C7B50920452E1800A2296A /* WXCoreStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B50120452E1800A2296A /* WXCoreStyle.cpp */; }; + 17C7B50A20452E1800A2296A /* WXCoreFlexEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50220452E1800A2296A /* WXCoreFlexEnum.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17C7B50B20452E1800A2296A /* WXCoreStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50320452E1800A2296A /* WXCoreStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17E5ACD82091F02D00EE81F1 /* WXCoreLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50420452E1800A2296A /* WXCoreLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17E5ACD92091F03700EE81F1 /* WXCoreStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50320452E1800A2296A /* WXCoreStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17E5ACDA2091F05000EE81F1 /* WXCoreFlexEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C7B50220452E1800A2296A /* WXCoreFlexEnum.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17E5ACDB2091F05700EE81F1 /* WXComponent+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 176BE43B209172330086B6AF /* WXComponent+Layout.mm */; }; + 17E5ACDC2091F05E00EE81F1 /* WXCoreLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17C7B4FE20452E1700A2296A /* WXCoreLayout.cpp */; }; + 17E5ACDD2091F06300EE81F1 /* WXCoreStyle.cpp in Sources */ = {isa =
[01/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
Repository: incubator-weex Updated Branches: refs/heads/master bf14bcdb5 -> b77b42599 http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m -- diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m deleted file mode 100644 index 66d6ad5..000 --- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "WXComponent+ViewManagement.h" -#import "WXComponent_internal.h" -#import "WXComponent+BoxShadow.h" -#import "WXAssert.h" -#import "WXView.h" -#import "WXSDKInstance_private.h" -#import "WXTransform.h" -#import "WXTracingManager.h" -#import "WXSDKManager.h" - -#define WX_BOARD_RADIUS_RESET_ALL(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_borderTopLeftRadius = _borderTopRightRadius = _borderBottomLeftRadius = _borderBottomRightRadius = 0;\ -[self setNeedsDisplay];\ -}\ -} while(0); - -#define WX_BOARD_RADIUS_RESET(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_##key = 0;\ -[self setNeedsDisplay];\ -}\ -} while(0); - -#define WX_BOARD_WIDTH_RESET_ALL(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_borderTopWidth = _borderLeftWidth = _borderRightWidth = _borderBottomWidth = 0;\ -[self setNeedsLayout];\ -}\ -} while(0); - -#define WX_BOARD_WIDTH_RESET(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_##key = 0;\ -[self setNeedsLayout];\ -}\ -} while(0); - -#define WX_BOARD_RADIUS_COLOR_RESET_ALL(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_borderTopColor = _borderLeftColor = _borderRightColor = _borderBottomColor = [UIColor blackColor];\ -[self setNeedsDisplay];\ -}\ -} while(0); - -#define WX_BOARD_COLOR_RESET(key)\ -do {\ -if (styles && [styles containsObject:@#key]) {\ -_##key = [UIColor blackColor];\ -[self setNeedsDisplay];\ -}\ -} while(0); - -#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" - -@implementation WXComponent (ViewManagement) - -#pragma mark Public - -- (UIView *)loadView -{ -return [[WXView alloc] init]; -} - -- (BOOL)isViewLoaded -{ -return (_view != nil); -} - -- (void)insertSubview:(WXComponent *)subcomponent atIndex:(NSInteger)index -{ -WXAssertMainThread(); - -if (subcomponent.displayType == WXDisplayTypeNone) { -return; -} - -WX_CHECK_COMPONENT_TYPE(self.componentType) -if (subcomponent->_positionType == WXPositionTypeFixed) { -[self.weexInstance.rootView addSubview:subcomponent.view]; -return; -} - -// use _lazyCreateView to forbid component like cell's view creating -if(_lazyCreateView) { -subcomponent->_lazyCreateView = YES; -} - -if (!subcomponent->_lazyCreateView || (self->_lazyCreateView && [self isViewLoaded])) { -[self.view insertSubview:subcomponent.view atIndex:index]; -} -} - -- (void)willRemoveSubview:(WXComponent *)component -{ -WXAssertMainThread(); -} - -- (void)removeFromSuperview -{ -WXAssertMainThread(); - -if ([self isViewLoaded]) { -[self.view removeFromSuperview]; -} -} - -- (void)moveToSuperview:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index -{ -WX_CHECK_COMPONENT_TYPE(self.componentType) -[self removeFromSuperview]; -[newSupercomponent insertSubview:self atIndex:index]; -} - -- (void)viewWillLoad -{ -WXAssertMainThread(); -} - -- (void)viewDidLoad -{ -WXAssertMainThread(); -} - -- (void)viewWillUnload -{ -WXAssertMainThread(); -} - -- (void)viewDidUnload -{ -WXAssertMainThread(); -} - -#pragma mark Private - -- (void)_initViewPropertyWithStyles:(NSDictionary *)styles -{ -_backgroundColor = styles[@"backgroundColor"] ? [WXConvert UIColor:styles[@"backgroundColor"]] : [UIColor clearColor]; -_backgroundImage = styles[@"backgroundImage"] ? [WXConvert
[11/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m deleted file mode 100644 index d73531c..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m +++ /dev/null @@ -1,975 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "WXListComponent.h" -#import "WXCellComponent.h" -#import "WXHeaderComponent.h" -#import "WXComponent.h" -#import "WXComponent_internal.h" -#import "NSArray+Weex.h" -#import "WXAssert.h" -#import "WXMonitor.h" -#import "WXUtility.h" -#import "NSObject+WXSwizzle.h" -#import "WXSDKInstance_private.h" -#import "WXRefreshComponent.h" -#import "WXLoadingComponent.h" - -@interface WXTableView : UITableView - -@end - -@implementation WXTableView - -+ (BOOL)requiresConstraintBasedLayout -{ -return NO; -} - -- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch -{ -if ([(id ) self.wx_component respondsToSelector:@selector(requestGestureShouldStopPropagation:shouldReceiveTouch:)]) { -return [(id ) self.wx_component requestGestureShouldStopPropagation:gestureRecognizer shouldReceiveTouch:touch]; -} -else{ -return YES; -} -} - -- (void)layoutSubviews -{ -[super layoutSubviews]; -[self.wx_component layoutDidFinish]; -} - -- (void)setContentOffset:(CGPoint)contentOffset -{ -// FIXME: side effect caused by hooking _adjustContentOffsetIfNecessary. -// When UITableView is pulled down and finger releasesï¼contentOffset will be set from - to about -0.5(greater than -0.5), then contentOffset will be reset to zero by calling _adjustContentOffsetIfNecessary. -// So hooking _adjustContentOffsetIfNecessary will always cause remaining 1px space between list's top and navigator. -// Demo: http://dotwe.org/895630945793a9a044e49abe39cbb77f -// Have to reset contentOffset to zero manually here. -if (fabs(contentOffset.y) < 0.5) { -contentOffset.y = 0; -} -if (isnan(contentOffset.x)) { -contentOffset.x = 0; -} -if(isnan(contentOffset.y)) { -contentOffset.y = 0; -} - -[super setContentOffset:contentOffset]; -} - -@end - -// WXText is a non-public is not permitted -@interface WXSectionComponent : NSObject - -@property (nonatomic, strong) WXHeaderComponent *header; -@property (nonatomic, strong) NSMutableArray *rows; - -@end - -@implementation WXSectionComponent - -- (instancetype)init -{ -if (self = [super init]) { -_rows = [NSMutableArray array]; -} - -return self; -} - -- (id)copyWithZone:(NSZone *)zone -{ -WXSectionComponent *newSection = [[[self class] allocWithZone:zone] init]; -newSection.header = _header; -newSection.rows = [_rows mutableCopyWithZone:zone]; - -return newSection; -} - -- (NSString *)description -{ -return [NSString stringWithFormat:@"%@\n%@", [_header description], [_rows description]]; -} -@end - -@interface WXListComponent ()- -@property (nonatomic, assign) NSUInteger currentTopVisibleSection; - -@end - -@implementation WXListComponent -{ -__weak UITableView * _tableView; - -// Only accessed on component thread -NSMutableArray *_sections; -// Only accessed on main thread -NSMutableArray *_completedSections; -NSUInteger _previousLoadMoreRowNumber; -// insert & reload & batch -NSString *_updataType; - -BOOL _isUpdating; -NSMutableArray *_updates; -NSTimeInterval _reloadInterval; -} - -- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance -{ -if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) { -_sections = [NSMutableArray array]; -
[03/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm -- diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm new file mode 100644 index 000..c8c6e3f --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm @@ -0,0 +1,1158 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXComponentManager.h" +#import "WXComponent.h" +#import "WXComponent_internal.h" +#import "WXComponent+DataBinding.h" +#import "WXComponentFactory.h" +#import "WXDefine.h" +#import "NSArray+Weex.h" +#import "WXSDKInstance.h" +#import "WXAssert.h" +#import "WXUtility.h" +#import "WXMonitor.h" +#import "WXScrollerProtocol.h" +#import "WXSDKManager.h" +#import "WXSDKError.h" +#import "WXInvocationConfig.h" +#import "WXHandlerFactory.h" +#import "WXValidateProtocol.h" +#import "WXPrerenderManager.h" +#import "WXTracingManager.h" +#import "WXLayoutDefine.h" +#import "WXSDKInstance_performance.h" +#import "WXRootView.h" +#import "WXComponent+Layout.h" + + + +static NSThread *WXComponentThread; + +#define WXAssertComponentExist(component) WXAssert(component, @"component not exists") + + +@implementation WXComponentManager +{ +__weak WXSDKInstance *_weexInstance; +BOOL _isValid; + +BOOL _stopRunning; +NSUInteger _noTaskTickCount; + +// access only on component thread +NSMapTable *_indexDict; +NSMutableArray *_uiTaskQueue; +NSMutableDictionary *_uiPrerenderTaskQueue; + +WXComponent *_rootComponent; +NSMutableArray *_fixedComponents; +//#ifndef USE_FLEX +css_node_t *_rootCSSNode; +//#else +WeexCore::WXCoreLayoutNode* _rootFlexCSSNode; +//#endif +CADisplayLink *_displayLink; +} + ++ (instancetype)sharedManager +{ +static id _sharedInstance = nil; +static dispatch_once_t oncePredicate; +dispatch_once(, ^{ +_sharedInstance = [[self alloc] init]; +}); +return _sharedInstance; +} + +- (instancetype)initWithWeexInstance:(id)weexInstance +{ +if (self = [self init]) { +_weexInstance = weexInstance; + +_indexDict = [NSMapTable strongToWeakObjectsMapTable]; +_fixedComponents = [NSMutableArray wx_mutableArrayUsingWeakReferences]; +_uiTaskQueue = [NSMutableArray array]; +_isValid = YES; +[self _startDisplayLink]; +} + +return self; +} + +- (void)dealloc +{ +//#ifndef USE_FLEX +if(![WXComponent isUseFlex]) +{ + free_css_node(_rootCSSNode); +} + +//#else + +if(_rootFlexCSSNode){ +delete _rootFlexCSSNode; + + // WeexCore::WXCoreLayoutNode::freeNodeTree(_rootFlexCSSNode); +_rootFlexCSSNode=nullptr; +} +//#endif +[NSMutableArray wx_releaseArray:_fixedComponents]; +} + +#pragma mark Thread Management + ++ (NSThread *)componentThread +{ +static dispatch_once_t onceToken; +dispatch_once(, ^{ +WXComponentThread = [[NSThread alloc] initWithTarget:[self sharedManager] selector:@selector(_runLoopThread) object:nil]; +[WXComponentThread setName:WX_COMPONENT_THREAD_NAME]; +if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { +[WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]]; +} else { +[WXComponentThread setThreadPriority:[[NSThread mainThread] threadPriority]]; +} + +[WXComponentThread start]; +}); + +return WXComponentThread; +} + +- (void)_runLoopThread +{ +[[NSRunLoop currentRunLoop] addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode]; + +while (!_stopRunning) { +@autoreleasepool { +[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; +} +} +} + ++ (void)_performBlockOnComponentThread:(void (^)(void))block +{ +if([NSThread currentThread] == [self componentThread]){ +block(); +} else { +[self performSelector:@selector(_performBlockOnComponentThread:) +
[10/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m deleted file mode 100644 index 585c9f3..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "WXRefreshComponent.h" -#import "WXScrollerComponent.h" -#import "WXLoadingIndicator.h" -#import "WXComponent_internal.h" -#import "WXLog.h" - -@interface WXRefreshComponent() - -@property (nonatomic) BOOL displayState; -@property (nonatomic) BOOL initFinished; -@property (nonatomic) BOOL refreshEvent; -@property (nonatomic) BOOL pullingdownEvent; - -@property (nonatomic, weak) WXLoadingIndicator *indicator; - -@end - -@implementation WXRefreshComponent - -- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance -{ -self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]; -if (self) { -_refreshEvent = NO; -_pullingdownEvent = NO; -if (attributes[@"display"]) { -if ([attributes[@"display"] isEqualToString:@"show"]) { -_displayState = YES; -} else if ([attributes[@"display"] isEqualToString:@"hide"]) { -_displayState = NO; -} else { -WXLogError(@""); -} -} -self.cssNode->style.position_type = CSS_POSITION_ABSOLUTE; -} -return self; -} - -- (void)viewDidLoad -{ - _initFinished = YES; - -if (!_displayState) { -[_indicator.view setHidden:YES]; -} -} - -- (void)layoutDidFinish -{ -[self.view setFrame: (CGRect) { -.size = self.calculatedFrame.size, -.origin.x = self.calculatedFrame.origin.x, -.origin.y = self.view.frame.origin.y - CGRectGetHeight(self.calculatedFrame) -}]; -} - -- (void)viewWillUnload -{ -_displayState = NO; -_refreshEvent = NO; -_initFinished = NO; -} - -- (void)refresh -{ -if (!_refreshEvent || _displayState) { -return; -} -[self fireEvent:@"refresh" params:nil]; -} - -- (void)pullingdown:(NSDictionary*)param -{ -if (!_pullingdownEvent) { -return ; -} - -[self fireEvent:@"pullingdown" params:param]; -} - -- (void)_insertSubcomponent:(WXComponent *)subcomponent atIndex:(NSInteger)index -{ -if (subcomponent) { -[super _insertSubcomponent:subcomponent atIndex:index]; -if ([subcomponent isKindOfClass:[WXLoadingIndicator class]]) { -_indicator = (WXLoadingIndicator*)subcomponent; -} -} -} - -- (void)updateAttributes:(NSDictionary *)attributes -{ -if (attributes[@"display"]) { -if ([attributes[@"display"] isEqualToString:@"show"]) { -_displayState = YES; -} else if ([attributes[@"display"] isEqualToString:@"hide"]) { -_displayState = NO; -} else { -WXLogError(@""); -} -[self setDisplay]; -} -} - -- (void)addEvent:(NSString *)eventName -{ -if ([eventName isEqualToString:@"refresh"]) { -_refreshEvent = YES; -} -if ([eventName isEqualToString:@"pullingdown"]) { -_pullingdownEvent = YES; -} -} - -- (void)removeEvent:(NSString *)evetName -{ -if ([evetName isEqualToString:@"refresh"]) { -_refreshEvent = NO; -} -if ([evetName isEqualToString:@"pullingdown"]) { -_pullingdownEvent = NO; -} -} - -- (void)setDisplay -{ -id scrollerProtocol = self.ancestorScroller; -if (scrollerProtocol == nil || !_initFinished) -return; - -if ([scrollerProtocol respondsToSelector:@selector(refreshType)] && -[[scrollerProtocol refreshType] isEqualToString:@"refreshForAppear"]) { -UIEdgeInsets inset = [scrollerProtocol contentInset]; -if (_displayState) {
[05/16] incubator-weex git commit: [WEEX-311] [iOS] use new layoutEngin to replace yoga
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b77b4259/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.cpp -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.cpp b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.cpp new file mode 100644 index 000..7d34d83 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Layout/WXCoreLayout.cpp @@ -0,0 +1,1038 @@ +#include "WXCoreLayout.h" + +using namespace WeexCore; + +namespace WeexCore { + + /** + * Entry function to calculate layout + */ + void WXCoreLayoutNode::calculateLayout(const std::pair) { +BFCs.clear(); +initFormatingContext(BFCs); +auto bfcDimension = calculateBFCDimension(renderPageSize); +if (std::get<0>(bfcDimension) || isDirty()) { + mChildrenFrozen.assign(getChildCount(kNonBFC), false); + measure(std::get<1>(bfcDimension), std::get<2>(bfcDimension), true); + checkSizeConstraints(this, false); +} +layout(mCssStyle->mMargin.getMargin(kMarginLeft), + mCssStyle->mMargin.getMargin(kMarginTop), + mCssStyle->mMargin.getMargin(kMarginLeft) + getLayoutWidth(), + mCssStyle->mMargin.getMargin(kMarginTop) + getLayoutHeight(), + false, ); +for (Index i = 0; i < getChildCount(kBFC); ++i) { + WXCoreLayoutNode *child = getChildAt(kBFC, i); + child->calculateLayout(renderPageSize); +} + } + + void WXCoreLayoutNode::initFormatingContext(std::vector ) { +NonBFCs.clear(); +for(auto it = ChildListIterBegin(); it != ChildListIterEnd(); it++) { + WXCoreLayoutNode* child = *it; + if (child != nullptr) { +if (isBFC(child)) { + BFCs.push_back(child); +} else { + NonBFCs.push_back(child); + child->initFormatingContext(BFCs); +} + } +} +reset(); + } + + std::tuple WXCoreLayoutNode::calculateBFCDimension(const std::pair & renderPageSize) { +bool sizeChanged = false; +float width = mCssStyle->mStyleWidth, height = mCssStyle->mStyleHeight; +std::pair ret; +if (isBFC(this)) { + ret = calculateBFCWidth(width, renderPageSize.first); + sizeChanged |=ret.first; + width = ret.second; + + ret = calculateBFCHeight(height,renderPageSize.second); + sizeChanged |=ret.first; + height = ret.second; +} +return std::make_tuple(sizeChanged, width, height); + } + + std::pair WXCoreLayoutNode::calculateBFCWidth(float width, const float renderPageWidth){ +bool sizeChanged = false; +if (isnan(width) && +mParent != nullptr && +!isnan(mCssStyle->mStylePosition.getPosition(kPositionEdgeLeft)) && +!isnan(mCssStyle->mStylePosition.getPosition(kPositionEdgeRight))) { + float containingBlockWidth = NAN; + switch (mCssStyle->mPositionType) { +case kAbsolute: + containingBlockWidth = mParent->mLayoutResult->mLayoutSize.width; + break; +case kFixed: + if (!isnan(renderPageWidth)) { +containingBlockWidth = renderPageWidth; + } + break; +default: + break; + } + if (!isnan(containingBlockWidth)) { +width = containingBlockWidth - +mCssStyle->mStylePosition.getPosition(kPositionEdgeLeft) - +mCssStyle->mStylePosition.getPosition(kPositionEdgeRight); +setWidthMeasureMode(kExactly); +sizeChanged = true; + } +} +return std::make_pair(sizeChanged, width); + } + + + std::pair WXCoreLayoutNode::calculateBFCHeight(float height, const float renderPageHeight){ +bool sizeChanged = false; +if (isnan(mCssStyle->mStyleHeight) && +mParent != nullptr && +!isnan(mCssStyle->mStylePosition.getPosition(kPositionEdgeTop)) && +!isnan(mCssStyle->mStylePosition.getPosition(kPositionEdgeBottom))) { + float containingBlockHeight = NAN; + switch (mCssStyle->mPositionType) { +case kAbsolute: + containingBlockHeight = mParent->mLayoutResult->mLayoutSize.height; + break; +case kFixed: + if (!isnan(renderPageHeight)) { +containingBlockHeight = renderPageHeight; + } + break; +default: + break; + } + if (!isnan(containingBlockHeight)) { +height = containingBlockHeight - +mCssStyle->mStylePosition.getPosition(kPositionEdgeTop) - +mCssStyle->mStylePosition.getPosition(kPositionEdgeBottom); +setHeightMeasureMode(kExactly); +sizeChanged = true; + } +} +return std::make_pair(sizeChanged, height); + } + + void WXCoreLayoutNode::measure(const float width, const float height, const bool hypotheticalMeasurment){ +if(hypotheticalMeasurment){ + //Only BFC will enter this case. + hypotheticalMeasure(width, height); +} + +
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184366574 --- Diff: ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m --- @@ -367,6 +400,11 @@ - (void)registerGlobalFunctions }]; [_jsBridge registerCallNativeComponent:^void(NSString *instanceId, NSString *componentRef, NSString *methodName, NSArray *args, NSDictionary *options) { + +#ifdef DEBUG +NSLog(@"test -> action: callNativeComponent ref:%@",componentRef); --- End diff -- NSLog ---
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184366659 --- Diff: ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m --- @@ -295,6 +318,9 @@ - (void)registerGlobalFunctions } WXPerformBlockOnComponentThread(^{ +#ifdef DEBUG +NSLog(@"test -> action :removeEvent ref:%@",ref); --- End diff -- Same NSLog ---
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184366382 --- Diff: ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm --- @@ -36,6 +37,10 @@ @implementation WXCellComponent - (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance { +#ifdef DEBUG +NSLog(@"test -> init Cell: ref:%@, styles:%@",ref,styles); --- End diff -- pay attention to NSLog and your log format ---
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184366221 --- Diff: ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm --- @@ -163,6 +164,11 @@ - (UIView *)loadView return [[WXTableView alloc] init]; } +//- (void)_insertChildCssNode:(WXComponent *)subcomponent atIndex:(NSInteger)index --- End diff -- if useless, just delete it ---
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184366095 --- Diff: ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm --- @@ -86,6 +97,9 @@ - (void)refresh if (!_refreshEvent || _displayState) { return; } +#ifdef DEBUG +NSLog(@"test -> refreshComponent : refresh ref:%@",self.ref); --- End diff -- please format the log, not the `test xxx`, do not using NSLog ---
[GitHub] incubator-weex pull request #1135: [WEEX-311] [iOS] use new layoutEngin to r...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1135#discussion_r184365906 --- Diff: ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm --- @@ -94,6 +108,9 @@ - (void)pullingdown:(NSDictionary*)param if (!_pullingdownEvent) { return ; } +#ifdef DEBUG +NSLog(@"test -> refreshComponent : pullingdown ,ref:%@",self.ref); --- End diff -- NSLog is not allowed to print ---
incubator-weex git commit: [WEEX-313][iOS]fix RTL issue
Repository: incubator-weex Updated Branches: refs/heads/master ae45df45e -> bf14bcdb5 [WEEX-313][iOS]fix RTL issue Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/bf14bcdb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/bf14bcdb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/bf14bcdb Branch: refs/heads/master Commit: bf14bcdb56c0d850d2f19b8d3bf994b839d75158 Parents: ae45df4 Author: KluezeAuthored: Thu Apr 26 17:58:45 2018 +0800 Committer: Klueze Committed: Thu Apr 26 17:59:31 2018 +0800 -- .../WeexSDK/Sources/Component/WXTextComponent.h | 1 + .../WeexSDK/Sources/Component/WXTextComponent.m | 4 +-- ios/sdk/WeexSDK/Sources/Layout/Layout.c | 2 ++ .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 38 ++-- 4 files changed, 7 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf14bcdb/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h index 1d98066..ebd8c7d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.h @@ -24,4 +24,5 @@ + (void)setRenderUsingCoreText:(BOOL)usingCoreText; - (BOOL)useCoreText; + @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf14bcdb/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m index 042f0a6..2a948e2 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m @@ -481,7 +481,7 @@ do {\ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; // handle text direction style, default ltr -if ([_direction isEqualToString:@"rtl"]) { +if (_cssNode->layout.direction == CSS_DIRECTION_RTL) { if (0 == _textAlign) { //force text right-align if don't specified any align. _textAlign = NSTextAlignmentRight; @@ -563,7 +563,7 @@ do {\ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; // handle text direction style, default ltr -if ([_direction isEqualToString:@"rtl"]) { +if (_cssNode->layout.direction == CSS_DIRECTION_RTL) { if (0 == _textAlign) { //force text right-align if don't specified any align. _textAlign = NSTextAlignmentRight; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf14bcdb/ios/sdk/WeexSDK/Sources/Layout/Layout.c -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/Layout.c b/ios/sdk/WeexSDK/Sources/Layout/Layout.c index 07b25cc..6e3214f 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/Layout.c +++ b/ios/sdk/WeexSDK/Sources/Layout/Layout.c @@ -1324,4 +1324,6 @@ void resetNodeLayout(css_node_t *node) { node->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; node->layout.position[CSS_LEFT] = 0; node->layout.position[CSS_TOP] = 0; + node->layout.position[CSS_RIGHT] = 0; + node->layout.position[CSS_BOTTOM] = 0; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf14bcdb/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m index b3907af..dcb2d80 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m @@ -37,30 +37,13 @@ - (void)setNeedsLayout { +_isLayoutDirty = YES; WXComponent *supercomponent = [self supercomponent]; -if (self->_virtualComponentId || self->_templateComponent) { -// we will generate a virtualComponentId for recycleList virtual component or templateComponent for recycleList component template. -// as for recyclelist component, it depends on the input data, not the new layout, here will not try to clear slibling child layout. -_isLayoutDirty = YES; +if(supercomponent){ [supercomponent setNeedsLayout]; -} else { -if(supercomponent){ -for (WXComponent *siblingComponent in [supercomponent subcomponents]) { -[siblingComponent _needRecalculateLayout]; -} -[supercomponent setNeedsLayout]; -} else { -[self
[GitHub] incubator-weex issue #1133: [WEEX-311] [iOS] use new layoutEngin to replace ...
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1133 please rebase your current branch and re-open the pull request ---
incubator-weex git commit: [WEEX-309][iOS] make javaScript runtime exception more accurate
Repository: incubator-weex Updated Branches: refs/heads/master 481a998bc -> ae45df45e [WEEX-309][iOS] make javaScript runtime exception more accurate close #1131 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ae45df45 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ae45df45 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ae45df45 Branch: refs/heads/master Commit: ae45df45e13cfee5ebd8fc2c0476b4cda6aaf2be Parents: 481a998 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Apr 26 10:30:38 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 15:19:40 2018 +0800 -- .../WeexSDK/Sources/Bridge/WXBridgeContext.m| 66 +++- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 11 ++-- .../Sources/Model/WXSDKInstance_private.h | 5 ++ 3 files changed, 63 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ae45df45/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m -- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index d545d96..b76ac90 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -47,6 +47,7 @@ #import "WXAppMonitorProtocol.h" #import "WXConfigCenterProtocol.h" #import "WXSDKInstance_performance.h" +#import "JSContext+Weex.h" #define SuppressPerformSelectorLeakWarning(Stuff) \ do { \ @@ -504,6 +505,7 @@ _Pragma("clang diagnostic pop") \ [sdkInstance.instanceJavaScriptContext executeJavascript:jsBundleString]; } } else { +sdkInstance.callCreateInstanceContext = [NSString stringWithFormat:@"instanceId:%@\noptions:%@\ndata:%@",instanceIdString, newOptions,data]; [self callJSMethod:@"createInstanceContext" args:@[instanceIdString, newOptions, data?:@[]] onContext:nil completion:^(JSValue *instanceContextEnvironment) { if (sdkInstance.pageName) { if (@available(iOS 8.0, *)) { @@ -512,6 +514,7 @@ _Pragma("clang diagnostic pop") \ // Fallback } } +sdkInstance.createInstanceContextResult = [NSString stringWithFormat:@"%@", [[instanceContextEnvironment toDictionary] allKeys]]; JSGlobalContextRef instanceContextRef = sdkInstance.instanceJavaScriptContext.javaScriptContext.JSGlobalContextRef; JSObjectRef instanceGlobalObject = JSContextGetGlobalObject(instanceContextRef); for (NSString * key in [[instanceContextEnvironment toDictionary] allKeys]) { @@ -534,10 +537,11 @@ _Pragma("clang diagnostic pop") \ if (raxAPIScript) { [sdkInstance.instanceJavaScriptContext executeJavascript:raxAPIScript withSourceURL:[NSURL URLWithString:raxAPIScriptPath]]; +sdkInstance.executeRaxApiResult = [NSString stringWithFormat:@"%@", [[sdkInstance.instanceJavaScriptContext.javaScriptContext.globalObject toDictionary] allKeys]]; } -if ([NSURL URLWithString:sdkInstance.pageName]) { -[sdkInstance.instanceJavaScriptContext executeJavascript:jsBundleString withSourceURL:[NSURL URLWithString:sdkInstance.pageName]]; +if ([NSURL URLWithString:sdkInstance.pageName] || sdkInstance.scriptURL) { +[sdkInstance.instanceJavaScriptContext executeJavascript:jsBundleString withSourceURL:[NSURL URLWithString:sdkInstance.pageName]?:sdkInstance.scriptURL]; } else { [sdkInstance.instanceJavaScriptContext executeJavascript:jsBundleString]; } @@ -907,20 +911,52 @@ _Pragma("clang diagnostic pop") \ }; context.exceptionHandler = ^(JSContext *context, JSValue *exception){ context.exception = exception; +NSString *errorCode = [NSString stringWithFormat:@"%d", WX_KEY_EXCEPTION_WXBRIDGE];; +NSString *bundleUrl = nil; +NSString *message = nil; +NSDictionary *userInfo = nil; +BOOL commitException = YES; +WXSDKInstance * instance = nil; +if ([WXSDKManager sharedInstance].multiContext) { +if (context.instanceId) { +// instance page javaScript runtime exception + instance = [WXSDKManager instanceForID:context.instanceId]; +if (instance) { +
incubator-weex git commit: [WEEX-305][iOS] support more performance point * [iOS] support more performance point [Forced Update!]
Repository: incubator-weex Updated Branches: refs/heads/master 4876bc4b0 -> 481a998bc (forced update) [WEEX-305][iOS] support more performance point * [iOS] support more performance point * [iOS] fix compile close #1129 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/481a998b Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/481a998b Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/481a998b Branch: refs/heads/master Commit: 481a998bc81ca78a7d91601519d64809d0ccfdd9 Parents: c31f7d2 Author: zhongcang <qh438406...@gmail.com> Authored: Wed Mar 28 13:25:07 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 14:28:45 2018 +0800 -- .../WeexDemo.xcodeproj/project.pbxproj | 10 +- ios/playground/WeexDemo/AppDelegate.m | 9 + ios/playground/WeexDemo/debug/DebugAnalyzer.h | 24 ++ ios/playground/WeexDemo/debug/DebugAnzlyzer.m | 30 +++ ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 50 +++- .../WeexSDK/Sources/Bridge/WXBridgeContext.m| 19 +- .../Sources/Component/WXImageComponent.m| 10 + ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h | 20 ++ ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m | 106 + .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 9 + .../WeexSDK/Sources/Manager/WXBridgeManager.m | 6 + .../Sources/Manager/WXComponentManager.m| 52 + .../WeexSDK/Sources/Manager/WXTracingManager.m | 2 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 7 + .../Sources/Model/WXSDKInstance_performance.h | 67 ++ .../Sources/Model/WXSDKInstance_performance.m | 35 +++ ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 6 + ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 6 + .../Sources/Monitor/WXAnalyzerCenter+Transfer.h | 15 ++ .../WeexSDK/Sources/Monitor/WXAnalyzerCenter.h | 16 ++ .../WeexSDK/Sources/Monitor/WXAnalyzerCenter.m | 234 +++ .../WeexSDK/Sources/Monitor/WXExceptionUtils.m | 5 + ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h | 27 +++ ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m | 75 -- .../Sources/Protocol/WXAnalyzerProtocol.h | 25 ++ .../Sources/Protocol/WXAppMonitorProtocol.h | 19 ++ ios/sdk/WeexSDK/Sources/View/WXRootView.h | 2 + ios/sdk/WeexSDK/Sources/View/WXRootView.m | 17 ++ ios/sdk/WeexSDK/Sources/WeexSDK.h | 2 + 29 files changed, 880 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/playground/WeexDemo.xcodeproj/project.pbxproj -- diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj index 674d57d..9721ca7 100644 --- a/ios/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 17C1DB57206B675D000E0CEB /* DebugAnzlyzer.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C1DB56206B675D000E0CEB /* DebugAnzlyzer.m */; }; 2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */; }; 564B94671DD9C65000441C8D /* WeexUITestDemo-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 564B94661DD9C65000441C8D /* WeexUITestDemo-Info.plist */; }; 59EA0DA71D2E7D19004F904A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 59EA0DA61D2E7D19004F904A /* Images.xcassets */; }; @@ -66,6 +67,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 17C1DB55206B6729000E0CEB /* DebugAnalyzer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DebugAnalyzer.h; path = debug/DebugAnalyzer.h; sourceTree = ""; }; + 17C1DB56206B675D000E0CEB /* DebugAnzlyzer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DebugAnzlyzer.m; path = debug/DebugAnzlyzer.m; sourceTree = ""; }; 1888E2C5769382461DEDC97D /* Pods-WeexUITestDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexUITestDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeexUITestDemo/Pods-WeexUITestDemo.release.xcconfig"; sourceTree = ""; }; 2278B1B1FCE894EDAF9F0171 /* Pods-WeexUITestDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexUITestDemo.debug.
[GitHub] incubator-weex pull request #1129: [WEEX-305][iOS] support more performance ...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1129#discussion_r184260545 --- Diff: ios/sdk/WeexSDK.xcodeproj/project.pbxproj --- @@ -2341,8 +2379,10 @@ DCA4456E1EFA55B300D0CFA8 /* WXModalUIModule.m in Sources */, DCA4456F1EFA55B300D0CFA8 /* WXWebViewModule.m in Sources */, DCA445701EFA55B300D0CFA8 /* WXCanvasModule.m in Sources */, + 170B4668208733E500562666 /* WXAnalyzerCenter.m in Sources */, DCA445711EFA55B300D0CFA8 /* WXMetaModule.m in Sources */, DCA445721EFA55B300D0CFA8 /* WXBoxShadow.m in Sources */, + 170B4666208733D200562666 /* (null) in Sources */, --- End diff -- null ï¼ ---
[GitHub] incubator-weex pull request #1129: [WEEX-305][iOS] support more performance ...
Github user acton393 commented on a diff in the pull request: https://github.com/apache/incubator-weex/pull/1129#discussion_r184259269 --- Diff: ios/sdk/WeexSDK.xcodeproj/project.pbxproj --- @@ -8,6 +8,21 @@ /* Begin PBXBuildFile section */ 042013AD1E66CD6A001FC79C /* WXValidateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 042013AC1E66CD6A001FC79C /* WXValidateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 170B4664208733AF00562666 /* WXAnalyzerCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 170B4665208733BF00562666 /* WXAnalyzerCenter+Transfer.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */; }; + 170B4666208733D200562666 /* (null) in Sources */ = {isa = PBXBuildFile; }; + 170B4667208733D800562666 /* (null) in Headers */ = {isa = PBXBuildFile; }; --- End diff -- what's `null ` in headers ---
incubator-weex git commit: [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. [Forced Update!]
Repository: incubator-weex Updated Branches: refs/heads/master 0e30c5081 -> c31f7d2a3 (forced update) [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Revert "[WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK." This reverts commit 32101169d4ff9dbe3549388c92739392420e9d4b. close #1130 [WEEX-306][ios] resolve the naming conflicts WXLogLevel Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel, to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. close #1130 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c31f7d2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c31f7d2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c31f7d2a Branch: refs/heads/master Commit: c31f7d2a3fccc7914c141055dd6f608a0771162c Parents: b4d8ecb Author: xionghuayu <xionghu...@benmu-health.com> Authored: Wed Apr 25 21:54:23 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 10:51:32 2018 +0800 -- ios/sdk/WeexSDK/Sources/Utility/WXLog.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c31f7d2a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h index 7922a70..b4ba21f 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h +++ b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h @@ -19,6 +19,8 @@ #import +#define WXLogLevel WeexLogLevel + typedef NS_ENUM(NSInteger, WXLogFlag) { WXLogFlagError = 1 << 0, WXLogFlagWarning= 1 << 1, @@ -30,7 +32,7 @@ typedef NS_ENUM(NSInteger, WXLogFlag) { /** * Use Log levels to filter logs. */ -typedef NS_ENUM(NSUInteger, WXLogLevel){ +typedef NS_ENUM(NSUInteger, WeexLogLevel){ /** * No logs */
incubator-weex git commit: [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK.
Repository: incubator-weex Updated Branches: refs/heads/master b4d8ecbb1 -> 0e30c5081 [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. [WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Revert "[WEEX-306][ios] resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK." This reverts commit 32101169d4ff9dbe3549388c92739392420e9d4b. close #1130 [WEEX-306][ios] resolve the naming conflicts WXLogLevel Note: Add the â#define WXLogLevel WeexLogLevelâ macro in the WXLog.h file and rename the WXLogLevel to WeexLogLevel, to resolve the naming conflicts between the WXLogLevel naming and the Wechat SDK. Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0e30c508 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0e30c508 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0e30c508 Branch: refs/heads/master Commit: 0e30c508143ff674915af60629e9cbb24245f963 Parents: b4d8ecb Author: xionghuayu <xionghu...@benmu-health.com> Authored: Wed Apr 25 21:54:23 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 10:49:11 2018 +0800 -- ios/sdk/WeexSDK/Sources/Utility/WXLog.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0e30c508/ios/sdk/WeexSDK/Sources/Utility/WXLog.h -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h index 7922a70..b4ba21f 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXLog.h +++ b/ios/sdk/WeexSDK/Sources/Utility/WXLog.h @@ -19,6 +19,8 @@ #import +#define WXLogLevel WeexLogLevel + typedef NS_ENUM(NSInteger, WXLogFlag) { WXLogFlagError = 1 << 0, WXLogFlagWarning= 1 << 1, @@ -30,7 +32,7 @@ typedef NS_ENUM(NSInteger, WXLogFlag) { /** * Use Log levels to filter logs. */ -typedef NS_ENUM(NSUInteger, WXLogLevel){ +typedef NS_ENUM(NSUInteger, WeexLogLevel){ /** * No logs */
[GitHub] incubator-weex issue #1130: [WEEX-306][ios] resolve the naming conflicts WXL...
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1130 @xiaohuapunk thanks for your contribution, this pull request will be accepted and will be merged on. As we will rebase and squash the pull request, this pull request will be closed by robots don't worry about it. ---
[GitHub] incubator-weex pull request #1131: [WEEX-309][iOS] make javaScript runtime e...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1131 [WEEX-309][iOS] make javaScript runtime exception more accurate You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex ios-jserror-format Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1131.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1131 commit 4008334df3f1d527a21ca41b25376215c929066d Author: acton393 <zhangxing610321@...> Date: 2018-04-26T02:30:38Z [WEEX-309][iOS] make javaScript runtime exception more accurate ---
[GitHub] incubator-weex issue #1130: [WEEX-306][ios] resolve the naming conflicts WXL...
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1130 hi @xiaohuapunk thanks for your contribution, it will be accepted, but you must pay more attention to your unnecessary file change, only commit the file you really update ---
incubator-weex git commit: [WEEX-303] [Android] fix nullPoint
Repository: incubator-weex Updated Branches: refs/heads/master 45be6cbb0 -> b4d8ecbb1 [WEEX-303] [Android] fix nullPoint close #1106 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b4d8ecbb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b4d8ecbb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b4d8ecbb Branch: refs/heads/master Commit: b4d8ecbb1fe1f7dbd7f1d70ef67a3915e231e92f Parents: 45be6cb Author: zhongcang <qh438406...@gmail.com> Authored: Tue Apr 10 15:01:05 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Wed Apr 25 15:41:55 2018 +0800 -- .../com/taobao/weex/bridge/WXBridgeManager.java | 9 ++-- .../taobao/weex/ui/module/WXTimerModule.java| 22 ++-- 2 files changed, 13 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b4d8ecbb/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java -- diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java index f931ccf..bb90f23 100644 --- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java +++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java @@ -58,6 +58,7 @@ import com.taobao.weex.dom.action.Actions; import com.taobao.weex.dom.action.TraceableAction; import com.taobao.weex.tracing.WXTracing; import com.taobao.weex.ui.WXComponentRegistry; +import com.taobao.weex.ui.component.WXComponent; import com.taobao.weex.utils.WXExceptionUtils; import com.taobao.weex.utils.WXFileUtils; import com.taobao.weex.utils.WXJsonUtils; @@ -2509,7 +2510,7 @@ public void invokeDestoryInstance(String instanceId, String namespace, String fu if (checkEmptyScreen(instance)){ if (WXEnvironment.isApkDebugable()){ - WXLogUtils.d("render error 4 js error !"); + WXLogUtils.e("render error 4 js error !"); } WXExceptionUtils.commitCriticalExceptionRT(exceptionId, WXErrorCode.WX_RENDER_ERR_JS_RUNTIME, function, @@ -2528,8 +2529,12 @@ public void invokeDestoryInstance(String instanceId, String namespace, String fu if (null == instance || instance.isDestroy()){ return false; } +WXComponent rootComponent = instance.getRootComponent(); +if (null == rootComponent) { + return true; +} -View rootView = instance.getRootView(); +View rootView = rootComponent.getRealView(); if (null == rootView){ return true; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b4d8ecbb/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java -- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java index 8745b54..2a29a29 100644 --- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java @@ -70,14 +70,9 @@ public class WXTimerModule extends WXModule implements Destroyable, Handler.Call public void setTimeout(@IntRange(from = 1) int funcId, @FloatRange(from = 0) float delay) { if(mWXSDKInstance != null) { postOrHoldMessage(MODULE_TIMEOUT, funcId, (int) delay, Integer.parseInt(mWXSDKInstance.getInstanceId())); - WXSDKManager.getInstance().postOnUiThread(new Runnable() { - @Override - public void run() { -if (null != mWXSDKInstance){ - mWXSDKInstance.getWXPerformance().timerInvokeCount++; -} - } - },0); + if (null != mWXSDKInstance.getWXPerformance()){ +mWXSDKInstance.getWXPerformance().timerInvokeCount++; + } } } @@ -85,14 +80,9 @@ public class WXTimerModule extends WXModule implements Destroyable, Handler.Call public void setInterval(@IntRange(from = 1) int funcId, @FloatRange(from = 0) float interval) { if(mWXSDKInstance != null) { postOrHoldMessage(MODULE_INTERVAL, funcId, (int) interval, Integer.parseInt(mWXSDKInstance.getInstanceId())); - WXSDKManager.getInstance().postOnUiThread(new Runnable() { - @Override - public void run() { -if (null != mWXSDKInstance){ - mWXSDKInstance.getWXPerformance().timerInvokeCount++; -} - } - },0); + if (null != mWXSDKInstance.getWXPerformance()){ +mWXSDKInstance.getWXPerformance().timerInvokeCount++; + } } }
incubator-weex git commit: [WEEX-301][iOS] WXImageComponent: set imageview in completion block
Repository: incubator-weex Updated Branches: refs/heads/master 1feea4c19 -> 45be6cbb0 [WEEX-301][iOS] WXImageComponent: set imageview in completion block close #1127 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/45be6cbb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/45be6cbb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/45be6cbb Branch: refs/heads/master Commit: 45be6cbb0a5518173dc878a19f5b5dd3c34e0052 Parents: 1feea4c Author: Xiayun <xiayun0...@163.com> Authored: Mon Apr 23 20:31:47 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Wed Apr 25 15:33:30 2018 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/45be6cbb/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index a27062d..6d602be 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -95,7 +95,6 @@ WX_EXPORT_METHOD(@selector(save:)) } [self configPlaceHolder:attributes]; _resizeMode = [WXConvert UIViewContentMode:attributes[@"resize"]]; -[self configFilter:styles]; _imageQuality = WXImageQualityNone; if (styles[@"quality"]) { @@ -113,6 +112,8 @@ WX_EXPORT_METHOD(@selector(save:)) _downloadImageWithURL = [WXConvert BOOL:attributes[@"compositing"]]; } +[self configFilter:styles needUpdate:NO]; + _imageSharp = [WXConvert WXImageSharp:styles[@"sharpen"]]; _imageLoadEvent = NO; _imageDownloadFinish = NO; @@ -128,7 +129,7 @@ WX_EXPORT_METHOD(@selector(save:)) } } -- (void)configFilter:(NSDictionary *)styles +- (void)configFilter:(NSDictionary *)styles needUpdate:(BOOL)needUpdate { if (styles[@"filter"]) { NSString *filter = styles[@"filter"]; @@ -145,7 +146,9 @@ WX_EXPORT_METHOD(@selector(save:)) NSString *matchString = [filter substringWithRange:matchRange]; if (matchString && matchString.length > 0) { _blurRadius = [matchString doubleValue]; -[self updateImage]; +if (needUpdate) { +[self updateImage]; +} } } } @@ -241,7 +244,7 @@ WX_EXPORT_METHOD(@selector(save:)) _imageSharp = [WXConvert WXImageSharp:styles[@"sharpen"]]; [self updateImage]; } -[self configFilter:styles]; +[self configFilter:styles needUpdate:YES]; } - (void)dealloc @@ -382,6 +385,10 @@ WX_EXPORT_METHOD(@selector(save:)) // log error message for error WXLogError(@"Error downloading image: %@, detail:%@", imageURL.absoluteString, [error localizedDescription]); } +UIImageView *imageView = (UIImageView *)strongSelf.view; +if (imageView && imageView.image != image) { +imageView.image = image; +} if (strongSelf.imageLoadEvent) { NSMutableDictionary *sizeDict = [NSMutableDictionary new]; sizeDict[@"naturalWidth"] = @0;
[incubator-weex] Git Push Summary [forced push!] [Forced Update!]
Repository: incubator-weex Updated Branches: refs/heads/master 27c558b0b -> 1feea4c19 (forced update)
incubator-weex git commit: * [iOS] add protection for iOS 8 crash about the bezierPath crash in nan or illegal input
Repository: incubator-weex Updated Branches: refs/heads/master 627f653a8 -> 1feea4c19 * [iOS] add protection for iOS 8 crash about the bezierPath crash in nan or illegal input Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1feea4c1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1feea4c1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1feea4c1 Branch: refs/heads/master Commit: 1feea4c19a58e75f778ce3f0d70643795f8ff8ae Parents: 627f653 Author: acton393 <zhangxing610...@gmail.com> Authored: Tue Apr 24 12:02:07 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue Apr 24 12:02:07 2018 +0800 -- ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1feea4c1/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m index f13c8b0..b7aa821 100644 --- a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m +++ b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m @@ -37,7 +37,11 @@ static const float kCircleControlPoint = 0.447715; // +--+ // \\ top // // \\+--+// -[path addLineToPoint:CGPointMake(CGRectGetMaxX(rect) - topRightRadius, rect.origin.y)]; +CGPoint topRightPoint = CGPointMake(CGRectGetMaxX(rect) - topRightRadius, rect.origin.y); +if (isnan(topRightPoint.x) || isnan(topRightPoint.y)) { +return path; +} +[path addLineToPoint:topRightPoint]; if (topRightRadius > 0) { [path addCurveToPoint:CGPointMake(CGRectGetMaxX(rect), rect.origin.y + topRightRadius) controlPoint1:CGPointMake(CGRectGetMaxX(rect) - topRightRadius * kCircleControlPoint, rect.origin.y)
incubator-weex git commit: [WEEX-298][IOS]fix WXIndicatorView invoke setNeedsDisplay not on main thread
Repository: incubator-weex Updated Branches: refs/heads/master 81c6f6d6d -> 627f653a8 [WEEX-298][IOS]fix WXIndicatorView invoke setNeedsDisplay not on main thread Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/627f653a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/627f653a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/627f653a Branch: refs/heads/master Commit: 627f653a8d859c3f8ab0e49022a5c680d64b18ec Parents: 81c6f6d Author: xuyouyang <youyang@alibaba-inc.com> Authored: Fri Apr 20 17:35:59 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue Apr 24 11:09:18 2018 +0800 -- .../Sources/Component/WXIndicatorComponent.m| 21 +++- 1 file changed, 16 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/627f653a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m index 4824d6e..c6b8486 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m @@ -20,6 +20,7 @@ #import "WXIndicatorComponent.h" #import "WXConvert.h" #import "WXSDKInstance.h" +#import "WXUtility.h" @implementation WXIndicatorView @@ -43,27 +44,35 @@ - (void)setPointCount:(NSInteger)pointCount { _pointCount = pointCount; -[self setNeedsDisplay]; +WXPerformBlockOnMainThread(^{ +[self setNeedsDisplay]; +}); } - (void)setCurrentPoint:(NSInteger)currentPoint { if (currentPoint < _pointCount && currentPoint >= 0) { _currentPoint = currentPoint; -[self setNeedsDisplay]; +WXPerformBlockOnMainThread(^{ +[self setNeedsDisplay]; +}); } } - (void)setPointSize:(CGFloat)pointSize { _pointSize = pointSize; -[self setNeedsDisplay]; +WXPerformBlockOnMainThread(^{ +[self setNeedsDisplay]; +}); } - (void)setPointSpace:(CGFloat)pointSpace { _pointSpace = pointSpace; -[self setNeedsDisplay]; +WXPerformBlockOnMainThread(^{ +[self setNeedsDisplay]; +}); } - (void)drawRect:(CGRect)rect @@ -203,7 +212,9 @@ } if (styleChange) { -[self setNeedsDisplay]; +WXPerformBlockOnMainThread(^{ +[self setNeedsDisplay]; +}); } }
incubator-weex git commit: *[iOS] bugfix about recycle-list component v-if directive
Repository: incubator-weex Updated Branches: refs/heads/master 7a8732b3e -> 81c6f6d6d *[iOS] bugfix about recycle-list component v-if directive Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/81c6f6d6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/81c6f6d6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/81c6f6d6 Branch: refs/heads/master Commit: 81c6f6d6d12049081c7d94dca41ed5aa8f2bde85 Parents: 7a8732b Author: acton393 <zhangxing610...@gmail.com> Authored: Mon Apr 23 12:07:47 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Mon Apr 23 12:07:47 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/81c6f6d6/ios/sdk/WeexSDK/Sources/Model/WXComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m index a454083..300dbc9 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m @@ -291,6 +291,7 @@ [self.supercomponent.view addSubview:self.view]; }); } +[self setNeedsLayout]; } }
incubator-weex git commit: * [iOS] try to fix the recycleList component introduced by #1105
Repository: incubator-weex Updated Branches: refs/heads/master d36a34c85 -> 7a8732b3e * [iOS] try to fix the recycleList component introduced by #1105 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7a8732b3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7a8732b3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7a8732b3 Branch: refs/heads/master Commit: 7a8732b3ef653a8e62da82e9787adee157ff9e53 Parents: d36a34c Author: acton393 <zhangxing610...@gmail.com> Authored: Fri Apr 20 16:42:51 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri Apr 20 16:42:51 2018 +0800 -- .../WeexSDK/Sources/Layout/WXComponent+Layout.m| 17 - 1 file changed, 12 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a8732b3/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m index db40bc0..aac8566 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m @@ -36,13 +36,20 @@ - (void)setNeedsLayout { WXComponent *supercomponent = [self supercomponent]; -if(supercomponent){ -for (WXComponent *siblingComponent in [supercomponent subcomponents]) { -[siblingComponent _needRecalculateLayout]; -} +if (self->_virtualComponentId || self->_templateComponent) { +// we will generate a virtualComponentId for recycleList virtual component or templateComponent for recycleList component template. +// as for recyclelist component, it depends on the input data, not the new layout, here will not try to clear slibling child layout. +_isLayoutDirty = YES; [supercomponent setNeedsLayout]; } else { -[self _needRecalculateLayout]; +if(supercomponent){ +for (WXComponent *siblingComponent in [supercomponent subcomponents]) { +[siblingComponent _needRecalculateLayout]; +} +[supercomponent setNeedsLayout]; +} else { +[self _needRecalculateLayout]; +} } }
incubator-weex git commit: add sdk products to git ignore and remove the start script running while the demo start
Repository: incubator-weex Updated Branches: refs/heads/master 14dbdc48a -> d36a34c85 add sdk products to git ignore and remove the start script running while the demo start Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d36a34c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d36a34c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d36a34c8 Branch: refs/heads/master Commit: d36a34c85f2765ff9b80d139218af9dc0792e408 Parents: 14dbdc4 Author: acton393 <zhangxing610...@gmail.com> Authored: Fri Apr 20 14:38:05 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri Apr 20 14:38:05 2018 +0800 -- ios/.gitignore| 2 ++ ios/playground/WeexDemo.xcodeproj/project.pbxproj | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d36a34c8/ios/.gitignore -- diff --git a/ios/.gitignore b/ios/.gitignore index 59dcf27..37ff31d 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -10,6 +10,8 @@ build/ _demo/ DerivedData +sdk/Products + ## Various settings *.pbxuser !default.pbxuser http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d36a34c8/ios/playground/WeexDemo.xcodeproj/project.pbxproj -- diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj index 7f7f31c..674d57d 100644 --- a/ios/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj @@ -504,7 +504,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n\nif [[ \"$CONFIGURATION\" = \"Debug\" && \"$PLATFORM_NAME\" != \"iphonesimulator\" ]]; then\nipconfig getifaddr en0 | awk '{printf(\"%s\",$0)}' > \"$DEST/localServer-ip.txt\"\nfi\n\nset -x\n\nif nc -w 5 -z localhost 12580 ; then\necho \"Port 12580 already in use, server is running\"\nelse\nif [ $BUILD_ENV = \"macaca\" ];then\necho \"you define auto test\"\n else\nopen -a Terminal \"$SRCROOT/../../start\"\nfi\nfi\n\n"; + shellScript = "DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n\nif [[ \"$CONFIGURATION\" = \"Debug\" && \"$PLATFORM_NAME\" != \"iphonesimulator\" ]]; then\nipconfig getifaddr en0 | awk '{printf(\"%s\",$0)}' > \"$DEST/localServer-ip.txt\"\nfi"; }; 84361D271CA10F8E00F43825 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase;
incubator-weex git commit: [WEEX-297][iOS] fix iOS 11 save image permission
Repository: incubator-weex Updated Branches: refs/heads/master 519dd89b8 -> 14dbdc48a [WEEX-297][iOS] fix iOS 11 save image permission Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/14dbdc48 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/14dbdc48 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/14dbdc48 Branch: refs/heads/master Commit: 14dbdc48aa49ceeec3e407cf0f796147079a187f Parents: 519dd89 Author: PhilAuthored: Fri Apr 20 11:20:00 2018 +0800 Committer: Phil Committed: Fri Apr 20 11:20:00 2018 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/14dbdc48/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 2cd2646..a27062d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -166,11 +166,11 @@ WX_EXPORT_METHOD(@selector(save:)) // iOS 11 needs a NSPhotoLibraryUsageDescription key for permission if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) { -if (!info[@"NSPhotoLibraryUsageDescription"]) { +if (!info[@"NSPhotoLibraryAddUsageDescription"]) { if (resultCallback) { resultCallback(@{ @"success" : @(false), - @"errorDesc": @"This maybe crash above iOS 10 because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data." + @"errorDesc": @"This maybe crash above iOS 11 because it attempted to save image without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data." }, NO); } return;
[GitHub] incubator-weex issue #1119: [WEEX-297][iOS] fix iOS 11 save image permission
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1119 I attach some documentation about the key https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW73 ---
[GitHub] incubator-weex issue #1119: [WEEX-297][iOS] fix iOS 11 save image permission
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1119 @PhilCai1993 thanks for your contribution , it will be accepted. ---
[GitHub] incubator-weex issue #1119: [WEEX-297][iOS] fix iOS 11 save image permission
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1119 hi thanks for your carefully finding the bug @PhilCai1993 you can rebase your branch to this repository master branch or just check out a new branch based on the master branch, I see another old change on this pull request. ---
incubator-weex git commit: move update context instanceId out
Repository: incubator-weex Updated Branches: refs/heads/master bf61e99c3 -> 519dd89b8 move update context instanceId out move update context instanceId out so that debug tool can update it Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/519dd89b Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/519dd89b Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/519dd89b Branch: refs/heads/master Commit: 519dd89b82b96c492674a44656a74209928115fc Parents: bf61e99 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Apr 19 20:24:51 2018 +0800 Committer: GitHub <nore...@github.com> Committed: Thu Apr 19 20:24:51 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/519dd89b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 19b9da8..50de348 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -140,7 +140,9 @@ typedef enum : NSUInteger { } _instanceJavaScriptContext = _debugJS ? [NSClassFromString(@"WXDebugger") alloc] : [[WXJSCoreBridge alloc] init]; - +if([_instanceJavaScriptContext respondsToSelector:@selector(setWeexInstanceId:)]) { +[_instanceJavaScriptContext setWeexInstanceId:_instanceId]; +} if(!_debugJS) { id jsBridge = [[WXSDKManager bridgeMgr] valueForKeyPath:@"bridgeCtx.jsBridge"]; JSContext* globalContex = jsBridge.javaScriptContext; @@ -154,11 +156,6 @@ typedef enum : NSUInteger { JSGlobalContextRelease(sandboxGlobalContextRef); [WXBridgeContext mountContextEnvironment:instanceContext]; [_instanceJavaScriptContext setJSContext:instanceContext]; - -if([_instanceJavaScriptContext respondsToSelector:@selector(setWeexInstanceId:)]) { -[_instanceJavaScriptContext setWeexInstanceId:_instanceId]; -} - [[NSNotificationCenter defaultCenter] postNotificationName:WX_INSTANCE_JSCONTEXT_CREATE_NOTIFICATION object:instanceContext]; }
[GitHub] incubator-weex pull request #1120: move update context instanceId out
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1120 move update context instanceId out move update context instanceId out so that debug tool can update it You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex patch-4 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1120.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1120 commit 519dd89b82b96c492674a44656a74209928115fc Author: acton393 <zhangxing610321@...> Date: 2018-04-19T12:24:51Z move update context instanceId out move update context instanceId out so that debug tool can update it ---
incubator-weex git commit: [WEEX-289][iOS]post notice when instance jscontext created * [iOS] bind instanceId to jscontext
Repository: incubator-weex Updated Branches: refs/heads/master cbfcf4ee4 -> bf61e99c3 [WEEX-289][iOS]post notice when instance jscontext created * [iOS] bind instanceId to jscontext close # Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/bf61e99c Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/bf61e99c Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/bf61e99c Branch: refs/heads/master Commit: bf61e99c3d8f82093d1c128d07ba894e99050b41 Parents: cbfcf4e Author: xuyouyang <youyang@alibaba-inc.com> Authored: Thu Apr 12 17:31:28 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 19 19:42:13 2018 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 12 +++ ios/sdk/WeexSDK/Sources/Bridge/JSContext+Weex.h | 26 +++ ios/sdk/WeexSDK/Sources/Bridge/JSContext+Weex.m | 35 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 2 ++ ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 10 +++--- ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 2 ++ ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 + 7 files changed, 84 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf61e99c/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index ecf9fa6..e698847 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -590,6 +590,10 @@ DCF0CD9E1EAF3A6B0062CA8F /* native-bundle-main.js in Resources */ = {isa = PBXBuildFile; fileRef = DCF0CD9D1EAF3A6B0062CA8F /* native-bundle-main.js */; }; DCF343671E49CAEE00A2FB34 /* WXJSExceptionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF343651E49CAEE00A2FB34 /* WXJSExceptionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCF343681E49CAEE00A2FB34 /* WXJSExceptionInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DCF343661E49CAEE00A2FB34 /* WXJSExceptionInfo.m */; }; + ED053500207F4DEB007B4568 /* JSContext+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = ED0534FE207F4DEB007B4568 /* JSContext+Weex.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ED053501207F4DEB007B4568 /* JSContext+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = ED0534FE207F4DEB007B4568 /* JSContext+Weex.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ED053502207F4DEB007B4568 /* JSContext+Weex.m in Sources */ = {isa = PBXBuildFile; fileRef = ED0534FF207F4DEB007B4568 /* JSContext+Weex.m */; }; + ED053503207F4DEB007B4568 /* JSContext+Weex.m in Sources */ = {isa = PBXBuildFile; fileRef = ED0534FF207F4DEB007B4568 /* JSContext+Weex.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -935,6 +939,8 @@ DCF0CD9D1EAF3A6B0062CA8F /* native-bundle-main.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "native-bundle-main.js"; path = "../../../../pre-build/native-bundle-main.js"; sourceTree = ""; }; DCF343651E49CAEE00A2FB34 /* WXJSExceptionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXJSExceptionInfo.h; sourceTree = ""; }; DCF343661E49CAEE00A2FB34 /* WXJSExceptionInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXJSExceptionInfo.m; sourceTree = ""; }; + ED0534FE207F4DEB007B4568 /* JSContext+Weex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JSContext+Weex.h"; sourceTree = ""; }; + ED0534FF207F4DEB007B4568 /* JSContext+Weex.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "JSContext+Weex.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1299,6 +1305,8 @@ 74AD99831D5B0E59008F0336 /* WXPolyfillSet.m */, 74862F771E02B88D00B7A041 /* JSValue+Weex.h */, 74862F781E02B88D00B7A041 /* JSValue+Weex.m */, + ED0534FE207F4DEB007B4568 /* JSContext+Weex.h */, + ED0534FF207F4DEB007B4568 /* JSContext+Weex.m */, ); path = Bridge; sourceTree = ""; @@ -1722,6 +1730,7 @@
incubator-weex git commit: * [iOS] fix compatible with .we logic in multicontext
Repository: incubator-weex Updated Branches: refs/heads/master 755d49acf -> cbfcf4ee4 * [iOS] fix compatible with .we logic in multicontext Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cbfcf4ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cbfcf4ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cbfcf4ee Branch: refs/heads/master Commit: cbfcf4ee49b4aa566ea8b9b2ac5d23a4d9298f26 Parents: 755d49a Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Apr 19 14:48:06 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 19 14:48:06 2018 +0800 -- ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cbfcf4ee/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m -- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index 8c54021..6e48a99 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -856,7 +856,7 @@ _Pragma("clang diagnostic pop") \ if ([tasks count] > 0 && execIns) { WXSDKInstance * execInstance = [WXSDKManager instanceForID:execIns]; -if (execInstance.instanceJavaScriptContext) { +if (execInstance.instanceJavaScriptContext && execInstance.bundleType) { [self callJSMethod:@"__WEEX_CALL_JAVASCRIPT__" args:@[execIns, tasks] onContext:execInstance.instanceJavaScriptContext completion:nil]; } else { [self callJSMethod:@"callJS" args:@[execIns, tasks]];
incubator-weex git commit: * [iOS] bugfix that waterfall component cannot scroll
Repository: incubator-weex Updated Branches: refs/heads/master a8de4388f -> 755d49acf * [iOS] bugfix that waterfall component cannot scroll Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/755d49ac Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/755d49ac Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/755d49ac Branch: refs/heads/master Commit: 755d49acfb3e6c1b7ce3708e528d7cb62571b76d Parents: a8de438 Author: acton393 <zhangxing610...@gmail.com> Authored: Wed Apr 18 22:40:48 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Wed Apr 18 22:40:48 2018 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/755d49ac/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m index f105444..5f197d1 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m @@ -196,7 +196,11 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) scrollView.showsHorizontalScrollIndicator = _showScrollBar; scrollView.scrollEnabled = _scrollable; scrollView.pagingEnabled = _pagingEnabled; -scrollView.bounces = _bounces; + +if (scrollView.bounces != _bounces) { +scrollView.bounces = _bounces; +} + if (_alwaysScrollableHorizontal) { scrollView.alwaysBounceHorizontal = [WXConvert BOOL:_alwaysScrollableHorizontal]; }
incubator-weex git commit: [WEEX-295] Rebuild transition's code and improve performance
Repository: incubator-weex Updated Branches: refs/heads/master 39c85a3e1 -> a8de4388f [WEEX-295] Rebuild transition's code and improve performance [WEEX-295] [iOS] Rebuild transition's code and improve performance close #1118 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/a8de4388 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a8de4388 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a8de4388 Branch: refs/heads/master Commit: a8de4388fea846d8f3ebcec441741dfeacc61db4 Parents: 39c85a3 Author: doumafang <doumaf...@gmail.com> Authored: Wed Apr 18 16:13:40 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Wed Apr 18 16:55:08 2018 +0800 -- .../WeexSDK/Sources/Module/WXAnimationModule.m | 18 +-- ios/sdk/WeexSDK/Sources/Module/WXTransition.h | 4 +- ios/sdk/WeexSDK/Sources/Module/WXTransition.m | 149 +++ 3 files changed, 95 insertions(+), 76 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a8de4388/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m index 9d5812d..a619166 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m @@ -305,11 +305,11 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) - (void)animationWithTransitionTarget:(WXComponent *)target handleProperty:(NSString *)property withDic:(NSDictionary *)args { NSDictionary *styles = args[@"styles"]; -_transition.addStyles = [NSMutableDictionary dictionaryWithDictionary:styles]; -_transition.fromStyles =_transition.fromStyles ? :[NSMutableDictionary dictionaryWithDictionary:target.styles] ; -[_transition.fromStyles setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; -[_transition.fromStyles setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay]; -NSString *oldProperty = _transition.fromStyles[kWXTransitionProperty]; +_transition.filterStyles = [NSMutableDictionary dictionaryWithDictionary:styles]; +_transition.oldFilterStyles =_transition.oldFilterStyles ? :[NSMutableDictionary dictionaryWithDictionary:target.styles] ; +[_transition.oldFilterStyles setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration]; +[_transition.oldFilterStyles setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay]; +NSString *oldProperty = _transition.oldFilterStyles[kWXTransitionProperty]; NSString *newProperty; if (oldProperty) { if ([oldProperty containsString:property]) { @@ -324,11 +324,11 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) { newProperty = property; } -[_transition.fromStyles setObject:newProperty forKey:kWXTransitionProperty]; -[_transition.fromStyles setObject:args[@"timingFunction"] forKey:kWXTransitionTimingFunction]; +[_transition.oldFilterStyles setObject:newProperty forKey:kWXTransitionProperty]; +[_transition.oldFilterStyles setObject:args[@"timingFunction"] forKey:kWXTransitionTimingFunction]; [target _modifyStyles:styles]; - } + - (void)animation:(WXComponent *)targetComponent args:(NSDictionary *)args callback:(WXModuleKeepAliveCallback)callback { /** @@ -361,7 +361,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:)) [CATransaction commit]; if (_needLayout) { WXPerformBlockOnComponentThread(^{ -[_transition _handleTransitionWithStyles:_transition.addStyles resetStyles:nil target:targetComponent]; +[_transition _handleTransitionWithStyles:_transition.filterStyles resetStyles:nil target:targetComponent]; }); } } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a8de4388/ios/sdk/WeexSDK/Sources/Module/WXTransition.h -- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTransition.h b/ios/sdk/WeexSDK/Sources/Module/WXTransition.h index b832e3e..92ea0cf 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTransition.h +++ b/ios/sdk/WeexSDK/Sources/Module/WXTransition.h @@ -46,8 +46,8 @@ typedef NS_OPTIONS(NSUInteger, WXTransitionOptions) { @end @interface WXTransition : NSObject -@property(nonatomic,strong) NSMutableDictionary *fromStyles; -@property(nonatomic,strong) NSMutableDictionary *addStyles; +@property(nonatomic,strong) NSMutableDictionary *oldFilterStyles; +@property(nonatomic,strong) NSMutableDictionary *filterStyles; @
incubator-weex git commit: [WEEX-292][iOS] enable zIndex in cell component * [iOS] config zIndex of cell component
Repository: incubator-weex Updated Branches: refs/heads/master ea2e12f94 -> 39c85a3e1 [WEEX-292][iOS] enable zIndex in cell component * [iOS] config zIndex of cell component * [iOS] support bounce for scrollerview close #1116 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/39c85a3e Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/39c85a3e Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/39c85a3e Branch: refs/heads/master Commit: 39c85a3e140a69763b50bccfb6a57612d6c0f132 Parents: ea2e12f Author: acton393 <zhangxing610...@gmail.com> Authored: Sun Apr 8 10:56:36 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Wed Apr 18 10:24:22 2018 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h | 1 + ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m | 3 +++ ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 4 ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 7 +++ 4 files changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h index fbae1d1..923af9d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.h @@ -44,5 +44,6 @@ @property (nonatomic, assign) UITableViewRowAnimation deleteAnimation; @property (nonatomic, assign) BOOL keepScrollPosition; @property (nonatomic, weak) id delegate; +@property (nonatomic, strong) NSString *zIndex; @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m index 07621c7..b8feb31 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m @@ -46,6 +46,9 @@ _keepScrollPosition = attributes[@"keepScrollPosition"] ? [WXConvert BOOL:attributes[@"keepScrollPosition"]] : NO; _lazyCreateView = YES; _isNeedJoinLayoutSystem = NO; +if (attributes[@"zIndex"]) { +_zIndex = [WXConvert NSString:attributes[@"zIndex"]]; +} } return self; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m index 39473e9..d73531c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m @@ -705,6 +705,10 @@ WXCellComponent *cell = [self cellForIndexPath:indexPath]; +if (cell.zIndex) { +cellView.layer.zPosition = [WXConvert CGFloat:cell.zIndex]; +} + if (!cell) { return cellView; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/39c85a3e/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m index 11aab36..f105444 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m @@ -82,6 +82,7 @@ BOOL _scrollable; NSString * _alwaysScrollableVertical; NSString * _alwaysScrollableHorizontal; +BOOL _bounces; // refreshForAppear: load more when refresh component begin appear(if scroll is dragging or decelerating, should delay) // refreshForWholeVisible: load more until the whole refresh component visible @@ -146,6 +147,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) if (attributes[@"alwaysScrollableHorizontal"]) { _alwaysScrollableHorizontal = [WXConvert NSString:attributes[@"alwaysScrollableHorizontal"]]; } +_bounces = attributes[@"bounce"]?[WXConvert BOOL:attributes[@"bounce"]]:YES; _refreshType = [WXConvert NSString:attributes[@"refreshType"]]?:@"refreshForWholeVisible"; _pagingEnabled = attributes[@"pagingEnabled"] ? [WXConvert BOOL:attributes[@"pag
[GitHub] incubator-weex pull request #1116: [WEEX-292][iOS] enable zIndex in cell com...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1116 [WEEX-292][iOS] enable zIndex in cell component try case : http://dotwe.org/vue/f26b12353bfa77858cdd6fb28c00c296 You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex ios-feature-z-order-test Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1116.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1116 commit ee95a400ccf8eb0d5b5fe5e2ec617dc56a352274 Author: acton393 <zhangxing610321@...> Date: 2018-04-08T02:56:36Z * [iOS] config zIndex of cell component commit bbae4184a2a3ee0ce21798463d10a196f22da5ea Author: acton393 <zhangxing610321@...> Date: 2018-04-17T02:41:26Z * [iOS] support bounce for scrollerview ---
incubator-weex git commit: * [iOS] add missing md5 value and content-length for jsbundle
Repository: incubator-weex Updated Branches: refs/heads/master de14e0d2c -> ea2e12f94 * [iOS] add missing md5 value and content-length for jsbundle Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ea2e12f9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ea2e12f9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ea2e12f9 Branch: refs/heads/master Commit: ea2e12f943a4c167f6d5b9659e8b90515ec63aa5 Parents: de14e0d Author: acton393 <zhangxing610...@gmail.com> Authored: Mon Apr 16 18:11:03 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Mon Apr 16 18:11:03 2018 +0800 -- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 9 + 1 file changed, 9 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ea2e12f9/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 102b408..5c4063e 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -242,6 +242,15 @@ typedef enum : NSUInteger { [jsExceptionHandler onRuntimeCheckException:runtimeCheckException]; } } +if (!self.userInfo) { +self.userInfo = [NSMutableDictionary new]; +} +if (!self.userInfo[@"jsMainBundleStringContentLength"]) { +self.userInfo[@"jsMainBundleStringContentLength"] = @([mainBundleString length]); +} +if (!self.userInfo[@"jsMainBundleStringContentLength"]) { +self.userInfo[@"jsMainBundleStringContentMd5"] = [WXUtility md5:mainBundleString]; +} WX_MONITOR_INSTANCE_PERF_START(WXPTFirstScreenRender, self); WX_MONITOR_INSTANCE_PERF_START(WXPTAllRender, self);
incubator-weex git commit: add recyclerComponent.h public
Repository: incubator-weex Updated Branches: refs/heads/master 6f1e70e8a -> de14e0d2c add recyclerComponent.h public Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/de14e0d2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/de14e0d2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/de14e0d2 Branch: refs/heads/master Commit: de14e0d2c34614a16f42070da46ad3f0b5e035c6 Parents: 6f1e70e Author: xiayun200825Authored: Sat Apr 14 12:35:24 2018 +0800 Committer: xiayun200825 Committed: Sat Apr 14 12:35:24 2018 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 8 ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/de14e0d2/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index 1ae188f..ecf9fa6 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -125,7 +125,7 @@ 744D61151E4AF23E00B624B3 /* WXDiffUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 744D61131E4AF23E00B624B3 /* WXDiffUtil.m */; }; 745B2D681E5A8E1E0092D38A /* WXMultiColumnLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D5E1E5A8E1E0092D38A /* WXMultiColumnLayout.h */; }; 745B2D691E5A8E1E0092D38A /* WXMultiColumnLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D5F1E5A8E1E0092D38A /* WXMultiColumnLayout.m */; }; - 745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; }; + 745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 745B2D6B1E5A8E1E0092D38A /* WXRecyclerComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D611E5A8E1E0092D38A /* WXRecyclerComponent.m */; }; 745B2D6C1E5A8E1E0092D38A /* WXRecyclerDataController.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D621E5A8E1E0092D38A /* WXRecyclerDataController.h */; }; 745B2D6D1E5A8E1E0092D38A /* WXRecyclerDataController.m in Sources */ = {isa = PBXBuildFile; fileRef = 745B2D631E5A8E1E0092D38A /* WXRecyclerDataController.m */; }; @@ -498,7 +498,7 @@ DCA445D81EFA599400D0CFA8 /* WXRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 74B8BEFC1DC47B72004A6027 /* WXRootView.h */; }; DCA445D91EFA59A100D0CFA8 /* WXEditComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = C4B3D6D21E6954300013F38D /* WXEditComponent.h */; }; DCA445DA1EFA59A600D0CFA8 /* WXMultiColumnLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D5E1E5A8E1E0092D38A /* WXMultiColumnLayout.h */; }; - DCA445DB1EFA59AA00D0CFA8 /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; }; + DCA445DB1EFA59AA00D0CFA8 /* WXRecyclerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D601E5A8E1E0092D38A /* WXRecyclerComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445DC1EFA59AD00D0CFA8 /* WXRecyclerDataController.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D621E5A8E1E0092D38A /* WXRecyclerDataController.h */; }; DCA445DD1EFA59B300D0CFA8 /* WXRecyclerUpdateController.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D641E5A8E1E0092D38A /* WXRecyclerUpdateController.h */; }; DCA445DE1EFA59B800D0CFA8 /* WXSectionDataController.h in Headers */ = {isa = PBXBuildFile; fileRef = 745B2D661E5A8E1E0092D38A /* WXSectionDataController.h */; }; @@ -1628,6 +1628,7 @@ 2A837AB21CD9DE9200AEDF03 /* WXLoadingComponent.h in Headers */, DCA446271EFA5DAF00D0CFA8 /* WeexSDK.h in Headers */, 841CD1051F974DFA0081196D /* WXExceptionUtils.h in Headers */, + 745B2D6A1E5A8E1E0092D38A /* WXRecyclerComponent.h in Headers */, C42E8F9B1F39DF07001EBE9D /* WXTracingProtocol.h in Headers */, 7423899F1C32733800D748CA /* WXType.h in Headers */, 59A582FC1CF5B17B0081FD3E /* WXBridgeContext.h in Headers */, @@ -1635,7 +1636,6 @@
incubator-weex git commit: remove canvas dependency for playground app
Repository: incubator-weex Updated Branches: refs/heads/master e5e849302 -> 6f1e70e8a remove canvas dependency for playground app remove canvas dependency for playground app Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6f1e70e8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6f1e70e8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6f1e70e8 Branch: refs/heads/master Commit: 6f1e70e8a328f09ca0d1350f2ed5aefa35379d71 Parents: e5e8493 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Apr 12 20:52:55 2018 +0800 Committer: GitHub <nore...@github.com> Committed: Thu Apr 12 20:52:55 2018 +0800 -- ios/playground/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6f1e70e8/ios/playground/Podfile -- diff --git a/ios/playground/Podfile b/ios/playground/Podfile index 45522d3..77acced 100644 --- a/ios/playground/Podfile +++ b/ios/playground/Podfile @@ -10,7 +10,7 @@ def common pod 'ATSDK-Weex', '0.0.1',:configurations => ['Debug'] # WeexGcanvas is added by Weex Plugin, more info at https://market.dotwe.org/ext/list.htm -pod 'WeexGcanvas' +#pod 'WeexGcanvas' end target 'WeexDemo' do
[GitHub] incubator-weex pull request #1112: remove canvas dependency for playground a...
GitHub user acton393 opened a pull request: https://github.com/apache/incubator-weex/pull/1112 remove canvas dependency for playground app remove canvas dependency for playground app You can merge this pull request into a Git repository by running: $ git pull https://github.com/acton393/incubator-weex patch-3 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-weex/pull/1112.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1112 commit 6f1e70e8a328f09ca0d1350f2ed5aefa35379d71 Author: acton393 <zhangxing610321@...> Date: 2018-04-12T12:52:55Z remove canvas dependency for playground app remove canvas dependency for playground app ---
[1/2] incubator-weex git commit: [WEEX-282][iOS] update layout system to support rtl direction
Repository: incubator-weex Updated Branches: refs/heads/master fdf7669c4 -> e5cad8e12 [WEEX-282][iOS] update layout system to support rtl direction Modified WXComponent+Layout.m: 1.set direction value to cssNode 2.setNeedLayout changed to trigger sibling component recalculate cssNode->layout Modified WXConvert.h/m: add convert for "direction" Modified WXConvertTests.m: add Tests for convert direction Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/487b6924 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/487b6924 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/487b6924 Branch: refs/heads/master Commit: 487b6924c9d200c315c96104c49f5f718aae0c5a Parents: bb29077 Author: KluezeAuthored: Sun Apr 8 17:37:00 2018 +0800 Committer: Klueze Committed: Mon Apr 9 11:31:08 2018 +0800 -- .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 31 +++- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 1 + ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 14 + ios/sdk/WeexSDKTests/WXConvertTests.m | 8 + 4 files changed, 53 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/487b6924/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m -- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m index 44aef1c..db40bc0 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m @@ -35,13 +35,23 @@ - (void)setNeedsLayout { -_isLayoutDirty = YES; WXComponent *supercomponent = [self supercomponent]; if(supercomponent){ +for (WXComponent *siblingComponent in [supercomponent subcomponents]) { +[siblingComponent _needRecalculateLayout]; +} [supercomponent setNeedsLayout]; +} else { +[self _needRecalculateLayout]; } } +- (void)_needRecalculateLayout +{ +_isLayoutDirty = YES; +[self _clearLayoutCSS]; +} + - (BOOL)needsLayout { return _isLayoutDirty; @@ -208,6 +218,23 @@ [self layoutDidFinish]; } +/** + * clear the layout variables on css node + **/ +- (void)_clearLayoutCSS { +memset(&(_cssNode->layout), 0, sizeof(_cssNode->layout)); +_cssNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED; +_cssNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; + +// Such that the comparison is always going to be false +_cssNode->layout.last_requested_dimensions[CSS_WIDTH] = -1; +_cssNode->layout.last_requested_dimensions[CSS_HEIGHT] = -1; +_cssNode->layout.last_parent_max_width = -1; +_cssNode->layout.last_parent_max_height = -1; +_cssNode->layout.last_direction = (css_direction_t)-1; +_cssNode->layout.should_update = true; +} + #define WX_STYLE_FILL_CSS_NODE(key, cssProp, type)\ do {\ id value = styles[@#key];\ @@ -248,6 +275,7 @@ do {\ - (void)_fillCSSNode:(NSDictionary *)styles { +WX_STYLE_FILL_CSS_NODE(direction, direction, css_direction_t) // flex WX_STYLE_FILL_CSS_NODE(flex, flex, CGFloat) WX_STYLE_FILL_CSS_NODE(flexDirection, flex_direction, css_flex_direction_t) @@ -311,6 +339,7 @@ do {\ - (void)_resetCSSNode:(NSArray *)styles; { +WX_STYLE_RESET_CSS_NODE(direction, direction, CSS_DIRECTION_LTR) // flex WX_STYLE_RESET_CSS_NODE(flex, flex, 0.0) WX_STYLE_RESET_CSS_NODE(flexDirection, flex_direction, CSS_FLEX_DIRECTION_COLUMN) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/487b6924/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h index 25c6430..775fa05 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h +++ b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.h @@ -40,6 +40,7 @@ typedef CGFloat WXPixelType; // @parameter scaleFactor: please use weexInstance's pixelScaleFactor property + (WXPixelType)WXPixelType:(id)value scaleFactor:(CGFloat)scaleFactor; ++ (css_direction_t)css_direction_t:(id)value; + (css_flex_direction_t)css_flex_direction_t:(id)value; + (css_align_t)css_align_t:(id)value; + (css_wrap_type_t)css_wrap_type_t:(id)value; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/487b6924/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m b/ios/sdk/WeexSDK/Sources/Utility/WXConvert.m index f7e82f6..2744e60
[GitHub] incubator-weex issue #1105: [WEEX-282][iOS] update layout system to support ...
Github user acton393 commented on the issue: https://github.com/apache/incubator-weex/pull/1105 @win80540 thanks for you contribution ---
[2/2] incubator-weex git commit: Merge branch 'ios-feature-RTL-layout' of https://github.com/win80540/incubator-weex into merge-pull-request-master
Merge branch 'ios-feature-RTL-layout' of https://github.com/win80540/incubator-weex into merge-pull-request-master Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e5cad8e1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e5cad8e1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e5cad8e1 Branch: refs/heads/master Commit: e5cad8e1211db18c39326b7be9ee69b74a8fdc25 Parents: fdf7669 487b692 Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Apr 12 14:25:02 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 12 14:25:02 2018 +0800 -- .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 31 +++- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 1 + ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 14 + ios/sdk/WeexSDKTests/WXConvertTests.m | 8 + 4 files changed, 53 insertions(+), 1 deletion(-) --
incubator-weex git commit: [WEEX-286][iOS] try to resolve the crash of dyld_stub_binder
Repository: incubator-weex Updated Branches: refs/heads/master 080807289 -> fdf7669c4 [WEEX-286][iOS] try to resolve the crash of dyld_stub_binder Bug: 286 close #1109 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fdf7669c Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fdf7669c Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fdf7669c Branch: refs/heads/master Commit: fdf7669c48a2945d0c14327e56c3f410882af865 Parents: 0808072 Author: acton393 <zhangxing610...@gmail.com> Authored: Wed Apr 11 10:45:34 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 12 13:08:12 2018 +0800 -- .../Sources/Utility/WXThreadSafeMutableArray.m | 112 +-- .../Utility/WXThreadSafeMutableDictionary.m | 104 + 2 files changed, 52 insertions(+), 164 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fdf7669c/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m -- diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m index 3a26275..b1724af 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableArray.m @@ -25,7 +25,6 @@ @interface WXThreadSafeMutableArray () { pthread_mutex_t _safeThreadArrayMutex; pthread_mutexattr_t _safeThreadArrayMutexAttr; -os_unfair_lock _osUnfairLock; } @property (nonatomic, strong) dispatch_queue_t queue; @@ -44,9 +43,6 @@ pthread_mutexattr_init(&(_safeThreadArrayMutexAttr)); pthread_mutexattr_settype(&(_safeThreadArrayMutexAttr), PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&(_safeThreadArrayMutex), &(_safeThreadArrayMutexAttr)); -if (WX_SYS_VERSION_GREATER_THAN(@"10.0")) { -_osUnfairLock = OS_UNFAIR_LOCK_INIT; -} } return self; } @@ -107,15 +103,9 @@ count = _array.count; }); } else { -if (WX_SYS_VERSION_GREATER_THAN(@"10.0")) { -os_unfair_lock_lock(&_osUnfairLock); -count = [_array count]; -os_unfair_lock_unlock(&_osUnfairLock); -} else { -pthread_mutex_lock(&_safeThreadArrayMutex); -count = [_array count]; -pthread_mutex_unlock(&_safeThreadArrayMutex); -} +pthread_mutex_lock(&_safeThreadArrayMutex); +count = [_array count]; +pthread_mutex_unlock(&_safeThreadArrayMutex); } return count; } @@ -128,15 +118,9 @@ obj = _array[index]; }); } else { -if (WX_SYS_VERSION_GREATER_THAN(@"10.0")) { -os_unfair_lock_lock(&_osUnfairLock); -obj = _array[index]; -os_unfair_lock_unlock(&_osUnfairLock); -} else { -pthread_mutex_lock(&_safeThreadArrayMutex); -obj = _array[index]; -pthread_mutex_unlock(&_safeThreadArrayMutex); -} +pthread_mutex_lock(&_safeThreadArrayMutex); +obj = _array[index]; +pthread_mutex_unlock(&_safeThreadArrayMutex); } return obj; } @@ -149,15 +133,9 @@ enu = [_array objectEnumerator]; }); } else { -if (WX_SYS_VERSION_GREATER_THAN(@"10.0")) { -os_unfair_lock_lock(&_osUnfairLock); -enu = [_array objectEnumerator]; -os_unfair_lock_unlock(&_osUnfairLock); -} else { -pthread_mutex_lock(&_safeThreadArrayMutex); -enu = [_array objectEnumerator]; -pthread_mutex_unlock(&_safeThreadArrayMutex); -} +pthread_mutex_lock(&_safeThreadArrayMutex); +enu = [_array objectEnumerator]; +pthread_mutex_unlock(&_safeThreadArrayMutex); } return enu; } @@ -169,15 +147,9 @@ [_array insertObject:anObject atIndex:index]; }); } else { -if (WX_SYS_VERSION_GREATER_THAN(@"10.0")) { -os_unfair_lock_lock(&_osUnfairLock); -[_array insertObject:anObject atIndex:index]; -os_unfair_lock_unlock(&_osUnfairLock); -} else { -pthread_mutex_lock(&_safeThreadArrayMutex); -[_array insertObject:anObject atIndex:index]; -pthread_mutex_unlock(&_safeThreadArrayMutex); -} +pthread_mutex_lock(&_safeThreadArrayMutex); +[_array insertObject:anObject atIndex:index]; +pthread_mutex_unlock(&
[4/5] incubator-weex git commit: [WEEX-240][iOS] support sandbox on iOS * [iOS] bugfix bridgeManger mutli instance
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08080728/pre-build/native-bundle-main.js -- diff --git a/pre-build/native-bundle-main.js b/pre-build/native-bundle-main.js index fa6fdde..307922d 100644 --- a/pre-build/native-bundle-main.js +++ b/pre-build/native-bundle-main.js @@ -1,2 +1,2 @@ (this.nativeLog||function(e){console.log(e)})("START JS FRAMEWORK 0.24.4, Build 2018-02-07 17:13. (Vue: 2.5.13-weex.5, Rax: 0.4.20)");var global=this,process={env:{}},setTimeout=global.setTimeout;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&?define(t):t()}(0,function(){"use strict";var e,t,n,r;function o(e){return e&__esModule&(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}Array.from||(Array.from=(e=Object.prototype.toString,t=function(t){return"function"==typeof t||"[object Function]"===e.call(t)},n=Math.pow(2,53)-1,r=function(e){var t,r=(t=Number(e),isNaN(t)?0:0!==t&(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t);return Math.min(Math.max(r,0),n)},function(e){var n=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,i=arguments.length>1?arguments[1]:void 0;if(void 0!==i){if(! t(i))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var a,s=r(n.length),u=t(this)?Object(new this(s)):new Array(s),c=0;c0?F:D)(e)},V=Math.min,W=function(e){return e>0?V(L(e),9007199254740991):0},U=Math.max,B=Math.min,q="__core-js_shared__",J=a[q]||(a[q]={}),z=function(e){return J[e]||(J[e]={})},H=z("keys"),G=function(e){return H[e]||(H[e]=k(e))},X=(I=!1,function(e,t,n){var
[2/5] incubator-weex git commit: [WEEX-240][iOS] support sandbox on iOS * [iOS] bugfix bridgeManger mutli instance
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/08080728/pre-build/weex-polyfill.js -- diff --git a/pre-build/weex-polyfill.js b/pre-build/weex-polyfill.js new file mode 100644 index 000..21a3611 --- /dev/null +++ b/pre-build/weex-polyfill.js @@ -0,0 +1,2 @@ +var global=this,process={env:{}};!function(){"use strict";var n,a,r,s;function t(t,n){return t(n={exports:{}},n.exports),n.exports}Array.from||(Array.from=(n=Object.prototype.toString,a=function(t){return"function"==typeof t||"[object Function]"===n.call(t)},r=Math.pow(2,53)-1,s=function(t){var n,e=(n=Number(t),isNaN(n)?0:0!==n&(n)?(0