Bug 1338961 - A mozinputrangeignorepreventdefault hack for input[type=range], r=smaug, sr=smaug

This is a terrible hack, asking input[type=range] in our video control
xbl binding content continue to handle mouse/touch event, even if the
event is being defaultPrevented by the content.

MozReview-Commit-ID: G1huxbS7oeq
This commit is contained in:
Timothy Guan-tin Chien
2017-02-17 17:05:27 +08:00
parent b4d558ad7e
commit fdd0f80f49
8 changed files with 205 additions and 4 deletions

View File

@@ -4924,7 +4924,8 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
{
MOZ_ASSERT(mType == NS_FORM_INPUT_RANGE);
if (nsEventStatus_eConsumeNoDefault == aVisitor.mEventStatus ||
if ((nsEventStatus_eConsumeNoDefault == aVisitor.mEventStatus &&
!MozInputRangeIgnorePreventDefault()) ||
!(aVisitor.mEvent->mClass == eMouseEventClass ||
aVisitor.mEvent->mClass == eTouchEventClass ||
aVisitor.mEvent->mClass == eKeyboardEventClass)) {