Bug 1256589 part.5 Add DefaultPrevented() and DefaultPreventedByContent() to WidgetEvent r=smaug

MozReview-Commit-ID: 5q3QUPTf12Z
This commit is contained in:
Masayuki Nakano
2016-03-22 16:47:52 +09:00
parent e8d750f1f6
commit ce8c25949d
14 changed files with 38 additions and 27 deletions

View File

@@ -3699,7 +3699,7 @@ HTMLInputElement::MaybeInitPickers(EventChainPostVisitor& aVisitor)
// - it's the left mouse button.
// We do not prevent non-trusted click because authors can already use
// .click(). However, the pickers will follow the rules of popup-blocking.
if (aVisitor.mEvent->mFlags.mDefaultPrevented) {
if (aVisitor.mEvent->DefaultPrevented()) {
return NS_OK;
}
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
@@ -3890,7 +3890,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// the editor's handling of up/down keypress events. For that reason we
// just ignore aVisitor.mEventStatus here and go ahead and handle the
// event to increase/decrease the value of the number control.
if (!aVisitor.mEvent->mFlags.mDefaultPreventedByContent && IsMutable()) {
if (!aVisitor.mEvent->DefaultPreventedByContent() && IsMutable()) {
StepNumberControlForUserEvent(keyEvent->keyCode == NS_VK_UP ? 1 : -1);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}