Bug 1068838 - Add chrome-only method for setting an <input>'s file list. r=sicking

This commit is contained in:
Jed Davis 2015-01-26 16:22:59 -08:00
parent 878e2e5f26
commit 40793e84d3
3 changed files with 14 additions and 0 deletions

View File

@ -2328,6 +2328,16 @@ HTMLInputElement::MozGetFileNameArray(uint32_t* aLength, char16_t*** aFileNames)
return NS_OK;
}
void
HTMLInputElement::MozSetFileArray(const Sequence<OwningNonNull<File>>& aFiles)
{
nsTArray<nsRefPtr<File>> files;
for (uint32_t i = 0; i < aFiles.Length(); ++i) {
files.AppendElement(aFiles[i]);
}
SetFiles(files, true);
}
void
HTMLInputElement::MozSetFileNameArray(const Sequence< nsString >& aFileNames)
{

View File

@ -716,6 +716,7 @@ public:
void MozGetFileNameArray(nsTArray< nsString >& aFileNames);
void MozSetFileNameArray(const Sequence< nsString >& aFileNames);
void MozSetFileArray(const Sequence<OwningNonNull<File>>& aFiles);
HTMLInputElement* GetOwnerNumberControl();

View File

@ -154,6 +154,9 @@ partial interface HTMLInputElement {
[ChromeOnly]
void mozSetFileNameArray(sequence<DOMString> fileNames);
[ChromeOnly]
void mozSetFileArray(sequence<File> files);
// Number controls (<input type=number>) have an anonymous text control
// (<input type=text>) in the anonymous shadow tree that they contain. On
// such an anonymous text control this property provides access to the