Bug 524533 - mozGetFileNameArray length out param should be optional. r=sicking
authorDão Gottwald <dao@mozilla.com>
Wed, 28 Oct 2009 08:01:22 +0100
changeset 34237 c67ae7839affc102b4784d3c7dc0edfb205828f9
parent 34236 22010cbc126989e62403a49bd41f0651076385f2
child 34238 9bb5e2a5c1ac684cb3266849487ae300f44669af
push id9970
push userdgottwald@mozilla.com
push dateWed, 28 Oct 2009 07:02:07 +0000
treeherdermozilla-central@c67ae7839aff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs524533
milestone1.9.3a1pre
Bug 524533 - mozGetFileNameArray length out param should be optional. r=sicking
browser/components/sessionstore/src/nsSessionStore.js
browser/components/sessionstore/test/browser/browser_346337.js
dom/interfaces/html/nsIDOMNSHTMLInputElement.idl
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -1550,17 +1550,17 @@ SessionStoreService.prototype = {
       if (!node.id && ++generatedCount > MAX_GENERATED_XPATHS)
         continue;
       
       let id = node.id ? "#" + node.id : XPathHelper.generate(node);
       if (node instanceof Ci.nsIDOMHTMLInputElement) {
         if (node.type != "file")
           data[id] = node.type == "checkbox" || node.type == "radio" ? node.checked : node.value;
         else
-          data[id] = { type: "file", fileList: node.mozGetFileNameArray({}) };
+          data[id] = { type: "file", fileList: node.mozGetFileNameArray() };
       }
       else if (node instanceof Ci.nsIDOMHTMLTextAreaElement)
         data[id] = node.value;
       else if (!node.multiple)
         data[id] = node.selectedIndex;
       else {
         let options = Array.map(node.options, function(aOpt, aIx) aOpt.selected ? aIx : -1);
         data[id] = options.filter(function(aIx) aIx >= 0);
--- a/browser/components/sessionstore/test/browser/browser_346337.js
+++ b/browser/components/sessionstore/test/browser/browser_346337.js
@@ -77,17 +77,17 @@ function test() {
   }
   
   function compareFormValue(aTab, aQuery, aValue) {
     let node = getElementByXPath(aTab, aQuery);
     if (!node)
       return false;
     if (node instanceof Ci.nsIDOMHTMLInputElement) {
       if (node.type == "file") {
-        let fileNames = node.mozGetFileNameArray({});
+        let fileNames = node.mozGetFileNameArray();
         return fileNames.length == aValue.length &&
                Array.every(fileNames, function(aFile) aValue.indexOf(aFile) >= 0);
       }
       return aValue == (node.type == "checkbox" || node.type == "radio" ?
                         node.checked : node.value);
     }
     if (node instanceof Ci.nsIDOMHTMLTextAreaElement)
       return aValue == node.value;
--- a/dom/interfaces/html/nsIDOMNSHTMLInputElement.idl
+++ b/dom/interfaces/html/nsIDOMNSHTMLInputElement.idl
@@ -53,17 +53,17 @@ interface nsIDOMNSHTMLInputElement : nsI
            attribute long             selectionEnd;
 
 	readonly attribute nsIDOMFileList   files;
 
            attribute boolean          indeterminate;
 
            attribute boolean          multiple;
 
-  void mozGetFileNameArray(out unsigned long aLength,
+  void mozGetFileNameArray([optional] out unsigned long aLength,
                            [array,size_is(aLength), retval] out wstring aFileNames);
   void mozSetFileNameArray([array,size_is(aLength)] in wstring aFileNames,
                            in unsigned long aLength);
 
 	/* convenience */
   void                      setSelectionRange(in long selectionStart,
                                               in long selectionEnd);
 };