Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef __mozilla_widget_ContentHelper_h__ |
michael@0 | 7 | #define __mozilla_widget_ContentHelper_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsIFrame.h" |
michael@0 | 10 | #include "nsIWidget.h" |
michael@0 | 11 | #include "mozilla/layers/APZCTreeManager.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace widget { |
michael@0 | 15 | |
michael@0 | 16 | /* |
michael@0 | 17 | * Allow different platform widgets to access Content/DOM stuff. |
michael@0 | 18 | */ |
michael@0 | 19 | class ContentHelper |
michael@0 | 20 | { |
michael@0 | 21 | typedef mozilla::layers::AllowedTouchBehavior AllowedTouchBehavior; |
michael@0 | 22 | typedef uint32_t TouchBehaviorFlags; |
michael@0 | 23 | |
michael@0 | 24 | private: |
michael@0 | 25 | static uint32_t GetTouchActionFromFrame(nsIFrame* aFrame); |
michael@0 | 26 | static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, TouchBehaviorFlags& aOutBehavior); |
michael@0 | 27 | |
michael@0 | 28 | public: |
michael@0 | 29 | /* |
michael@0 | 30 | * Performs hit testing on content, finds frame that corresponds to the aPoint and retrieves |
michael@0 | 31 | * touch-action css property value from it according the rules specified in the spec: |
michael@0 | 32 | * http://www.w3.org/TR/pointerevents/#the-touch-action-css-property. |
michael@0 | 33 | */ |
michael@0 | 34 | static TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const nsIntPoint& aPoint); |
michael@0 | 35 | }; |
michael@0 | 36 | |
michael@0 | 37 | } |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | #endif /*__mozilla_widget_ContentHelper_h__ */ |