Bug 1591736 - Fix AddonManagerWebAPI::IsAPIEnabled in out-of-process iframes r=mixedpuppy
[gecko.git] / layout / xul / nsLeafBoxFrame.h
blobe00d643c2fdd140c033387ca67046b359c53c641
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 #ifndef nsLeafBoxFrame_h___
7 #define nsLeafBoxFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsLeafFrame.h"
11 #include "nsBox.h"
13 namespace mozilla {
14 class PresShell;
15 } // namespace mozilla
17 class nsLeafBoxFrame : public nsLeafFrame {
18 public:
19 NS_DECL_FRAMEARENA_HELPERS(nsLeafBoxFrame)
21 friend nsIFrame* NS_NewLeafBoxFrame(mozilla::PresShell* aPresShell,
22 ComputedStyle* aStyle);
24 virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
25 virtual nsSize GetXULMinSize(nsBoxLayoutState& aState) override;
26 virtual nsSize GetXULMaxSize(nsBoxLayoutState& aState) override;
27 virtual nscoord GetXULFlex() override;
28 virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aState) override;
30 virtual bool IsFrameOfType(uint32_t aFlags) const override {
31 // This is bogus, but it's what we've always done.
32 // Note that nsLeafFrame is also eReplacedContainsBlock.
33 return nsLeafFrame::IsFrameOfType(
34 aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock |
35 nsIFrame::eXULBox));
38 #ifdef DEBUG_FRAME_DUMP
39 virtual nsresult GetFrameName(nsAString& aResult) const override;
40 #endif
42 // nsIHTMLReflow overrides
44 virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
45 virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
47 // Our auto size is that provided by nsFrame, not nsLeafFrame
48 virtual mozilla::LogicalSize ComputeAutoSize(
49 gfxContext* aRenderingContext, mozilla::WritingMode aWM,
50 const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
51 const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorder,
52 const mozilla::LogicalSize& aPadding, ComputeSizeFlags aFlags) override;
54 virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
55 const ReflowInput& aReflowInput,
56 nsReflowStatus& aStatus) override;
58 virtual nsresult CharacterDataChanged(
59 const CharacterDataChangeInfo&) override;
61 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
62 nsIFrame* asPrevInFlow) override;
64 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
65 const nsDisplayListSet& aLists) override;
67 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
68 int32_t aModType) override;
70 virtual bool ComputesOwnOverflowArea() override { return false; }
72 protected:
73 NS_IMETHOD DoXULLayout(nsBoxLayoutState& aState) override;
75 virtual nscoord GetIntrinsicISize() override;
77 explicit nsLeafBoxFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
78 ClassID aID = kClassID)
79 : nsLeafFrame(aStyle, aPresContext, aID) {}
81 private:
82 void UpdateMouseThrough();
84 }; // class nsLeafBoxFrame
86 #endif /* nsLeafBoxFrame_h___ */