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 296090 86014d39a1c5eb901f1534cd683778f5763d1f8b
parent 296089 37de8cac26874f367e5ccc4dc21daef2cc85fbff
child 296091 0e4476d49a825d3c1ccf9cbbe5d17c2bb65eafec
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [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;
 }