зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1452569 - Implement Event's returnValue. r=smaug
Add retrunValue into Event's interface Differential Revision: https://phabricator.services.mozilla.com/D4084 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2e606ab5f6
Коммит
11a043ad55
|
@ -1003,6 +1003,20 @@ Event::DefaultPrevented(CallerType aCallerType) const
|
|||
aCallerType == CallerType::System;
|
||||
}
|
||||
|
||||
bool
|
||||
Event::ReturnValue(CallerType aCallerType) const
|
||||
{
|
||||
return !DefaultPrevented(aCallerType);
|
||||
}
|
||||
|
||||
void
|
||||
Event::SetReturnValue(bool aReturnValue, CallerType aCallerType)
|
||||
{
|
||||
if (!aReturnValue) {
|
||||
PreventDefaultInternal(aCallerType == CallerType::System);
|
||||
}
|
||||
}
|
||||
|
||||
double
|
||||
Event::TimeStamp()
|
||||
{
|
||||
|
|
|
@ -281,6 +281,10 @@ public:
|
|||
return mEvent->mFlags.mMultipleActionsPrevented;
|
||||
}
|
||||
|
||||
bool ReturnValue(CallerType aCallerType) const;
|
||||
|
||||
void SetReturnValue(bool aReturnValue, CallerType aCallerType);
|
||||
|
||||
bool IsTrusted() const
|
||||
{
|
||||
return mEvent->IsTrusted();
|
||||
|
|
|
@ -37,6 +37,8 @@ interface Event {
|
|||
[Pure]
|
||||
readonly attribute boolean cancelable;
|
||||
[NeedsCallerType]
|
||||
attribute boolean returnValue;
|
||||
[NeedsCallerType]
|
||||
void preventDefault();
|
||||
[Pure, NeedsCallerType]
|
||||
readonly attribute boolean defaultPrevented;
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[AddEventListenerOptions-passive.html]
|
||||
[returnValue should be ignored if-and-only-if the passive option is true]
|
||||
expected: FAIL
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[Event-constructors.html]
|
||||
[Event constructors 2]
|
||||
expected: FAIL
|
||||
|
||||
[Event constructors 3]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[Event-defaultPrevented-after-dispatch.html]
|
||||
[Default prevention via returnValue]
|
||||
expected: FAIL
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[Event-initEvent.html]
|
||||
[Properties of initEvent(type, true, true)]
|
||||
expected: FAIL
|
||||
|
||||
[Properties of initEvent(type, true, false)]
|
||||
expected: FAIL
|
||||
|
||||
[Properties of initEvent(type, false, true)]
|
||||
expected: FAIL
|
||||
|
||||
[Properties of initEvent(type, false, false)]
|
||||
expected: FAIL
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
[Event-returnValue.html]
|
||||
[When an event is created, returnValue should be initialized to true.]
|
||||
expected: FAIL
|
||||
|
||||
[preventDefault() should not change returnValue if cancelable is false.]
|
||||
expected: FAIL
|
||||
|
||||
[returnValue=false should have no effect if cancelable is false.]
|
||||
expected: FAIL
|
||||
|
||||
[preventDefault() should change returnValue if cancelable is true.]
|
||||
expected: FAIL
|
||||
|
||||
[initEvent should unset returnValue.]
|
||||
expected: FAIL
|
||||
|
||||
[returnValue=true should have no effect once the canceled flag was set.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[EventTarget-dispatchEvent-returnvalue.html]
|
||||
[Return value of EventTarget.dispatchEvent() affected by preventDefault().]
|
||||
expected: FAIL
|
||||
|
||||
[Return value of EventTarget.dispatchEvent() affected by returnValue.]
|
||||
expected: FAIL
|
||||
|
Загрузка…
Ссылка в новой задаче