michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "PositionedEventTargeting.h" michael@0: michael@0: #include "mozilla/EventListenerManager.h" michael@0: #include "mozilla/EventStates.h" michael@0: #include "mozilla/MouseEvents.h" michael@0: #include "mozilla/Preferences.h" michael@0: #include "nsLayoutUtils.h" michael@0: #include "nsGkAtoms.h" michael@0: #include "nsPrintfCString.h" michael@0: #include "mozilla/dom/Element.h" michael@0: #include "nsRegion.h" michael@0: #include "nsDeviceContext.h" michael@0: #include "nsIFrame.h" michael@0: #include michael@0: michael@0: namespace mozilla { michael@0: michael@0: /* michael@0: * The basic goal of FindFrameTargetedByInputEvent() is to find a good michael@0: * target element that can respond to mouse events. Both mouse events and touch michael@0: * events are targeted at this element. Note that even for touch events, we michael@0: * check responsiveness to mouse events. We assume Web authors michael@0: * designing for touch events will take their own steps to account for michael@0: * inaccurate touch events. michael@0: * michael@0: * IsElementClickable() encapsulates the heuristic that determines whether an michael@0: * element is expected to respond to mouse events. An element is deemed michael@0: * "clickable" if it has registered listeners for "click", "mousedown" or michael@0: * "mouseup", or is on a whitelist of element tags (,