1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef __mozilla_layers_TouchActionHelper_h__
8 #define __mozilla_layers_TouchActionHelper_h__
9 
10 #include "mozilla/layers/LayersTypes.h"  // for TouchBehaviorFlags
11 #include "RelativeTo.h"                  // for RelativeTo
12 
13 class nsIFrame;
14 class nsIWidget;
15 
16 namespace mozilla {
17 namespace layers {
18 
19 /*
20  * Helper class to figure out the allowed touch behavior for frames, as per
21  * the touch-action spec.
22  */
23 class TouchActionHelper {
24  public:
25   /*
26    * Performs hit testing on content, finds frame that corresponds to the aPoint
27    * and retrieves touch-action css property value from it according the rules
28    * specified in the spec:
29    * http://www.w3.org/TR/pointerevents/#the-touch-action-css-property.
30    */
31   static TouchBehaviorFlags GetAllowedTouchBehavior(
32       nsIWidget* aWidget, RelativeTo aRootFrame,
33       const LayoutDeviceIntPoint& aPoint);
34 };
35 
36 }  // namespace layers
37 }  // namespace mozilla
38 
39 #endif /*__mozilla_layers_TouchActionHelper_h__ */
40