Bug 1048293 - File::mozFullPath attribute should not be exposed to content., r=ehsan
--- 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();
}