mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
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:
parent
1b7c52b4d0
commit
cd6c4af40f
@ -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;
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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.
|
||||
|
@ -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__);
|
||||
|
Loading…
Reference in New Issue
Block a user