diff --git a/widget/xpwidgets/APZCCallbackHelper.cpp b/widget/xpwidgets/APZCCallbackHelper.cpp index 4b3302636f8..d50f520b83d 100644 --- a/widget/xpwidgets/APZCCallbackHelper.cpp +++ b/widget/xpwidgets/APZCCallbackHelper.cpp @@ -133,5 +133,17 @@ APZCCallbackHelper::GetDOMWindowUtils(nsIContent* aContent) return utils.forget(); } +bool +APZCCallbackHelper::GetScrollIdentifiers(nsIContent* aContent, + uint32_t* aPresShellIdOut, + FrameMetrics::ViewID* aViewIdOut) +{ + if (!nsLayoutUtils::FindIDFor(aContent, aViewIdOut)) { + return false; + } + nsCOMPtr utils = GetDOMWindowUtils(aContent); + return utils && (utils->GetPresShellId(aPresShellIdOut) == NS_OK); +} + } } diff --git a/widget/xpwidgets/APZCCallbackHelper.h b/widget/xpwidgets/APZCCallbackHelper.h index dbbf09729ef..8b6af6d69e3 100644 --- a/widget/xpwidgets/APZCCallbackHelper.h +++ b/widget/xpwidgets/APZCCallbackHelper.h @@ -48,6 +48,12 @@ public: /* Get the DOMWindowUtils for the window corresponding to the givent content element. This might be an iframe inside the tab, for instance. */ static already_AddRefed GetDOMWindowUtils(nsIContent* aContent); + + /* Get the presShellId and view ID for the given content element, if they can be + found. Returns false if the values could not be found, true if they could. */ + static bool GetScrollIdentifiers(nsIContent* aContent, + uint32_t* aPresShellIdOut, + FrameMetrics::ViewID* aViewIdOut); }; }