rem:      var elements; if( '_elementIDs' in this.contentArea ) { elements = []; for( var i = 0; i < this.contentArea._elementIDs.length; i++ ) { var elt = this.contentArea.document.getElementById( this.contentArea._elementIDs[i] ); if (elt) { elements[elements.length] = elt; } else {  dump("*** FIX ME: '_elementIDs' in '" + this.contentArea.location.href.split('/').pop() + "' contains a reference to a non-existent element ID '" + this.contentArea._elementIDs[i] + "'.\n"); } } } else { elements = this.contentArea.document.getElementsByAttribute( "wsm_persist", "true" ); } for( var ii = 0; ii < elements.length; ii++ ) { var elementID   = elements[ii].id; var elementType = elements[ii].localName; if (!(aPageTag in this.dataManager.pageData) ) this.dataManager.pageData[aPageTag] = []; this.dataManager.pageData[aPageTag][elementID] = [];  var get_Func = (elementType in this.handlers) ? this.handlers[elementType].get : this.handlers.default_handler.get; this.dataManager.setItemData( aPageTag, elementID, get_Func( elementID ) ); } }, 
add:      var elements; if ("_elementIDs" in gCurrentWindow) { elements = []; for (var i = 0; i < gCurrentWindow._elementIDs.length; i++) { var elt = gCurrentWindow.document.getElementById(gCurrentWindow._elementIDs[i]); if (elt) elements[elements.length] = elt; else {  dump("*** FIX ME: '_elementIDs' in '" + gCurrentWindow.location.href.split('/').pop() + "' contains a reference to a non-existent element ID '" + gCurrentWindow._elementIDs[i] + "'.\n"); } } } else elements = gCurrentWindow.document.getElementsByAttribute("wsm_persist", "true");  for (var ii = 0; ii < elements.length; ii++) { var elementID   = elements[ii].id; var elementType = elements[ii].localName;  if (!(aPageTag in this.dataManager.pageData) ) this.dataManager.pageData[aPageTag] = new Object(); this.dataManager.pageData[aPageTag][elementID] = new Object();   var get_Func = (elementType in this.handlers) ? this.handlers[elementType].get : this.handlers.default_handler.get; this.dataManager.setItemData(aPageTag, elementID, get_Func(elementID)); } }, 
context:     savePageData:      function ( aPageTag )        {          if (!(aPageTag in this.dataManager.pageData))            return;          if( 'GetFields' in this.contentArea)            {              // save page data based on user supplied function in content area              var dataObject = this.contentArea.GetFields();              if (dataObject)                this.dataManager.setPageData( aPageTag, dataObject );            }            // Automatic element retrieval. This is done in two ways.            // 1) if an element id array is present in the document, this is            //    used to build a list of elements to persist. <-- performant            // 2) otherwise, all elements with 'wsm_persist' set to true            //    are persisted <-- non-performant.           var elements;           if( '_elementIDs' in this.contentArea )              {                elements = [];                for( var i = 0; i < this.contentArea._elementIDs.length; i++ )                  {                    var elt = this.contentArea.document.getElementById( this.contentArea._elementIDs[i] );                    if (elt) {                      elements[elements.length] = elt;                    } else {                      // see bug #40329. People forget this too often, and it breaks Prefs                      dump("*** FIX ME: '_elementIDs' in '" + this.contentArea.location.href.split('/').pop() +                           "' contains a reference to a non-existent element ID '" +                           this.contentArea._elementIDs[i] + "'.\n");                    }                  }              }            else              {                elements = this.contentArea.document.getElementsByAttribute( "wsm_persist", "true" );              }            for( var ii = 0; ii < elements.length; ii++ )              {                var elementID   = elements[ii].id;                var elementType = elements[ii].localName;                if (!(aPageTag in this.dataManager.pageData) )                    this.dataManager.pageData[aPageTag] = [];                this.dataManager.pageData[aPageTag][elementID] = [];                // persist attributes                var get_Func = (elementType in this.handlers) ?                                this.handlers[elementType].get :                                this.handlers.default_handler.get;                this.dataManager.setItemData( aPageTag, elementID, get_Func( elementID ) );              }        },
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/a04098dd110e7bc75ade2e23f559a0ff5e526e6b/nsWidgetStateManager.js/clean/toolkit/content/nsWidgetStateManager.js