Bug 1405087: Make nsGenericHTMLElement::IsDisabled not virtual. r=bz

The state bit is never added to object / output anyway (see the CanBeDisabled
check).

MozReview-Commit-ID: DBPpaHA2tME
This commit is contained in:
Emilio Cobos Álvarez 2018-02-10 20:01:36 +01:00
Родитель 82778d6954
Коммит a6ad7e8448
6 изменённых файлов: 6 добавлений и 24 удалений

Просмотреть файл

@ -62,8 +62,6 @@ public:
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission *aFormSubmission) override;
virtual bool IsDisabled() const override { return false; }
virtual void DoneAddingChildren(bool aHaveNotified) override;
virtual bool IsDoneAddingChildren() override;

Просмотреть файл

@ -48,10 +48,6 @@ public:
virtual nsIDOMNode* AsDOMNode() override { return this; }
virtual bool IsDisabled() const override {
return State().HasState(NS_EVENT_STATE_DISABLED);
}
bool Disabled() const
{
return GetBoolAttr(nsGkAtoms::disabled);

Просмотреть файл

@ -90,10 +90,6 @@ public:
nsresult CopyInnerTo(mozilla::dom::Element* aDest, bool aPreallocateChildren);
virtual bool IsDisabled() const override {
return State().HasState(NS_EVENT_STATE_DISABLED);
}
bool Disabled() const
{
return GetBoolAttr(nsGkAtoms::disabled);

Просмотреть файл

@ -34,8 +34,6 @@ public:
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
virtual bool IsDisabled() const override { return false; }
nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult,
bool aPreallocateChildren) const override;

Просмотреть файл

@ -2034,13 +2034,6 @@ nsGenericHTMLFormElement::PreHandleEvent(EventChainVisitor& aVisitor)
return nsGenericHTMLElement::PreHandleEvent(aVisitor);
}
/* virtual */
bool
nsGenericHTMLFormElement::IsDisabled() const
{
return State().HasState(NS_EVENT_STATE_DISABLED);
}
void
nsGenericHTMLFormElement::ForgetFieldSet(nsIContent* aFieldset)
{
@ -2350,14 +2343,14 @@ nsGenericHTMLFormElement::UpdateFieldSet(bool aNotify)
}
}
void nsGenericHTMLFormElement::UpdateDisabledState(bool aNotify)
void
nsGenericHTMLFormElement::UpdateDisabledState(bool aNotify)
{
if (!CanBeDisabled()) {
return;
}
bool isDisabled = HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
if (!isDisabled && mFieldSet) {
isDisabled = mFieldSet->IsDisabled();
}

Просмотреть файл

@ -646,9 +646,11 @@ public:
/**
* Returns the current disabled state of the element.
*
* TODO(emilio): Consider moving to Element?
*/
virtual bool IsDisabled() const {
return false;
bool IsDisabled() const {
return State().HasState(NS_EVENT_STATE_DISABLED);
}
bool IsHidden() const
@ -1057,7 +1059,6 @@ public:
mozilla::EventChainPreVisitor& aVisitor) override;
virtual nsresult PreHandleEvent(
mozilla::EventChainVisitor& aVisitor) override;
virtual bool IsDisabled() const override;
/**
* This callback is called by a fieldest on all its elements whenever its