Bug 1758813 [wpt PR 33142] - Implement RP sign out, a=testonly
[gecko.git] / layout / generic / nsRubyTextContainerFrame.h
blob90cf962f7f2acad94f0e059382001ea1ca4063dd
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/. */
7 /* rendering object for CSS "display: ruby-text-container" */
9 #ifndef nsRubyTextContainerFrame_h___
10 #define nsRubyTextContainerFrame_h___
12 #include "nsBlockFrame.h"
14 namespace mozilla {
15 class PresShell;
16 } // namespace mozilla
18 /**
19 * Factory function.
20 * @return a newly allocated nsRubyTextContainerFrame (infallible)
22 nsContainerFrame* NS_NewRubyTextContainerFrame(mozilla::PresShell* aPresShell,
23 mozilla::ComputedStyle* aStyle);
25 class nsRubyTextContainerFrame final : public nsContainerFrame {
26 public:
27 NS_DECL_FRAMEARENA_HELPERS(nsRubyTextContainerFrame)
28 NS_DECL_QUERYFRAME
30 // nsIFrame overrides
31 virtual bool IsFrameOfType(uint32_t aFlags) const override;
32 virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
33 const ReflowInput& aReflowInput,
34 nsReflowStatus& aStatus) override;
36 #ifdef DEBUG_FRAME_DUMP
37 virtual nsresult GetFrameName(nsAString& aResult) const override;
38 #endif
40 // nsContainerFrame overrides
41 virtual void SetInitialChildList(ChildListID aListID,
42 nsFrameList& aChildList) override;
43 virtual void AppendFrames(ChildListID aListID,
44 nsFrameList& aFrameList) override;
45 virtual void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
46 const nsLineList::iterator* aPrevFrameLine,
47 nsFrameList& aFrameList) override;
48 virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) override;
50 bool IsSpanContainer() const {
51 return HasAnyStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN);
54 protected:
55 friend nsContainerFrame* NS_NewRubyTextContainerFrame(
56 mozilla::PresShell* aPresShell, ComputedStyle* aStyle);
58 explicit nsRubyTextContainerFrame(ComputedStyle* aStyle,
59 nsPresContext* aPresContext)
60 : nsContainerFrame(aStyle, aPresContext, kClassID), mISize(0) {}
62 void UpdateSpanFlag();
64 friend class nsRubyBaseContainerFrame;
65 void SetISize(nscoord aISize) { mISize = aISize; }
67 // The intended inline size of the ruby text container. It is set by
68 // the corresponding ruby base container when the segment is reflowed,
69 // and used when the ruby text container is reflowed by its parent.
70 nscoord mISize;
73 #endif /* nsRubyTextContainerFrame_h___ */