nsAtomicContainerFrame.h 1.6 KB

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