Bug 1201106 - Make sure that HTMLInputElement.files is always null if the 'directory' attribute is set. r=baku
authorJonathan Watt <jwatt@jwatt.org>
Fri, 21 Aug 2015 13:38:25 +0100
changeset 294385 86014d39a1c5eb901f1534cd683778f5763d1f8b
parent 294384 37de8cac26874f367e5ccc4dc21daef2cc85fbff
child 294386 0e4476d49a825d3c1ccf9cbbe5d17c2bb65eafec
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1201106
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1201106 - Make sure that HTMLInputElement.files is always null if the 'directory' attribute is set. r=baku
dom/html/HTMLInputElement.cpp
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -2476,16 +2476,20 @@ HTMLInputElement::FireChangeEventIfNeede
 
 FileList*
 HTMLInputElement::GetFiles()
 {
   if (mType != NS_FORM_INPUT_FILE) {
     return nullptr;
   }
 
+  if (HasAttr(kNameSpaceID_None, nsGkAtoms::directory)) {
+    return nullptr;
+  }
+
   if (!mFileList) {
     mFileList = new FileList(static_cast<nsIContent*>(this));
     UpdateFileList();
   }
 
   return mFileList;
 }