Bug 1847397 - Check no post barrier needed when eliding it in UpdateRegExpStatics...
[gecko.git] / layout / forms / nsGfxButtonControlFrame.h
blob222c3c0b3d7aa47b7e29ff9d2d11c092e285525c
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 nsGfxButtonControlFrame_h___
8 #define nsGfxButtonControlFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsHTMLButtonControlFrame.h"
12 #include "nsCOMPtr.h"
13 #include "nsIAnonymousContentCreator.h"
15 class nsTextNode;
17 // Class which implements the input[type=button, reset, submit] and
18 // browse button for input[type=file].
19 // The label for button is specified through generated content
20 // in the ua.css file.
22 class nsGfxButtonControlFrame final : public nsHTMLButtonControlFrame,
23 public nsIAnonymousContentCreator {
24 public:
25 NS_DECL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
27 explicit nsGfxButtonControlFrame(ComputedStyle* aStyle,
28 nsPresContext* aPresContext);
30 virtual void DestroyFrom(nsIFrame* aDestructRoot,
31 PostDestroyData& aPostDestroyData) override;
33 virtual nsresult HandleEvent(nsPresContext* aPresContext,
34 mozilla::WidgetGUIEvent* aEvent,
35 nsEventStatus* aEventStatus) override;
37 #ifdef DEBUG_FRAME_DUMP
38 virtual nsresult GetFrameName(nsAString& aResult) const override;
39 #endif
41 NS_DECL_QUERYFRAME
43 // nsIAnonymousContentCreator
44 virtual nsresult CreateAnonymousContent(
45 nsTArray<ContentInfo>& aElements) override;
46 virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
47 uint32_t aFilter) override;
49 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
50 int32_t aModType) override;
52 virtual nsContainerFrame* GetContentInsertionFrame() override;
54 protected:
55 nsresult GetDefaultLabel(nsAString& aLabel) const;
57 nsresult GetLabel(nsString& aLabel);
59 virtual bool IsInput() override { return true; }
61 private:
62 RefPtr<nsTextNode> mTextContent;
65 #endif