Bug 1048293 - File::mozFullPath attribute should not be exposed to content., r=ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 10 Oct 2014 16:59:56 +0100
changeset 209865 0126b86ee7ecc4425b49eeb6d8bae9e32ad45332
parent 209864 98fade97048aa987f8e274642fd4010442685d6f
child 209866 37dae39533a6806bc5fb44d303013eab0c8b3238
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersehsan
bugs1048293
milestone35.0a1
Bug 1048293 - File::mozFullPath attribute should not be exposed to content., r=ehsan
dom/webidl/File.webidl
dom/workers/test/fileReaderSyncErrors_worker.js
dom/workers/test/file_worker.js
dom/workers/test/test_file.xul
dom/workers/test/test_filePosting.xul
dom/workers/test/test_fileSubWorker.xul
--- a/dom/webidl/File.webidl
+++ b/dom/webidl/File.webidl
@@ -39,12 +39,12 @@ dictionary ChromeFilePropertyBag : FileP
 };
 
 // Mozilla extensions
 partial interface File {
 
   [GetterThrows]
   readonly attribute Date lastModifiedDate;
 
-  [GetterThrows]
+  [GetterThrows, ChromeOnly]
   readonly attribute DOMString mozFullPath;
 
 };
--- a/dom/workers/test/fileReaderSyncErrors_worker.js
+++ b/dom/workers/test/fileReaderSyncErrors_worker.js
@@ -56,17 +56,16 @@ function fileReaderJunkArgument(blob) {
 
 onmessage = function(event) {
   var file = event.data;
 
   // Test read only properties.
   writeProperty(file, "size");
   writeProperty(file, "type");
   writeProperty(file, "name");
-  writeProperty(file, "mozFullPath");
 
   // Bad types.
   fileReaderJunkArgument(undefined);
   fileReaderJunkArgument(-1);
   fileReaderJunkArgument(1);
   fileReaderJunkArgument(new Object());
   fileReaderJunkArgument("hello");
 
--- a/dom/workers/test/file_worker.js
+++ b/dom/workers/test/file_worker.js
@@ -6,12 +6,11 @@ onmessage = function(event) {
 
   var rtnObj = new Object();
 
   rtnObj.size = file.size;
   rtnObj.type = file.type;
   rtnObj.name = file.name;
   rtnObj.path = file.path;
   rtnObj.lastModifiedDate = file.lastModifiedDate;
-  rtnObj.mozFullPath = file.mozFullPath;
 
   postMessage(rtnObj);
 };
--- a/dom/workers/test/test_file.xul
+++ b/dom/workers/test/test_file.xul
@@ -64,19 +64,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       ok(false, "Worker had an error: " + event.message);
       finish();
     };
 
     worker.onmessage = function(event) {
       is(event.data.size, expectedSize, "size proproperty accessed from worker is not the same as on main thread.");
       is(event.data.type, expectedType, "type proproperty accessed from worker is incorrect.");
       is(event.data.name, file.name, "name proproperty accessed from worker is incorrect.");
-      is(event.data.path, file.path, "path proproperty accessed from worker is incorrect.");
       is(event.data.lastModifiedDate.toString(), file.lastModifiedDate.toString(), "lastModifiedDate proproperty accessed from worker is incorrect.");
-      is(event.data.mozFullPath, file.mozFullPath, "mozFullPath proproperty accessed from worker is not the same as on main thread.");
       finish();
     };
 
     worker.postMessage(file);
   }
 
   // Empty file.
   accessFileProperties(createFileWithData(""), 0, "");
--- a/dom/workers/test/test_filePosting.xul
+++ b/dom/workers/test/test_filePosting.xul
@@ -63,17 +63,16 @@ https://bugzilla.mozilla.org/show_bug.cg
       ok(false, "Worker had an error: " + event.message);
       finish();
     };
 
     worker.onmessage = function(event) {
       is(event.data.size, file.size, "size of file posted from worker does not match file posted to worker.");
       is(event.data.type, file.type, "type of file posted from worker does not match file posted to worker.");
       is(event.data.name, file.name, "name of file posted from worker does not match file posted to worker.");
-      is(event.data.mozFullPath, file.mozFullPath, "mozFullPath of file posted from worker does not match file posted to worker.");
       finish();
     };
 
     worker.postMessage(file);
     waitForWorkerFinish();
   }
 
   // Empty file.
--- a/dom/workers/test/test_fileSubWorker.xul
+++ b/dom/workers/test/test_fileSubWorker.xul
@@ -65,17 +65,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 
     worker.onmessage = function(event) {
       if (event.data == undefined) {
         ok(false, "Worker had an error.");
       } else {
         is(event.data.size, expectedSize, "size proproperty accessed from worker is not the same as on main thread.");
         is(event.data.type, expectedType, "type proproperty accessed from worker is incorrect.");
         is(event.data.name, file.name, "name proproperty accessed from worker is incorrect.");
-        is(event.data.mozFullPath, file.mozFullPath, "mozFullPath proproperty accessed from worker is not the same as on main thread.");
       }
       finish();
     };
 
     worker.postMessage(file);
     waitForWorkerFinish();
   }