Backed out changeset 241b4b54e654 (bug 1824374) for causing failures at popover-invoking-attribute.html.

This commit is contained in:
Butkovits Atila 2023-04-17 23:44:22 +03:00
Родитель 2a95baf7c9
Коммит fdef98b00c
4 изменённых файлов: 5 добавлений и 18 удалений

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

@ -3202,11 +3202,12 @@ Element* nsINode::GetNearestInclusiveTargetPopoverForInvoker() const {
nsGenericHTMLElement* nsINode::GetEffectivePopoverTargetElement() const {
const auto* formControl =
nsGenericHTMLFormControlElementWithState::FromNode(this);
if (!formControl || formControl->IsDisabled() ||
!formControl->IsButtonControl()) {
if (!formControl || !formControl->IsConceptButton() ||
formControl->IsDisabled() ||
(formControl->GetForm() && formControl->IsSubmitControl())) {
return nullptr;
}
if (auto* popover = nsGenericHTMLElement::FromNodeOrNull(
if (auto* popover = nsGenericHTMLElement::FromNode(
formControl->GetPopoverTargetElement())) {
if (popover->GetPopoverState() != PopoverState::None) {
return popover;

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

@ -253,7 +253,6 @@ nsresult HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
// NS_FORM_BUTTON_BUTTON do nothing.
return rv;
}
HandlePopoverTargetAction();
}
}

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

@ -4083,10 +4083,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
default:
break;
} // switch
if (IsButtonControl()) {
HandlePopoverTargetAction();
}
} // click or outer activate event
} // click or outer activate event
} else if ((aVisitor.mItemFlags & NS_IN_SUBMIT_CLICK) &&
(oldType == FormControlType::InputSubmit ||
oldType == FormControlType::InputImage)) {

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

@ -181,12 +181,6 @@ class nsIFormControl : public nsISupports {
*/
inline bool IsConceptButton() const;
/**
* Returns whether this is an ordinal button or a concept button that has no
* form associated.
*/
inline bool IsButtonControl() const;
/**
* Returns whether this form control can have draggable children.
* @return whether this form control can have draggable children.
@ -273,10 +267,6 @@ bool nsIFormControl::IsConceptButton() const {
return IsSubmitControl() || IsButtonElement(ControlType());
}
bool nsIFormControl::IsButtonControl() const {
return IsConceptButton() && (!GetForm() || !IsSubmitControl());
}
bool nsIFormControl::AllowDraggableChildren() const {
auto type = ControlType();
return type == FormControlType::Object || type == FormControlType::Fieldset ||