Bug 1295922 - <input type=file webkitdirectory>.click() doesn't work. r=baku
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 17 Aug 2016 17:59:53 +0300
changeset 309747 13d7c16e0442aee85e5ce53057e11714819ff7c6
parent 309746 7497dca8bbb5a00ee46bf65da8884b0af8a2f26b
child 309748 c5cb27604f9fcfb2963c4574524c666532cfa5bb
push id80687
push userryanvm@gmail.com
push dateWed, 17 Aug 2016 19:44:31 +0000
treeherdermozilla-inbound@ef40e047b7b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1295922
milestone51.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 1295922 - <input type=file webkitdirectory>.click() doesn't work. r=baku
dom/html/HTMLInputElement.cpp
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4087,18 +4087,17 @@ HTMLInputElement::MaybeInitPickers(Event
   }
   if (mType == NS_FORM_INPUT_FILE) {
     // If the user clicked on the "Choose folder..." button we open the
     // directory picker, else we open the file picker.
     FilePickerType type = FILE_PICKER_FILE;
     nsCOMPtr<nsIContent> target =
       do_QueryInterface(aVisitor.mEvent->mOriginalTarget);
     if (target &&
-        target->GetParent() == this &&
-        target->IsRootOfNativeAnonymousSubtree() &&
+        target->FindFirstNonChromeOnlyAccessContent() == this &&
         ((Preferences::GetBool("dom.input.dirpicker", false) && Allowdirs()) ||
          (Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) &&
           HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory)))) {
       type = FILE_PICKER_DIRECTORY;
     }
     return InitFilePicker(type);
   }
   if (mType == NS_FORM_INPUT_COLOR) {