Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1036] CustomTSS: Comma-separated queries are using wrong operator AND instead of OR

GitHub Issuen/a
Resolution Date2014-06-10T17:37:26.000+0000
Affected Version/sAlloy 1.4.0
Fix Version/sAlloy 1.5.0
Labelsqe-closed-3.4.0, qe-manualtest, qe-testadded, styling
ReporterFederico Casali
AssigneeTim Poulsen


Problem description

CustomTSS comma-separated queries are not correctly applied since the boolean operator used in this case is an AND instead of an OR.

Steps to reproduce

Sample code

// index.xml
		<Label class="classLabel" id="testLabel"/>
// app.tss

	text:"Simple class label applied"

".classLabel[platform=ios,android formFactor=tablet,handheld if=Alloy.Globals.custom1,Alloy.Globals.custom2]":{
	text:"iOS or Android! Styles conditionals correctly applied"
// alloy.js
Alloy.Globals.custom1 = true;
Alloy.Globals.custom2 = false;


1. Run the sample code either on iOS or Android Result: Label text is "Simple class label applied" Expected result: Label text should be "iOS or Android! Styles conditionals correctly applied" Style conditional is not satisfied as custom2 is false and "if=Alloy.Globals.custom1,Alloy.Globals.custom2" returns false (should be true). 2. Change "Alloy.Globals.custom2" from false to true. Run on either iOS or Android. Result: Label text is "iOS or Android! Styles conditionals correctly applied", since both are true and the AND operator returns true.


  1. Tim Poulsen 2014-06-10

    PR https://github.com/appcelerator/alloy/pull/442 Test app: Use https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-1036 Functional test 1. Build the the 1036 test app. You should see two labels: the first to say "iOS or Android! Styles conditionals correctly applied" and the second to say "Add in XML" 2. Modify alloy.js setting both global variables true. The build the app. You should see the same two labels. 3. Modify alloy.js setting both global variables false. The build the app. You should see just one label with the text "Simple class label applied". 4. Build the https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/custom_tss_queries app. It should run without errors and apply styles as described by the alloy.js and TSS classes.
  2. Tim Poulsen 2014-06-10

    Reopening to adjust time
  3. Tim Poulsen 2014-06-10

    Re-resolving with updated time
  4. Priya Agarwal 2014-08-20

    Verified with: Appc Studio - SDK - 3.4.0.v20140819094113 acs - 1.0.16 alloy - 1.5.0-dev npm - 1.3.2 titanium - 3.4.0-dev titanium-code-processor - 1.1.1 OS - mavericks (v10.9.4) Xcode - 6Beta5 Device - iPhone5s(v8.0), Nexus7(v4.4.4) Tested both the apps (test/apps/testing/ALOY-1036 and https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/custom_tss_queries). Both apps run without error and as expected. Hence closing the issue.

JSON Source