Bug 1556351 - Part 3: Rename nsGenericHTMLFormElementWithState to nsGenericHTMLFormControlElementWithState; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D124786
This commit is contained in:
Edgar Chen
2021-10-04 20:51:26 +00:00
parent b5ebddd6e6
commit 92a1fc095f
12 changed files with 121 additions and 114 deletions

View File

@@ -1159,8 +1159,8 @@ nsresult HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsAtom* aName,
}
}
return nsGenericHTMLFormElementWithState::BeforeSetAttr(aNameSpaceID, aName,
aValue, aNotify);
return nsGenericHTMLFormControlElementWithState::BeforeSetAttr(
aNameSpaceID, aName, aValue, aNotify);
}
nsresult HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
@@ -1341,7 +1341,7 @@ nsresult HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
}
}
return nsGenericHTMLFormElementWithState::AfterSetAttr(
return nsGenericHTMLFormControlElementWithState::AfterSetAttr(
aNameSpaceID, aName, aValue, aOldValue, aSubjectPrincipal, aNotify);
}
@@ -2731,7 +2731,7 @@ nsresult HTMLInputElement::SetValueInternal(
}
// Treat value == defaultValue for other input elements.
return nsGenericHTMLFormElementWithState::SetAttr(
return nsGenericHTMLFormControlElementWithState::SetAttr(
kNameSpaceID_None, nsGkAtoms::value, aValue, true);
case VALUE_MODE_FILENAME:
@@ -2975,7 +2975,7 @@ bool HTMLInputElement::IsNodeApzAwareInternal() const {
bool HTMLInputElement::IsInteractiveHTMLContent() const {
return mType != FormControlType::InputHidden ||
nsGenericHTMLFormElementWithState::IsInteractiveHTMLContent();
nsGenericHTMLFormControlElementWithState::IsInteractiveHTMLContent();
}
void HTMLInputElement::AsyncEventRunning(AsyncEventDispatcher* aEvent) {
@@ -3191,8 +3191,8 @@ void HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
if (mType == FormControlType::InputRange &&
(aVisitor.mEvent->mMessage == eFocus ||
aVisitor.mEvent->mMessage == eBlur)) {
// Just as nsGenericHTMLFormElementWithState::GetEventTargetParent calls
// nsIFormControlFrame::SetFocus, we handle focus here.
// Just as nsGenericHTMLFormControlElementWithState::GetEventTargetParent
// calls nsIFormControlFrame::SetFocus, we handle focus here.
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
frame->InvalidateFrameSubtree();
@@ -3244,7 +3244,7 @@ void HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
}
}
nsGenericHTMLFormElementWithState::GetEventTargetParent(aVisitor);
nsGenericHTMLFormControlElementWithState::GetEventTargetParent(aVisitor);
// Stop the event if the related target's first non-native ancestor is the
// same as the original target's first non-native ancestor (we are moving
@@ -3274,7 +3274,7 @@ nsresult HTMLInputElement::PreHandleEvent(EventChainVisitor& aVisitor) {
MOZ_ASSERT(aVisitor.mEvent->mMessage == eBlur);
FireChangeEventIfNeeded();
}
return nsGenericHTMLFormElementWithState::PreHandleEvent(aVisitor);
return nsGenericHTMLFormControlElementWithState::PreHandleEvent(aVisitor);
}
void HTMLInputElement::StartRangeThumbDrag(WidgetGUIEvent* aEvent) {
@@ -4174,7 +4174,7 @@ void HTMLInputElement::MaybeLoadImage() {
nsresult HTMLInputElement::BindToTree(BindContext& aContext, nsINode& aParent) {
nsresult rv =
nsGenericHTMLFormElementWithState::BindToTree(aContext, aParent);
nsGenericHTMLFormControlElementWithState::BindToTree(aContext, aParent);
NS_ENSURE_SUCCESS(rv, rv);
nsImageLoadingContent::BindToTree(aContext, aParent);
@@ -4244,8 +4244,8 @@ void HTMLInputElement::UnbindFromTree(bool aNullParent) {
}
// If we have a form and are unbound from it,
// nsGenericHTMLFormElementWithState::UnbindFromTree() will unset the form and
// that takes care of form's WillRemove so we just have to take care
// nsGenericHTMLFormControlElementWithState::UnbindFromTree() will unset the
// form and that takes care of form's WillRemove so we just have to take care
// of the case where we're removing from the document and we don't
// have a form
if (!mForm && mType == FormControlType::InputRadio) {
@@ -4257,7 +4257,7 @@ void HTMLInputElement::UnbindFromTree(bool aNullParent) {
}
nsImageLoadingContent::UnbindFromTree(aNullParent);
nsGenericHTMLFormElementWithState::UnbindFromTree(aNullParent);
nsGenericHTMLFormControlElementWithState::UnbindFromTree(aNullParent);
// GetCurrentDoc is returning nullptr so we can update the value
// missing validity state to reflect we are no longer into a doc.
@@ -5143,25 +5143,25 @@ bool HTMLInputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
void HTMLInputElement::ImageInputMapAttributesIntoRule(
const nsMappedAttributes* aAttributes, MappedDeclarations& aDecls) {
nsGenericHTMLFormElementWithState::MapImageBorderAttributeInto(aAttributes,
aDecls);
nsGenericHTMLFormElementWithState::MapImageMarginAttributeInto(aAttributes,
aDecls);
nsGenericHTMLFormElementWithState::MapImageSizeAttributesInto(
nsGenericHTMLFormControlElementWithState::MapImageBorderAttributeInto(
aAttributes, aDecls);
nsGenericHTMLFormControlElementWithState::MapImageMarginAttributeInto(
aAttributes, aDecls);
nsGenericHTMLFormControlElementWithState::MapImageSizeAttributesInto(
aAttributes, aDecls, MapAspectRatio::Yes);
// Images treat align as "float"
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes,
aDecls);
nsGenericHTMLFormControlElementWithState::MapImageAlignAttributeInto(
aAttributes, aDecls);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes,
aDecls);
nsGenericHTMLFormControlElementWithState::MapCommonAttributesInto(aAttributes,
aDecls);
}
nsChangeHint HTMLInputElement::GetAttributeChangeHint(const nsAtom* aAttribute,
int32_t aModType) const {
nsChangeHint retval =
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute,
aModType);
nsGenericHTMLFormControlElementWithState::GetAttributeChangeHint(
aAttribute, aModType);
const bool isAdditionOrRemoval =
aModType == MutationEvent_Binding::ADDITION ||
@@ -5868,7 +5868,8 @@ EventStates HTMLInputElement::IntrinsicState() const {
// If you add states here, and they're type-dependent, you need to add them
// to the type case in AfterSetAttr.
EventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
EventStates state =
nsGenericHTMLFormControlElementWithState::IntrinsicState();
if (mType == FormControlType::InputCheckbox ||
mType == FormControlType::InputRadio) {
// Check current checked state (:checked)
@@ -6128,7 +6129,7 @@ void HTMLInputElement::WillRemoveFromRadioGroup() {
bool HTMLInputElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
int32_t* aTabIndex) {
if (nsGenericHTMLFormElementWithState::IsHTMLFocusable(
if (nsGenericHTMLFormControlElementWithState::IsHTMLFocusable(
aWithMouse, aIsFocusable, aTabIndex)) {
return true;
}
@@ -6685,7 +6686,7 @@ void HTMLInputElement::FieldSetDisabledChanged(bool aNotify) {
// This *has* to be called *before* UpdateBarredFromConstraintValidation and
// UpdateValueMissingValidityState because these two functions depend on our
// disabled state.
nsGenericHTMLFormElementWithState::FieldSetDisabledChanged(aNotify);
nsGenericHTMLFormControlElementWithState::FieldSetDisabledChanged(aNotify);
UpdateValueMissingValidityState();
UpdateBarredFromConstraintValidation();