Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 : #ifndef nsLeafBoxFrame_h___
6 : #define nsLeafBoxFrame_h___
7 :
8 : #include "mozilla/Attributes.h"
9 : #include "nsLeafFrame.h"
10 : #include "nsBox.h"
11 :
12 34 : class nsLeafBoxFrame : public nsLeafFrame
13 : {
14 : public:
15 67 : NS_DECL_FRAMEARENA_HELPERS(nsLeafBoxFrame)
16 :
17 : friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
18 :
19 : virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
20 : virtual nsSize GetXULMinSize(nsBoxLayoutState& aState) override;
21 : virtual nsSize GetXULMaxSize(nsBoxLayoutState& aState) override;
22 : virtual nscoord GetXULFlex() override;
23 : virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aState) override;
24 :
25 1635 : virtual bool IsFrameOfType(uint32_t aFlags) const override
26 : {
27 : // This is bogus, but it's what we've always done.
28 : // Note that nsLeafFrame is also eReplacedContainsBlock.
29 1635 : return nsLeafFrame::IsFrameOfType(aFlags &
30 1635 : ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
31 : }
32 :
33 : #ifdef DEBUG_FRAME_DUMP
34 : virtual nsresult GetFrameName(nsAString& aResult) const override;
35 : #endif
36 :
37 : // nsIHTMLReflow overrides
38 :
39 : virtual void MarkIntrinsicISizesDirty() override;
40 : virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
41 : virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
42 :
43 : // Our auto size is that provided by nsFrame, not nsLeafFrame
44 : virtual mozilla::LogicalSize
45 : ComputeAutoSize(gfxContext* aRenderingContext,
46 : mozilla::WritingMode aWM,
47 : const mozilla::LogicalSize& aCBSize,
48 : nscoord aAvailableISize,
49 : const mozilla::LogicalSize& aMargin,
50 : const mozilla::LogicalSize& aBorder,
51 : const mozilla::LogicalSize& aPadding,
52 : ComputeSizeFlags aFlags) override;
53 :
54 : virtual void Reflow(nsPresContext* aPresContext,
55 : ReflowOutput& aDesiredSize,
56 : const ReflowInput& aReflowInput,
57 : nsReflowStatus& aStatus) override;
58 :
59 : virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) override;
60 :
61 : virtual void Init(nsIContent* aContent,
62 : nsContainerFrame* aParent,
63 : nsIFrame* asPrevInFlow) override;
64 :
65 : virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
66 : const nsRect& aDirtyRect,
67 : const nsDisplayListSet& aLists) override;
68 :
69 : virtual nsresult AttributeChanged(int32_t aNameSpaceID,
70 : nsIAtom* aAttribute,
71 : int32_t aModType) override;
72 :
73 141 : virtual bool ComputesOwnOverflowArea() override { return false; }
74 :
75 : protected:
76 :
77 : NS_IMETHOD DoXULLayout(nsBoxLayoutState& aState) override;
78 :
79 : #ifdef DEBUG_LAYOUT
80 : virtual void GetBoxName(nsAutoString& aName) override;
81 : #endif
82 :
83 : virtual nscoord GetIntrinsicISize() override;
84 :
85 90 : explicit nsLeafBoxFrame(nsStyleContext* aContext, ClassID aID = kClassID)
86 90 : : nsLeafFrame(aContext, aID)
87 90 : {}
88 :
89 : private:
90 :
91 : void UpdateMouseThrough();
92 :
93 :
94 : }; // class nsLeafBoxFrame
95 :
96 : #endif /* nsLeafBoxFrame_h___ */
|