Bug 1839555 - Get rid of nsIFormControl::AllowDrop r=dom-core,peterv

It was introduced in bug 206859, but the `<input type="text">` in
`<input type="file">` was replaced with `<label>` in bug 345195.
Additionally, it's used only by `EditorBase` to check `<input type="text">`
is in `<input type="file">`.  Therefore, we don't need it anymore.

Differential Revision: https://phabricator.services.mozilla.com/D181599
This commit is contained in:
Masayuki Nakano 2023-06-24 00:58:44 +00:00
parent 1b7c52b4d0
commit cd6c4af40f
6 changed files with 0 additions and 23 deletions

View File

@ -81,7 +81,6 @@ class ElementInternals final : public nsIFormControl,
void ClearForm(bool aRemoveFromForm, bool aUnbindOrDelete) override;
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(mozilla::dom::FormData* aFormData) override;
bool AllowDrop() override { return true; }
void SetFieldSet(mozilla::dom::HTMLFieldSetElement* aFieldSet) {
mFieldSet = aFieldSet;

View File

@ -6171,12 +6171,6 @@ bool HTMLInputElement::RestoreState(PresState* aState) {
return restoredCheckedState;
}
bool HTMLInputElement::AllowDrop() {
// Allow drop on anything other than file inputs.
return mType != FormControlType::InputFile;
}
/*
* Radio group stuff
*/

View File

@ -158,7 +158,6 @@ class HTMLInputElement final : public TextControlElement,
MOZ_CAN_RUN_SCRIPT_BOUNDARY
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(FormData* aFormData) override;
bool AllowDrop() override;
void FieldSetDisabledChanged(bool aNotify) override;

View File

@ -1140,7 +1140,6 @@ class nsGenericHTMLFormControlElement : public nsGenericHTMLFormElement,
mozilla::dom::HTMLFormElement* GetForm() const override { return mForm; }
void SetForm(mozilla::dom::HTMLFormElement* aForm) override;
void ClearForm(bool aRemoveFromForm, bool aUnbindOrDelete) override;
bool AllowDrop() override { return true; }
protected:
virtual ~nsGenericHTMLFormControlElement();

View File

@ -147,8 +147,6 @@ class nsIFormControl : public nsISupports {
NS_IMETHOD
SubmitNamesValues(mozilla::dom::FormData* aFormData) = 0;
virtual bool AllowDrop() = 0;
/**
* Returns whether this is a control which submits the form when activated by
* the user.

View File

@ -4701,18 +4701,6 @@ nsresult EditorBase::HandleDropEvent(DragEvent* aDropEvent) {
}
}
if (IsInPlaintextMode()) {
for (nsIContent* content = droppedAt.ContainerAs<nsIContent>(); content;
content = content->GetParent()) {
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(content));
if (formControl && !formControl->AllowDrop()) {
// Don't allow dropping into a form control that doesn't allow being
// dropped into.
return NS_OK;
}
}
}
// Combine any deletion and drop insertion into one transaction.
AutoPlaceholderBatch treatAsOneTransaction(
*this, ScrollSelectionIntoView::Yes, __FUNCTION__);