1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 /* base class for rendering objects that need child lists but behave like leaf
8  */
9 
10 #ifndef nsAtomicContainerFrame_h___
11 #define nsAtomicContainerFrame_h___
12 
13 #include "nsContainerFrame.h"
14 
15 /**
16  * This class is for frames which need child lists but act like a leaf
17  * frame. In general, all frames of elements laid out according to the
18  * CSS box model would need child list for ::backdrop in case they are
19  * in fullscreen, while some of them still want leaf frame behavior.
20  */
21 class nsAtomicContainerFrame : public nsContainerFrame {
22  public:
NS_DECL_ABSTRACT_FRAME(nsAtomicContainerFrame)23   NS_DECL_ABSTRACT_FRAME(nsAtomicContainerFrame)
24 
25   // Bypass the nsContainerFrame/nsSplittableFrame impl of the following
26   // methods so we behave like a leaf frame.
27   FrameSearchResult PeekOffsetNoAmount(bool aForward,
28                                        int32_t* aOffset) override {
29     return nsIFrame::PeekOffsetNoAmount(aForward, aOffset);
30   }
31   FrameSearchResult PeekOffsetCharacter(
32       bool aForward, int32_t* aOffset,
33       PeekOffsetCharacterOptions aOptions =
34           PeekOffsetCharacterOptions()) override {
35     return nsIFrame::PeekOffsetCharacter(aForward, aOffset, aOptions);
36   }
37 
38  protected:
nsAtomicContainerFrame(ComputedStyle * aStyle,nsPresContext * aPresContext,ClassID aID)39   nsAtomicContainerFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
40                          ClassID aID)
41       : nsContainerFrame(aStyle, aPresContext, aID) {}
42 };
43 
44 #endif  // nsAtomicContainerFrame_h___
45