Bug 910532 part 1 - Add flag to indicate prevent default from chrome. r=smaug

--HG--
extra : source : 0c9290ce08d739394df1787a05beff8dfddb1b4e
This commit is contained in:
Xidorn Quan 2015-01-21 12:16:04 +11:00
Родитель 33a1219ee6
Коммит 589c303536
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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