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"
16 } // namespace mozilla
20 * @return a newly allocated nsRubyTextContainerFrame (infallible)
22 nsContainerFrame
* NS_NewRubyTextContainerFrame(mozilla::PresShell
* aPresShell
,
23 mozilla::ComputedStyle
* aStyle
);
25 class nsRubyTextContainerFrame final
: public nsContainerFrame
{
27 NS_DECL_FRAMEARENA_HELPERS(nsRubyTextContainerFrame
)
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
;
40 // nsContainerFrame overrides
41 void SetInitialChildList(ChildListID aListID
,
42 nsFrameList
&& aChildList
) override
;
43 void AppendFrames(ChildListID aListID
, nsFrameList
&& aFrameList
) override
;
44 void InsertFrames(ChildListID aListID
, nsIFrame
* aPrevFrame
,
45 const nsLineList::iterator
* aPrevFrameLine
,
46 nsFrameList
&& aFrameList
) override
;
47 virtual void RemoveFrame(ChildListID aListID
, nsIFrame
* aOldFrame
) override
;
49 bool IsSpanContainer() const {
50 return HasAnyStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN
);
54 friend nsContainerFrame
* NS_NewRubyTextContainerFrame(
55 mozilla::PresShell
* aPresShell
, ComputedStyle
* aStyle
);
57 explicit nsRubyTextContainerFrame(ComputedStyle
* aStyle
,
58 nsPresContext
* aPresContext
)
59 : nsContainerFrame(aStyle
, aPresContext
, kClassID
), mISize(0) {}
61 void UpdateSpanFlag();
63 friend class nsRubyBaseContainerFrame
;
64 void SetISize(nscoord aISize
) { mISize
= aISize
; }
66 // The intended inline size of the ruby text container. It is set by
67 // the corresponding ruby base container when the segment is reflowed,
68 // and used when the ruby text container is reflowed by its parent.
72 #endif /* nsRubyTextContainerFrame_h___ */