Titanium JIRA Archive
Alloy (ALOY)

[ALOY-635] Styles not being sorted properly among global, controller, platform-specific, and theme

GitHub Issuen/a
Resolution Date2013-04-24T20:53:48.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, Alloy 1.1.2, 2013 Sprint 09
ComponentsRuntime, XML
ReporterTony Lukasavage
AssigneeTony Lukasavage


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.


  1. 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.
  2. Tony Lukasavage 2013-04-24

    Verification test case in the test apps at testing/ALOY-635.
       jake app:run dir=testing/ALOY-635
    If run against Alloy 1.1.1 the text printed in the app will say:
       global style merging is broken if you see this text in your app
    When testing the fix with 1.1.2, though, you'll get the appropriate text that says:
       you should see this text
  3. Tony Lukasavage 2013-04-25

    test app link: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-635
  4. 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
  5. 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
  6. 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: XCode : 4.5.1

JSON Source