rem: if ( ! childWithDatabase ) return false; 
add: if ( ! childWithDatabase ) { event.preventBubble(); return; }      var container = event.target.getAttribute("container"); if ( container == "true" ) return; 
context:   function BeginDragPersonalToolbar ( event )  {    //XXX we rely on a capturer to already have determined which item the mouse was over    //XXX and have set an attribute.        // if the click is on the toolbar proper, ignore it. We only care about clicks on    // items.    var toolbar = document.getElementById("PersonalToolbar");    if ( event.target == toolbar )      return true;  // continue propagating the event        // since the database is not on the toolbar, but on the innermost box, we need to     // make sure we can find it before we go any further. If we can't find it, we're    // up the creek, but don't keep propagating the event.    var childWithDatabase = document.getElementById("innermostBox");    if ( ! childWithDatabase )      return false;        var dragStarted = false;    var dragService = Components.classes["component://netscape/widget/dragservice"].getService();    if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService);    if ( dragService ) {      var trans = Components.classes["component://netscape/widget/transferable"].createInstance();      if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable);      if ( trans ) {        trans.addDataFlavor("moz/toolbaritem");        var genData = Components.classes["component://netscape/supports-wstring"].createInstance();        if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString);        trans.addDataFlavor("text/plain");        var genTextData = Components.classes["component://netscape/supports-string"].createInstance();        if ( genTextData ) genTextData = genTextData.QueryInterface(Components.interfaces.nsISupportsString);                if ( genData && genTextData ) {        		var id = event.target.getAttribute("id");		genData.data = id;        genTextData.data = id;        		dump("ID: " + id + "\n");		var database = childWithDatabase.database;		var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();		if (rdf)   rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);		if ((!rdf) || (!database))	return(false);		// make sure its a bookmark, bookmark separator, or bookmark folder		var src = rdf.GetResource(id, true);		var prop = rdf.GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true);		var target = database.GetTarget(src, prop, true);/*pinkertonthis doesn't work anymore (target is null), not sure why.		if (target)	target = target.QueryInterface(Components.interfaces.nsIRDFResource);		if (target)	target = target.Value;		if ((!target) || (target == "")) {dump("BAD\n"); return(false);}		dump("Type: '" + target + "'\n");		if ((target != "http://home.netscape.com/NC-rdf#BookmarkSeparator") &&		   (target != "http://home.netscape.com/NC-rdf#Bookmark") &&		   (target != "http://home.netscape.com/NC-rdf#Folder"))	return(false);*/          trans.setTransferData ( "moz/toolbaritem", genData, id.length*2 );  // double byte data (len*2)          trans.setTransferData ( "text/plain", genTextData, id.length );  // single byte data          var transArray = Components.classes["component://netscape/supports-array"].createInstance();          if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray);          if ( transArray ) {            // put it into the transferable as an |nsISupports|            var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);            transArray.AppendElement(genTrans);            var nsIDragService = Components.interfaces.nsIDragService;            dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +                                                 nsIDragService.DRAGDROP_ACTION_MOVE );            dragStarted = true;          }        } // if data object      } // if transferable    } // if drag service    if ( dragStarted )               // don't propagate the event if a drag has begun      event.preventBubble();      } // BeginDragPersonalToolbar
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/5cca59badd3406c5b21c09e3d2fbd014dd319f65/navigator.js/buggy/suite/browser/navigator.js