mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1219898 - Remove unneccessary gPreventMouseEvents flag. r=smaug
--HG-- extra : commitid : AWJfSunbegp
This commit is contained in:
parent
b4cf5cc4aa
commit
914afa45da
@ -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 },
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ public:
|
||||
bool& aIsHandlingUserInput,
|
||||
nsCOMPtr<nsIContent>& aCurrentEventContent);
|
||||
|
||||
static bool gPreventMouseEvents;
|
||||
static nsRefPtrHashtable<nsUint32HashKey, mozilla::dom::Touch>* gCaptureTouchList;
|
||||
|
||||
private:
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user