mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Backed out changeset f843a97323da (bug 1282870) for bustage on a CLOSED TREE
This commit is contained in:
parent
851369b631
commit
96e498753a
@ -129,15 +129,11 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||
|
||||
#if defined(ANDROID) || defined(MOZ_B2G)
|
||||
bool isDirPicker = false;
|
||||
bool isWebkitPicker = false;
|
||||
#else
|
||||
nsIContent* content = GetContent();
|
||||
bool isDirPicker =
|
||||
Preferences::GetBool("dom.input.dirpicker", false) &&
|
||||
content && content->HasAttr(kNameSpaceID_None, nsGkAtoms::directory);
|
||||
bool isWebkitPicker =
|
||||
Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) &&
|
||||
content && content->HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory);
|
||||
#endif
|
||||
|
||||
RefPtr<HTMLInputElement> fileContent = HTMLInputElement::FromContentOrNull(mContent);
|
||||
@ -148,14 +144,13 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||
nsAutoString accessKey;
|
||||
fileContent->GetAccessKey(accessKey);
|
||||
|
||||
mBrowseFiles = MakeAnonButton(doc,
|
||||
isDirPicker || isWebkitPicker ? "ChooseFiles" : "Browse",
|
||||
mBrowseFiles = MakeAnonButton(doc, isDirPicker ? "ChooseFiles" : "Browse",
|
||||
fileContent, accessKey);
|
||||
if (!mBrowseFiles || !aElements.AppendElement(mBrowseFiles)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (isDirPicker || isWebkitPicker) {
|
||||
if (isDirPicker) {
|
||||
mBrowseDirs = MakeAnonButton(doc, "ChooseDirs", fileContent, EmptyString());
|
||||
// Setting the 'directory' attribute is simply a means of allowing our
|
||||
// event handling code in HTMLInputElement.cpp to distinguish between a
|
||||
@ -163,17 +158,8 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||
if (!mBrowseDirs) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsIContent* content = GetContent();
|
||||
MOZ_ASSERT(content);
|
||||
if (isDirPicker) {
|
||||
mBrowseDirs->SetAttr(kNameSpaceID_None, nsGkAtoms::directory,
|
||||
EmptyString(), false);
|
||||
} else {
|
||||
mBrowseDirs->SetAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory,
|
||||
EmptyString(), false);
|
||||
}
|
||||
|
||||
mBrowseDirs->SetAttr(kNameSpaceID_None, nsGkAtoms::directory,
|
||||
EmptyString(), false);
|
||||
if (!aElements.AppendElement(mBrowseDirs)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user