Bug 732052 - Internal touch event listeners should not enable slow path. r=smaug
authorWes Johnston <wjohnston@mozilla.com>
Mon, 09 Jul 2012 09:55:37 -0700
changeset 101829 db08a9bc1557f8be833ae9b0e7873035ab512e93
parent 101828 207c9718fe3f2957866e81baa89895e46acb3f3d
child 101830 d8063abe193f5a7fab13cb1d50a0a94739c756c8
push idunknown
push userunknown
push dateunknown
reviewerssmaug
bugs732052
milestone16.0a1
Bug 732052 - Internal touch event listeners should not enable slow path. r=smaug
content/events/src/nsEventListenerManager.cpp
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -277,17 +277,19 @@ nsEventListenerManager::AddEventListener
              (aTypeAtom == nsGkAtoms::ontouchstart ||
               aTypeAtom == nsGkAtoms::ontouchend ||
               aTypeAtom == nsGkAtoms::ontouchmove ||
               aTypeAtom == nsGkAtoms::ontouchenter ||
               aTypeAtom == nsGkAtoms::ontouchleave ||
               aTypeAtom == nsGkAtoms::ontouchcancel)) {
     mMayHaveTouchEventListener = true;
     nsPIDOMWindow* window = GetInnerWindowForTarget();
-    if (window)
+    // we don't want touchevent listeners added by scrollbars to flip this flag
+    // so we ignore listeners created with system event flag
+    if (window && !(aFlags & NS_EVENT_FLAG_SYSTEM_EVENT))
       window->SetHasTouchEventListeners();
   } else if (aTypeAtom == nsGkAtoms::onmouseenter ||
              aTypeAtom == nsGkAtoms::onmouseleave) {
     mMayHaveMouseEnterLeaveEventListener = true;
     nsPIDOMWindow* window = GetInnerWindowForTarget();
     if (window) {
 #ifdef DEBUG
       nsCOMPtr<nsIDocument> d = do_QueryInterface(window->GetExtantDocument());