Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / layout / generic / nsRubyTextContainerFrame.h
blob10ef1940002a7cf565d8715d91fd138774450183
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 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
32 const ReflowInput& aReflowInput,
33 nsReflowStatus& aStatus) override;
35 #ifdef DEBUG_FRAME_DUMP
36 nsresult GetFrameName(nsAString& aResult) const override;
37 #endif
39 // nsContainerFrame overrides
40 void SetInitialChildList(ChildListID aListID,
41 nsFrameList&& aChildList) override;
42 void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override;
43 void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
44 const nsLineList::iterator* aPrevFrameLine,
45 nsFrameList&& aFrameList) override;
46 void RemoveFrame(DestroyContext&, ChildListID, nsIFrame*) override;
48 bool IsSpanContainer() const {
49 return HasAnyStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN);
52 protected:
53 friend nsContainerFrame* NS_NewRubyTextContainerFrame(
54 mozilla::PresShell* aPresShell, ComputedStyle* aStyle);
56 explicit nsRubyTextContainerFrame(ComputedStyle* aStyle,
57 nsPresContext* aPresContext)
58 : nsContainerFrame(aStyle, aPresContext, kClassID), mISize(0) {}
60 void UpdateSpanFlag();
62 friend class nsRubyBaseContainerFrame;
63 void SetISize(nscoord aISize) { mISize = aISize; }
65 // The intended inline size of the ruby text container. It is set by
66 // the corresponding ruby base container when the segment is reflowed,
67 // and used when the ruby text container is reflowed by its parent.
68 nscoord mISize;
71 #endif /* nsRubyTextContainerFrame_h___ */