diff -r 000000000000 -r 6474c204b198 layout/base/PositionedEventTargeting.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layout/base/PositionedEventTargeting.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,402 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "PositionedEventTargeting.h" + +#include "mozilla/EventListenerManager.h" +#include "mozilla/EventStates.h" +#include "mozilla/MouseEvents.h" +#include "mozilla/Preferences.h" +#include "nsLayoutUtils.h" +#include "nsGkAtoms.h" +#include "nsPrintfCString.h" +#include "mozilla/dom/Element.h" +#include "nsRegion.h" +#include "nsDeviceContext.h" +#include "nsIFrame.h" +#include + +namespace mozilla { + +/* + * The basic goal of FindFrameTargetedByInputEvent() is to find a good + * target element that can respond to mouse events. Both mouse events and touch + * events are targeted at this element. Note that even for touch events, we + * check responsiveness to mouse events. We assume Web authors + * designing for touch events will take their own steps to account for + * inaccurate touch events. + * + * IsElementClickable() encapsulates the heuristic that determines whether an + * element is expected to respond to mouse events. An element is deemed + * "clickable" if it has registered listeners for "click", "mousedown" or + * "mouseup", or is on a whitelist of element tags (,