[ALOY-635] Styles not being sorted properly among global, controller, platform-specific, and theme
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-24T20:53:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, Alloy 1.1.2, 2013 Sprint 09 |
Components | Runtime, XML |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2013-04-22T22:29:22.000+0000 |
Updated | 2013-05-01T14:56:31.000+0000 |
Description
Originally 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.
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.
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:
When testing the fix with 1.1.2, though, you'll get the appropriate text that says:
test app link: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-635
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
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
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: 3.1.0.201304281117 XCode : 4.5.1