[ALOY-635] Styles not being sorted properly among global, controller, platform-specific, and theme
|Fix Version/s||Alloy 1.2.0, Alloy 1.1.2, 2013 Sprint 09|
DescriptionOriginally mentioned in this gist: https://gist.github.com/stevenscg/5438481 Essentially what was happening is that the "order" of each style was being reset each time a global, controller, platform, or theme style was being processed, inadvertantly allowing lower priority styles to be sorted ahead of others. Maintaining the "order" throughout the course of a controller's style processing would solve this issue.
- Tony Lukasavage 2013-04-24 There still exists a minor issue with the sorting of global styles. In an effort to increase compile speed, the global style is cached after it is built once and then used in conjunction with all other controller-specific controllers to generate the final style. Unfortunately, when the global style is cached its "order" is also cached, meaning that styles of equal precedence in the global style can sometimes overwrite those in a controller-specific style, which should never happen. The base of the "order" counting needs to start at the highest "order" of the global style, plus 1.
- Tony Lukasavage 2013-04-24
Verification test case in the test apps at testing/ALOY-635.
If run against Alloy 1.1.1 the text printed in the app will say:
jake app:run dir=testing/ALOY-635
When testing the fix with 1.1.2, though, you'll get the appropriate text that says:
global style merging is broken if you see this text in your app
you should see this text
- Tony Lukasavage 2013-04-25 test app link: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-635
- Tony Lukasavage 2013-04-29 Also, got a confirmation from the community that the 1.1.2-alpha has solved the style processing issue: http://developer.appcelerator.com/question/151717/issues-in-using-class-styles-with-alloy-in-latest-alloy-update
- Federico Casali 2013-05-01 Verified as fixed with Alloy version 1.1.2-alpha, SDK 3.1.0 GA iPhone 5 Android Nexus 4 Sample code: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-635
- Paras Mishra 2013-05-01 Working as expected. Verified on: Tested on: Device: Samsung Galaxy Note, Android version: 2.3.6 Device : iPad 2, iOS version: 5.1 Alloy verison: 1.1.2-alpha SDK: 3.1.1.v20130430164508 CLI version : 3.1.0 OS : MAC OSX 10.7.5 Appcelerator Studio, build: 188.8.131.52304281117 XCode : 4.5.1