Bug 1207088 - Don't show the "Choose folder..." button for a directory picking <input> on platforms that don't have a directory picker. r=jfkthame

This commit is contained in:
Jonathan Watt
2015-09-16 11:42:27 +01:00
parent 3baff2531b
commit 9a70a91b0a
2 changed files with 10 additions and 2 deletions

View File

@@ -127,9 +127,14 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
{
nsCOMPtr<nsIDocument> doc = mContent->GetComposedDoc();
#if defined(ANDROID) || defined(MOZ_B2G)
bool isDirPicker = false;
#else
nsIContent* content = GetContent();
bool isDirPicker = Preferences::GetBool("dom.input.dirpicker", false) &&
content && content->HasAttr(kNameSpaceID_None, nsGkAtoms::directory);
bool isDirPicker =
Preferences::GetBool("dom.input.dirpicker", false) &&
content && content->HasAttr(kNameSpaceID_None, nsGkAtoms::directory);
#endif
RefPtr<HTMLInputElement> fileContent = HTMLInputElement::FromContentOrNull(mContent);