michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: #ifndef __mozilla_widget_ContentHelper_h__ michael@0: #define __mozilla_widget_ContentHelper_h__ michael@0: michael@0: #include "nsIFrame.h" michael@0: #include "nsIWidget.h" michael@0: #include "mozilla/layers/APZCTreeManager.h" michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: michael@0: /* michael@0: * Allow different platform widgets to access Content/DOM stuff. michael@0: */ michael@0: class ContentHelper michael@0: { michael@0: typedef mozilla::layers::AllowedTouchBehavior AllowedTouchBehavior; michael@0: typedef uint32_t TouchBehaviorFlags; michael@0: michael@0: private: michael@0: static uint32_t GetTouchActionFromFrame(nsIFrame* aFrame); michael@0: static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, TouchBehaviorFlags& aOutBehavior); michael@0: michael@0: public: michael@0: /* michael@0: * Performs hit testing on content, finds frame that corresponds to the aPoint and retrieves michael@0: * touch-action css property value from it according the rules specified in the spec: michael@0: * http://www.w3.org/TR/pointerevents/#the-touch-action-css-property. michael@0: */ michael@0: static TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const nsIntPoint& aPoint); michael@0: }; michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif /*__mozilla_widget_ContentHelper_h__ */