From 7a04afab4ab72301308ca293c43699c40e268baf Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 4 May 2024 18:16:28 +0200 Subject: [PATCH] Issue #2472 - Part 4: Make TopLayer{Push|Pop} part of nsIDocument. --- dom/base/nsDocument.h | 4 ++-- dom/base/nsIDocument.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index bb05a4fb9b..16b93d245d 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -904,11 +904,11 @@ public: void CleanupFullscreenState(); // Pushes aElement onto the top layer - bool TopLayerPush(Element* aElement); + bool TopLayerPush(Element* aElement) override; // Removes the topmost element which have aPredicate return true from the top // layer. The removed element, if any, is returned. - Element* TopLayerPop(FunctionRef aPredicateFunc); + Element* TopLayerPop(FunctionRef aPredicateFunc) override; // Pops the fullscreen element from the top layer and clears its // fullscreen flag. diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 81b5b51c8e..2a18c2259e 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -100,6 +100,8 @@ class nsIGlobalObject; class nsStyleSet; struct nsCSSSelectorList; +using mozilla::FunctionRef; + namespace mozilla { class CSSStyleSheet; class ErrorResult; @@ -1339,6 +1341,13 @@ public: * in this document. */ virtual void SetFullscreenRoot(nsIDocument* aRoot) = 0; + + /** + * Push elements to and pop elements from the top layer. + * Currently in use for fullscreen and modal version of . + */ + virtual bool TopLayerPush(Element* aElement) = 0; + virtual Element* TopLayerPop(FunctionRef aPredicateFunc) = 0; /** * Synchronously cleans up the fullscreen state on the given document.