Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/forms/nsFieldSetFrame.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
#ifndef nsFieldSetFrame_h___
8
#define nsFieldSetFrame_h___
9
10
#include "mozilla/Attributes.h"
11
#include "ImgDrawResult.h"
12
#include "nsContainerFrame.h"
13
14
class nsFieldSetFrame final : public nsContainerFrame
15
{
16
  typedef mozilla::image::ImgDrawResult ImgDrawResult;
17
18
public:
19
  NS_DECL_FRAMEARENA_HELPERS(nsFieldSetFrame)
20
21
  explicit nsFieldSetFrame(ComputedStyle* aStyle);
22
23
  nscoord
24
    GetIntrinsicISize(gfxContext* aRenderingContext,
25
                      nsLayoutUtils::IntrinsicISizeType);
26
  virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
27
  virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
28
29
  /**
30
   * The area to paint box-shadows around.  It's the border rect except
31
   * when there's a <legend> we offset the y-position to the center of it.
32
   */
33
  virtual nsRect VisualBorderRectRelativeToSelf() const override;
34
35
  virtual void Reflow(nsPresContext* aPresContext,
36
                      ReflowOutput& aDesiredSize,
37
                      const ReflowInput& aReflowInput,
38
                      nsReflowStatus& aStatus) override;
39
40
  nscoord GetLogicalBaseline(mozilla::WritingMode aWM) const override;
41
  bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
42
                                nscoord* aBaseline) const override;
43
  bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
44
                                 BaselineSharingGroup aBaselineGroup,
45
                                 nscoord* aBaseline) const override;
46
47
  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
48
                                const nsDisplayListSet& aLists) override;
49
50
  ImgDrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
51
                         gfxContext& aRenderingContext,
52
                         nsPoint aPt, const nsRect& aDirtyRect);
53
54
#ifdef DEBUG
55
  virtual void SetInitialChildList(ChildListID    aListID,
56
                                   nsFrameList&   aChildList) override;
57
  virtual void AppendFrames(ChildListID    aListID,
58
                            nsFrameList&   aFrameList) override;
59
  virtual void InsertFrames(ChildListID    aListID,
60
                            nsIFrame*      aPrevFrame,
61
                            nsFrameList&   aFrameList) override;
62
  virtual void RemoveFrame(ChildListID    aListID,
63
                           nsIFrame*      aOldFrame) override;
64
#endif
65
66
  virtual bool IsFrameOfType(uint32_t aFlags) const override
67
0
  {
68
0
    return nsContainerFrame::IsFrameOfType(aFlags &
69
0
             ~nsIFrame::eCanContainOverflowContainers);
70
0
  }
71
  virtual nsIScrollableFrame* GetScrollTargetFrame() override
72
0
  {
73
0
    return do_QueryFrame(GetInner());
74
0
  }
75
76
  // Return the block wrapper around our kids.
77
  void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
78
79
#ifdef ACCESSIBILITY
80
  virtual mozilla::a11y::AccType AccessibleType() override;
81
#endif
82
83
#ifdef DEBUG_FRAME_DUMP
84
  virtual nsresult GetFrameName(nsAString& aResult) const override {
85
    return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult);
86
  }
87
#endif
88
89
  /**
90
   * Return the anonymous frame that contains all descendants except
91
   * the legend frame.  This is currently always a block frame with
92
   * pseudo nsCSSAnonBoxes::fieldsetContent() -- this may change in the
93
   * future when we add support for CSS overflow for <fieldset>.  This really
94
   * can't return null, though callers seem to feel that it can.
95
   */
96
  nsIFrame* GetInner() const;
97
98
  /**
99
   * Return the frame that represents the legend if any.  This may be
100
   * a nsLegendFrame or a nsHTMLScrollFrame with the nsLegendFrame as the
101
   * scrolled frame (aka content insertion frame).
102
   */
103
  nsIFrame* GetLegend() const;
104
105
protected:
106
  mozilla::LogicalRect mLegendRect;
107
  nscoord   mLegendSpace;
108
};
109
110
#endif // nsFieldSetFrame_h___