Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14571] Parity: Supported platforms behave differently when backgroundGradient is set to null

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-07-27T21:11:31.000+0000
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsTiAPI
Labelsparity
ReporterTony Lukasavage
AssigneeEric Merriman
Created2013-07-16T21:20:02.000+0000
Updated2017-07-27T21:11:31.000+0000

Description

problem

When setting the *backgroundGradient* property of a proxy to *null* you get the following behaviors:

android

The backgroundGradient is unaffected. Nothing happens.

Mobileweb

An exception is thrown with the following error:
Uncaught TypeError: Cannot read property 'type' of null at /index.html (line 11509)

ios

A core platform error occurs
[DEBUG] 2013-07-16 17:05:51.020 parity[7638:c07] -[NSNull paintContext:bounds:]: unrecognized selector sent to instance 0x3a02678
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] Reason:
[ERROR] -[NSNull paintContext:bounds:]: unrecognized selector sent to instance 0x3a02678
[ERROR] Stack trace:
[ERROR] 0   CoreFoundation                      0x038d1012 __exceptionPreprocess + 178
[ERROR] 1   libobjc.A.dylib                     0x03392e7e objc_exception_throw + 44
[ERROR] 2   CoreFoundation                      0x0395c4bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 253
[ERROR] 3   CoreFoundation                      0x038c0bbc ___forwarding___ + 588
[ERROR] 4   CoreFoundation                      0x038c094e _CF_forwarding_prep_0 + 14
[ERROR] 5   parity                              0x001e8cec -[TiGradientLayer drawInContext:] + 220
[ERROR] 6   QuartzCore                          0x0252c96b _ZL16backing_callbackP9CGContextPv + 96
[ERROR] 7   QuartzCore                          0x0243e723 CABackingStoreUpdate_ + 2703
[ERROR] 8   QuartzCore                          0x0252c83c _ZN2CA5Layer8display_Ev + 1406
[ERROR] 9   QuartzCore                          0x0252c9ba -[CALayer _display] + 33
[ERROR] 10  QuartzCore                          0x0252c2b6 _ZN2CA5Layer7displayEv + 152
[ERROR] 11  QuartzCore                          0x0252c994 -[CALayer display] + 33
[ERROR] 12  QuartzCore                          0x025210e2 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 328
[ERROR] 13  QuartzCore                          0x0252115c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 38
[ERROR] 14  QuartzCore                          0x0249f0bc _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 324
[ERROR] 15  QuartzCore                          0x024a0227 _ZN2CA11Transaction6commitEv + 395
[ERROR] 16  QuartzCore                          0x024a08e2 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 96
[ERROR] 17  CoreFoundation                      0x03899afe __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
[ERROR] 18  CoreFoundation                      0x03899a3d __CFRunLoopDoObservers + 381
[ERROR] 19  CoreFoundation                      0x038777c2 __CFRunLoopRun + 1106
[ERROR] 20  CoreFoundation                      0x03876f44 CFRunLoopRunSpecific + 276
[ERROR] 21  CoreFoundation                      0x03876e1b CFRunLoopRunInMode + 123
[ERROR] 22  GraphicsServices                    0x036587e3 GSEventRunModal + 88
[ERROR] 23  GraphicsServices                    0x03658668 GSEventRun + 104
[ERROR] 24  UIKit                               0x00f6cffc UIApplicationMain + 1211
[ERROR] 25  parity                              0x00007568 main + 456
[ERROR] 26  parity                              0x00002d35 start + 53
[ERROR] 27  ???                                 0x00000001 0x0 + 1
[ERROR] 2013-07-16 17:05:51.068 parity[7638:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull paintContext:bounds:]: unrecognized selector sent to instance 0x3a02678'
[ERROR] *** First throw call stack:
[ERROR] (0x38d1012 0x3392e7e 0x395c4bd 0x38c0bbc 0x38c094e 0x1e8cec 0x252c96b 0x243e723 0x252c83c 0x252c9ba 0x252c2b6 0x252c994 0x25210e2 0x252115c 0x249f0bc 0x24a0227 0x24a08e2 0x3899afe 0x3899a3d 0x38777c2 0x3876f44 0x3876e1b 0x36587e3 0x3658668 0xf6cffc 0x7568 0x2d35 0x1)
-- End simulator log ---------------------------------------------------------
[ERROR] An error occurred running the iOS Simulator
[ERROR]   
[ERROR] Project failed to build after 53s 947ms

expected

All platforms should remove the backgroundGradient from the Titanium proxy and no error should occur.

test case

var win = Ti.UI.createWindow({
	backgroundColor: '#fff',
	modal: false,
	exitOnClose: true
});
var label = Ti.UI.createLabel({
	text: 'just a test label',
	backgroundGradient: {
        type: 'linear',
        startPoint: { x: '0%', y: '50%' },
        endPoint: { x: '100%', y: '50%' },
        colors: [
        	{ color: 'red', offset: 0.0},
        	{ color: 'blue', offset: 0.25 },
        	{ color: 'red', offset: 1.0 }
        ],
    }
});
label.addEventListener('click', function(e) {
	label.backgroundGradient = null;
});

win.add(label);
win.open();

Comments

  1. Lee Morris 2017-07-27

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source