Issue #2030 - Allow child nodes of button to participate in mouse hit tests

This is needed for web compatibility, even if standards compliance is debatable.
This commit is contained in:
Martok 2022-11-27 16:35:38 +01:00 committed by roytam1
commit 4354c7a1bc
4 changed files with 28 additions and 18 deletions

View file

@ -221,11 +221,14 @@ HTMLButtonElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
bool outerActivateEvent =
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
(aVisitor.mEvent->mMessage == eLegacyDOMActivate &&
!mInInternalActivate));
!mInInternalActivate &&
aVisitor.mEvent->mOriginalTarget == this));
if (outerActivateEvent) {
aVisitor.mItemFlags |= NS_OUTER_ACTIVATE_EVENT;
if (mType == NS_FORM_BUTTON_SUBMIT && mForm) {
if (mType == NS_FORM_BUTTON_SUBMIT && mForm &&
!aVisitor.mEvent->mFlags.mMultiplePreActionsPrevented) {
aVisitor.mEvent->mFlags.mMultiplePreActionsPrevented = true;
aVisitor.mItemFlags |= NS_IN_SUBMIT_CLICK;
// tell the form that we are about to enter a click handler.
// that means that if there are scripted submissions, the