Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4703] Android: Comparison of proxies for nodes that should be the same sometimes do not work.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-07-27T09:52:33.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-30, Release 1.8.0
ComponentsAndroid
Labelsparity
ReporterBill Dawson
AssigneeVikramjeet Singh
Created2011-07-18T10:06:36.000+0000
Updated2011-09-13T12:33:28.000+0000

Description

This could potentially be a drillbit problem (specifically shouldBe), but I'm assuming it's actually Android. Drillbit code from xml.js test shows that a node's attribute's ownerElement is not considered the same as the node (which it should be):
var doc = Ti.XML.parseString(this.testSource["nodes.xml"]);
var node = doc.getElementsByTagName("node").item(0);
var attr = node.attributes.item(0);
valueOf(attr.ownerElement).shouldBe(node); // FAILS

Comments

  1. Bill Dawson 2011-07-25

    Simple failcase app.js (instead of running drillbit):
       Titanium.UI.setBackgroundColor('#000');
       // Titanium.Network;
       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#000',
       	exitOnClose: true
       });
       win.open();
       
       var XMLSTRING = '<a b="c"/>';
       var doc = Ti.XML.parseString(XMLSTRING);
       var elem = doc.getElementsByTagName("a").item(0);
       var attr = elem.attributes.item(0);
       var equality = (attr.ownerElement == doc.documentElement);
       if (equality) {
       	alert("Test passed.  attr.ownerElement == doc.documentElement");
       } else {
       	alert("Test failed.  attr.ownerElement != doc.documentElement but it should");
       }
       
  2. Don Thorp 2011-07-27

    Code reviewed and tested.
  3. Vikramjeet Singh 2011-09-13

    Resolved. Tested On: Mac OSX Lion TiMob: 1.8.0.v20110906155354 TiStud: 1.0.5.201109091616 Devices Used: Android Emulator 2.2 Droid 3 Droid 1

JSON Source