Issue #2472 - Part 4: Make TopLayer{Push|Pop} part of nsIDocument.

This commit is contained in:
Moonchild 2024-05-04 18:16:28 +02:00 committed by roytam1
commit 7a04afab4a
2 changed files with 11 additions and 2 deletions

View file

@ -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<bool(Element*)> aPredicateFunc);
Element* TopLayerPop(FunctionRef<bool(Element*)> aPredicateFunc) override;
// Pops the fullscreen element from the top layer and clears its
// fullscreen flag.

View file

@ -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 <dialog>.
*/
virtual bool TopLayerPush(Element* aElement) = 0;
virtual Element* TopLayerPop(FunctionRef<bool(Element*)> aPredicateFunc) = 0;
/**
* Synchronously cleans up the fullscreen state on the given document.