зеркало из https://github.com/mozilla/gecko-dev.git
Bug 910532 part 1 - Add flag to indicate prevent default from chrome. r=smaug
--HG-- extra : source : 0c9290ce08d739394df1787a05beff8dfddb1b4e
This commit is contained in:
Родитель
33a1219ee6
Коммит
589c303536
|
@ -509,6 +509,8 @@ Event::PreventDefaultInternal(bool aCalledByDefaultHandler)
|
|||
// must be true when web apps check it after they call preventDefault().
|
||||
if (!aCalledByDefaultHandler) {
|
||||
mEvent->mFlags.mDefaultPreventedByContent = true;
|
||||
} else {
|
||||
mEvent->mFlags.mDefaultPreventedByChrome = true;
|
||||
}
|
||||
|
||||
if (!IsTrusted()) {
|
||||
|
@ -569,6 +571,8 @@ Event::InitEvent(const nsAString& aEventTypeArg,
|
|||
mEvent->mFlags.mCancelable = aCancelableArg;
|
||||
|
||||
mEvent->mFlags.mDefaultPrevented = false;
|
||||
mEvent->mFlags.mDefaultPreventedByContent = false;
|
||||
mEvent->mFlags.mDefaultPreventedByChrome = false;
|
||||
|
||||
// Clearing the old targets, so that the event is targeted correctly when
|
||||
// re-dispatching it.
|
||||
|
|
|
@ -495,6 +495,10 @@ public:
|
|||
// consumed by content.
|
||||
// Note that mDefaultPrevented must be true when this is true.
|
||||
bool mDefaultPreventedByContent : 1;
|
||||
// If mDefaultPreventedByChrome is true, the event has been
|
||||
// consumed by chrome.
|
||||
// Note that mDefaultPrevented must be true when this is true.
|
||||
bool mDefaultPreventedByChrome : 1;
|
||||
// mMultipleActionsPrevented may be used when default handling don't want to
|
||||
// be prevented, but only one of the event targets should handle the event.
|
||||
// For example, when a <label> element is in another <label> element and
|
||||
|
|
Загрузка…
Ссылка в новой задаче