/src/mozilla-central/layout/generic/nsRubyBaseContainerFrame.h
Line | Count | Source (jump to first uncovered line) |
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 | | /* rendering object for CSS "display: ruby-base-container" */ |
8 | | |
9 | | #ifndef nsRubyBaseContainerFrame_h___ |
10 | | #define nsRubyBaseContainerFrame_h___ |
11 | | |
12 | | #include "nsContainerFrame.h" |
13 | | #include "RubyUtils.h" |
14 | | |
15 | | /** |
16 | | * Factory function. |
17 | | * @return a newly allocated nsRubyBaseContainerFrame (infallible) |
18 | | */ |
19 | | nsContainerFrame* NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell, |
20 | | mozilla::ComputedStyle* aStyle); |
21 | | |
22 | | class nsRubyBaseContainerFrame final : public nsContainerFrame |
23 | | { |
24 | | public: |
25 | | NS_DECL_FRAMEARENA_HELPERS(nsRubyBaseContainerFrame) |
26 | | NS_DECL_QUERYFRAME |
27 | | |
28 | | // nsIFrame overrides |
29 | | virtual bool IsFrameOfType(uint32_t aFlags) const override; |
30 | | virtual bool CanContinueTextRun() const override; |
31 | | virtual void AddInlineMinISize(gfxContext *aRenderingContext, |
32 | | InlineMinISizeData *aData) override; |
33 | | virtual void AddInlinePrefISize(gfxContext *aRenderingContext, |
34 | | InlinePrefISizeData *aData) override; |
35 | | virtual mozilla::LogicalSize |
36 | | ComputeSize(gfxContext *aRenderingContext, |
37 | | mozilla::WritingMode aWritingMode, |
38 | | const mozilla::LogicalSize& aCBSize, |
39 | | nscoord aAvailableISize, |
40 | | const mozilla::LogicalSize& aMargin, |
41 | | const mozilla::LogicalSize& aBorder, |
42 | | const mozilla::LogicalSize& aPadding, |
43 | | ComputeSizeFlags aFlags) override; |
44 | | virtual void Reflow(nsPresContext* aPresContext, |
45 | | ReflowOutput& aDesiredSize, |
46 | | const ReflowInput& aReflowInput, |
47 | | nsReflowStatus& aStatus) override; |
48 | | |
49 | | virtual nscoord |
50 | | GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override; |
51 | | |
52 | | #ifdef DEBUG_FRAME_DUMP |
53 | | virtual nsresult GetFrameName(nsAString& aResult) const override; |
54 | | #endif |
55 | | |
56 | 0 | void UpdateDescendantLeadings(const mozilla::RubyBlockLeadings& aLeadings) { |
57 | 0 | mDescendantLeadings.Update(aLeadings); |
58 | 0 | } |
59 | 0 | mozilla::RubyBlockLeadings GetDescendantLeadings() const { |
60 | 0 | return mDescendantLeadings; |
61 | 0 | } |
62 | | |
63 | | protected: |
64 | | friend nsContainerFrame* |
65 | | NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell, |
66 | | ComputedStyle* aStyle); |
67 | | |
68 | | explicit nsRubyBaseContainerFrame(ComputedStyle* aStyle) |
69 | | : nsContainerFrame(aStyle, kClassID) |
70 | 0 | {} |
71 | | |
72 | | struct RubyReflowInput; |
73 | | nscoord ReflowColumns(const RubyReflowInput& aReflowInput, |
74 | | nsReflowStatus& aStatus); |
75 | | nscoord ReflowOneColumn(const RubyReflowInput& aReflowInput, |
76 | | uint32_t aColumnIndex, |
77 | | const mozilla::RubyColumn& aColumn, |
78 | | nsReflowStatus& aStatus); |
79 | | nscoord ReflowSpans(const RubyReflowInput& aReflowInput); |
80 | | |
81 | | struct PullFrameState; |
82 | | |
83 | | // Pull ruby base and corresponding ruby text frames from |
84 | | // continuations after them. |
85 | | void PullOneColumn(nsLineLayout* aLineLayout, |
86 | | PullFrameState& aPullFrameState, |
87 | | mozilla::RubyColumn& aColumn, |
88 | | bool& aIsComplete); |
89 | | |
90 | | nscoord mBaseline; |
91 | | |
92 | | // Leading produced by descendant ruby annotations. |
93 | | mozilla::RubyBlockLeadings mDescendantLeadings; |
94 | | }; |
95 | | |
96 | | #endif /* nsRubyBaseContainerFrame_h___ */ |