@@ -23,20 +23,6 @@ function PlacesTreeView(aFlatList, aOnOpenFlatContainer, aController) {
2323PlacesTreeView . prototype = {
2424 get wrappedJSObject ( ) this ,
2525
26- _makeAtom : function PTV__makeAtom ( aString ) {
27- return Cc [ "@mozilla.org/atom-service;1" ] .
28- getService ( Ci . nsIAtomService ) .
29- getAtom ( aString ) ;
30- } ,
31-
32- _atoms : [ ] ,
33- _getAtomFor : function PTV__getAtomFor ( aName ) {
34- if ( ! this . _atoms [ aName ] )
35- this . _atoms [ aName ] = this . _makeAtom ( aName ) ;
36-
37- return this . _atoms [ aName ] ;
38- } ,
39-
4026 __dateService : null ,
4127 get _dateService ( ) {
4228 if ( ! this . __dateService ) {
@@ -857,9 +843,8 @@ PlacesTreeView.prototype = {
857843 function ( aStatus , aLivemark ) {
858844 if ( Components . isSuccessCode ( aStatus ) ) {
859845 this . _controller . cacheLivemarkInfo ( aNode , aLivemark ) ;
860- let properties = this . _cellProperties . get ( aNode , null ) ;
861- if ( properties )
862- properties . push ( this . _getAtomFor ( "livemark" ) ) ;
846+ let properties = this . _cellProperties . get ( aNode ) ;
847+ this . _cellProperties . set ( aNode , properties += " livemark " ) ;
863848
864849 // The livemark attribute is set as a cell property on the title cell.
865850 this . _invalidateCellValue ( aNode , this . COLUMN_TYPE_TITLE ) ;
@@ -1134,57 +1119,58 @@ PlacesTreeView.prototype = {
11341119 get selection ( ) this . _selection ,
11351120 set selection ( val ) this . _selection = val ,
11361121
1137- getRowProperties : function ( ) { } ,
1122+ getRowProperties : function ( ) { return "" ; } ,
11381123
11391124 getCellProperties :
1140- function PTV_getCellProperties ( aRow , aColumn , aProperties ) {
1125+ function PTV_getCellProperties ( aRow , aColumn ) {
11411126 // for anonid-trees, we need to add the column-type manually
1127+ var props = "" ;
11421128 let columnType = aColumn . element . getAttribute ( "anonid" ) ;
11431129 if ( columnType )
1144- aProperties . AppendElement ( this . _getAtomFor ( columnType ) ) ;
1130+ props += columnType ;
11451131 else
11461132 columnType = aColumn . id ;
11471133
11481134 // Set the "ltr" property on url cells
11491135 if ( columnType == "url" )
1150- aProperties . AppendElement ( this . _getAtomFor ( " ltr") ) ;
1136+ props += " ltr";
11511137
11521138 if ( columnType != "title" )
1153- return ;
1139+ return props ;
11541140
11551141 let node = this . _getNodeForRow ( aRow ) ;
11561142
11571143 if ( this . _cuttingNodes . has ( node ) ) {
1158- aProperties . AppendElement ( this . _getAtomFor ( " cutting") ) ;
1144+ props += " cutting";
11591145 }
11601146
1161- let properties = this . _cellProperties . get ( node , null ) ;
1162- if ( ! properties ) {
1163- properties = [ ] ;
1147+ let properties = this . _cellProperties . get ( node ) ;
1148+ if ( properties === undefined ) {
1149+ properties = "" ;
11641150 let itemId = node . itemId ;
11651151 let nodeType = node . type ;
11661152 if ( PlacesUtils . containerTypes . indexOf ( nodeType ) != - 1 ) {
11671153 if ( nodeType == Ci . nsINavHistoryResultNode . RESULT_TYPE_QUERY ) {
1168- properties . push ( this . _getAtomFor ( " query") ) ;
1154+ properties += " query";
11691155 if ( PlacesUtils . nodeIsTagQuery ( node ) )
1170- properties . push ( this . _getAtomFor ( " tagContainer") ) ;
1156+ properties += " tagContainer";
11711157 else if ( PlacesUtils . nodeIsDay ( node ) )
1172- properties . push ( this . _getAtomFor ( " dayContainer") ) ;
1158+ properties += " dayContainer";
11731159 else if ( PlacesUtils . nodeIsHost ( node ) )
1174- properties . push ( this . _getAtomFor ( " hostContainer") ) ;
1160+ properties += " hostContainer";
11751161 }
11761162 else if ( nodeType == Ci . nsINavHistoryResultNode . RESULT_TYPE_FOLDER ||
11771163 nodeType == Ci . nsINavHistoryResultNode . RESULT_TYPE_FOLDER_SHORTCUT ) {
11781164 if ( this . _controller . hasCachedLivemarkInfo ( node ) ) {
1179- properties . push ( this . _getAtomFor ( " livemark") ) ;
1165+ properties += " livemark";
11801166 }
11811167 else {
11821168 PlacesUtils . livemarks . getLivemark (
11831169 { id : node . itemId } ,
11841170 function ( aStatus , aLivemark ) {
11851171 if ( Components . isSuccessCode ( aStatus ) ) {
11861172 this . _controller . cacheLivemarkInfo ( node , aLivemark ) ;
1187- properties . push ( this . _getAtomFor ( " livemark") ) ;
1173+ properties += " livemark";
11881174 // The livemark attribute is set as a cell property on the title cell.
11891175 this . _invalidateCellValue ( node , this . COLUMN_TYPE_TITLE ) ;
11901176 }
@@ -1196,30 +1182,29 @@ PlacesTreeView.prototype = {
11961182 if ( itemId != - 1 ) {
11971183 let queryName = PlacesUIUtils . getLeftPaneQueryNameFromId ( itemId ) ;
11981184 if ( queryName )
1199- properties . push ( this . _getAtomFor ( " OrganizerQuery_" + queryName ) ) ;
1185+ properties += " OrganizerQuery_" + queryName ;
12001186 }
12011187 }
12021188 else if ( nodeType == Ci . nsINavHistoryResultNode . RESULT_TYPE_SEPARATOR )
1203- properties . push ( this . _getAtomFor ( " separator") ) ;
1189+ properties += " separator";
12041190 else if ( PlacesUtils . nodeIsURI ( node ) ) {
1205- properties . push ( this . _getAtomFor ( PlacesUIUtils . guessUrlSchemeForUI ( node . uri ) ) ) ;
1191+ properties += " " + PlacesUIUtils . guessUrlSchemeForUI ( node . uri ) ;
12061192
12071193 if ( this . _controller . hasCachedLivemarkInfo ( node . parent ) ) {
1208- properties . push ( this . _getAtomFor ( " livemarkItem") ) ;
1194+ properties += " livemarkItem";
12091195 if ( node . accessCount ) {
1210- properties . push ( this . _getAtomFor ( " visited") ) ;
1196+ properties += " visited";
12111197 }
12121198 }
12131199 }
12141200
12151201 this . _cellProperties . set ( node , properties ) ;
12161202 }
1217- for ( let property of properties ) {
1218- aProperties . AppendElement ( property ) ;
1219- }
1203+
1204+ return props + " " + properties ;
12201205 } ,
12211206
1222- getColumnProperties : function ( aColumn , aProperties ) { } ,
1207+ getColumnProperties : function ( aColumn ) { return "" ; } ,
12231208
12241209 isContainer : function PTV_isContainer ( aRow ) {
12251210 // Only leaf nodes aren't listed in the rows array.
0 commit comments