Bug 1219898 - Remove unneccessary gPreventMouseEvents flag. r=smaug

--HG--
extra : commitid : AWJfSunbegp
This commit is contained in:
Kartikaya Gupta 2015-10-30 22:22:32 -04:00
parent b4cf5cc4aa
commit 914afa45da
4 changed files with 5 additions and 19 deletions

View File

@ -413,13 +413,13 @@ function testPreventDefault() {
{ name: "touchmove", prevent: false },
{ name: "touchend", prevent: false }],
[{ name: "touchstart", prevent: true, doPrevent: true },
{ name: "touchmove", prevent: true },
{ name: "touchmove", prevent: true },
{ name: "touchend", prevent: true }],
{ name: "touchmove", prevent: false },
{ name: "touchmove", prevent: false },
{ name: "touchend", prevent: false }],
[{ name: "touchstart", prevent: false },
{ name: "touchmove", prevent: true, doPrevent: true },
{ name: "touchmove", prevent: true },
{ name: "touchend", prevent: true }],
{ name: "touchmove", prevent: false },
{ name: "touchend", prevent: false }],
[{ name: "touchstart", prevent: false },
{ name: "touchmove", prevent: false },
{ name: "touchmove", prevent: false, doPrevent: true },

View File

@ -8,7 +8,6 @@
#include "TouchManager.h"
#include "nsPresShell.h"
bool TouchManager::gPreventMouseEvents = false;
nsRefPtrHashtable<nsUint32HashKey, dom::Touch>* TouchManager::gCaptureTouchList;
/*static*/ void
@ -182,9 +181,6 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
}
}
} else {
if (gPreventMouseEvents) {
*aStatus = nsEventStatus_eConsumeNoDefault;
}
return false;
}
}

View File

@ -30,7 +30,6 @@ public:
bool& aIsHandlingUserInput,
nsCOMPtr<nsIContent>& aCurrentEventContent);
static bool gPreventMouseEvents;
static nsRefPtrHashtable<nsUint32HashKey, mozilla::dom::Touch>* gCaptureTouchList;
private:

View File

@ -7315,8 +7315,6 @@ PresShell::HandleEvent(nsIFrame* aFrame,
nsCOMPtr<nsIContent> anyTarget;
if (TouchManager::gCaptureTouchList->Count() > 0 && touchEvent->touches.Length() > 1) {
TouchManager::gCaptureTouchList->Enumerate(&FindAnyTarget, &anyTarget);
} else {
TouchManager::gPreventMouseEvents = false;
}
for (int32_t i = touchEvent->touches.Length(); i; ) {
@ -8136,14 +8134,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
}
}
// if preventDefault was called on any of the events dispatched
// and this is touchstart, or the first touchmove, widget should consume
// other events that would be associated with this touch session
if (preventDefault && canPrevent) {
TouchManager::gPreventMouseEvents = true;
}
if (TouchManager::gPreventMouseEvents) {
*aStatus = nsEventStatus_eConsumeNoDefault;
} else {
*aStatus = nsEventStatus_eIgnore;