Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/generic/nsRubyTextContainerFrame.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-text-container" */
8
9
#ifndef nsRubyTextContainerFrame_h___
10
#define nsRubyTextContainerFrame_h___
11
12
#include "nsBlockFrame.h"
13
14
/**
15
 * Factory function.
16
 * @return a newly allocated nsRubyTextContainerFrame (infallible)
17
 */
18
nsContainerFrame* NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
19
                                               mozilla::ComputedStyle* aStyle);
20
21
class nsRubyTextContainerFrame final : public nsContainerFrame
22
{
23
public:
24
  NS_DECL_FRAMEARENA_HELPERS(nsRubyTextContainerFrame)
25
  NS_DECL_QUERYFRAME
26
27
  // nsIFrame overrides
28
  virtual bool IsFrameOfType(uint32_t aFlags) const override;
29
  virtual void Reflow(nsPresContext* aPresContext,
30
                      ReflowOutput& aDesiredSize,
31
                      const ReflowInput& aReflowInput,
32
                      nsReflowStatus& aStatus) override;
33
34
#ifdef DEBUG_FRAME_DUMP
35
  virtual nsresult GetFrameName(nsAString& aResult) const override;
36
#endif
37
38
  // nsContainerFrame overrides
39
  virtual void SetInitialChildList(ChildListID aListID,
40
                                   nsFrameList& aChildList) override;
41
  virtual void AppendFrames(ChildListID aListID,
42
                            nsFrameList& aFrameList) override;
43
  virtual void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
44
                            nsFrameList& aFrameList) override;
45
  virtual void RemoveFrame(ChildListID aListID,
46
                           nsIFrame* aOldFrame) override;
47
48
  bool IsSpanContainer() const
49
0
  {
50
0
    return GetStateBits() & NS_RUBY_TEXT_CONTAINER_IS_SPAN;
51
0
  }
52
53
protected:
54
  friend nsContainerFrame*
55
    NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
56
                                 ComputedStyle* aStyle);
57
58
  explicit nsRubyTextContainerFrame(ComputedStyle* aStyle)
59
    : nsContainerFrame(aStyle, kClassID)
60
    , mISize(0)
61
0
  {}
62
63
  void UpdateSpanFlag();
64
65
  friend class nsRubyBaseContainerFrame;
66
0
  void SetISize(nscoord aISize) { mISize = aISize; }
67
68
  // The intended inline size of the ruby text container. It is set by
69
  // the corresponding ruby base container when the segment is reflowed,
70
  // and used when the ruby text container is reflowed by its parent.
71
  nscoord mISize;
72
};
73
74
#endif /* nsRubyTextContainerFrame_h___ */