Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_f...
[gecko.git] / layout / forms / nsProgressFrame.h
blobf8917ba4f2d600bda814fb578777c999b933603e
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/. */
7 #ifndef nsProgressFrame_h___
8 #define nsProgressFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsContainerFrame.h"
12 #include "nsIAnonymousContentCreator.h"
13 #include "nsCOMPtr.h"
15 namespace mozilla {
16 enum class PseudoStyleType : uint8_t;
17 } // namespace mozilla
19 class nsProgressFrame final : public nsContainerFrame,
20 public nsIAnonymousContentCreator {
21 using Element = mozilla::dom::Element;
23 public:
24 NS_DECL_QUERYFRAME
25 NS_DECL_FRAMEARENA_HELPERS(nsProgressFrame)
27 explicit nsProgressFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
28 virtual ~nsProgressFrame();
30 void Destroy(DestroyContext&) override;
32 void BuildDisplayList(nsDisplayListBuilder* aBuilder,
33 const nsDisplayListSet& aLists) override;
35 void Reflow(nsPresContext*, ReflowOutput&, const ReflowInput&,
36 nsReflowStatus&) override;
38 #ifdef DEBUG_FRAME_DUMP
39 nsresult GetFrameName(nsAString& aResult) const override {
40 return MakeFrameName(u"Progress"_ns, aResult);
42 #endif
44 // nsIAnonymousContentCreator
45 nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
46 void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
47 uint32_t aFilter) override;
49 nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
50 int32_t aModType) override;
52 nscoord GetMinISize(gfxContext* aRenderingContext) override;
53 nscoord GetPrefISize(gfxContext* aRenderingContext) override;
55 /**
56 * Returns whether the frame and its child should use the native style.
58 bool ShouldUseNativeStyle() const;
60 protected:
61 // Helper function to reflow a child frame.
62 void ReflowChildFrame(nsIFrame* aChild, nsPresContext* aPresContext,
63 const ReflowInput& aReflowInput,
64 const mozilla::LogicalSize& aParentContentBoxSize,
65 nsReflowStatus& aStatus);
67 /**
68 * The div used to show the progress bar.
69 * @see nsProgressFrame::CreateAnonymousContent
71 nsCOMPtr<Element> mBarDiv;
74 #endif