Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/generic/nsRubyFrame.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" */
8
9
#ifndef nsRubyFrame_h___
10
#define nsRubyFrame_h___
11
12
#include "nsInlineFrame.h"
13
#include "RubyUtils.h"
14
15
/**
16
 * Factory function.
17
 * @return a newly allocated nsRubyFrame (infallible)
18
 */
19
nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
20
                                  mozilla::ComputedStyle* aStyle);
21
22
class nsRubyFrame final : public nsInlineFrame
23
{
24
public:
25
  NS_DECL_FRAMEARENA_HELPERS(nsRubyFrame)
26
  NS_DECL_QUERYFRAME
27
28
  // nsIFrame overrides
29
  virtual bool IsFrameOfType(uint32_t aFlags) const override;
30
  virtual void AddInlineMinISize(gfxContext *aRenderingContext,
31
                                 InlineMinISizeData *aData) override;
32
  virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
33
                                  InlinePrefISizeData *aData) override;
34
  virtual void Reflow(nsPresContext* aPresContext,
35
                      ReflowOutput& aDesiredSize,
36
                      const ReflowInput& aReflowInput,
37
                      nsReflowStatus& aStatus) override;
38
39
#ifdef DEBUG_FRAME_DUMP
40
  virtual nsresult GetFrameName(nsAString& aResult) const override;
41
#endif
42
43
0
  mozilla::RubyBlockLeadings GetBlockLeadings() const {
44
0
    return mLeadings;
45
0
  }
46
47
protected:
48
  friend nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
49
                                           ComputedStyle* aStyle);
50
  explicit nsRubyFrame(ComputedStyle* aStyle)
51
    : nsInlineFrame(aStyle, kClassID)
52
0
  {}
53
54
  void ReflowSegment(nsPresContext* aPresContext,
55
                     const ReflowInput& aReflowInput,
56
                     nsRubyBaseContainerFrame* aBaseContainer,
57
                     nsReflowStatus& aStatus);
58
59
  nsRubyBaseContainerFrame* PullOneSegment(const nsLineLayout* aLineLayout,
60
                                           ContinuationTraversingState& aState);
61
62
  // The leadings required to put the annotations. They are dummy-
63
  // initialized to 0, and get meaningful values at first reflow.
64
  mozilla::RubyBlockLeadings mLeadings;
65
};
66
67
#endif /* nsRubyFrame_h___ */