Bug 1847397 - Check no post barrier needed when eliding it in UpdateRegExpStatics...
[gecko.git] / layout / forms / nsSearchControlFrame.h
blob3083821614e9206493e1c3096eca1ceb15cb2920
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 nsSearchControlFrame_h__
8 #define nsSearchControlFrame_h__
10 #include "mozilla/Attributes.h"
11 #include "nsTextControlFrame.h"
12 #include "nsIAnonymousContentCreator.h"
13 #include "mozilla/RefPtr.h"
15 class nsITextControlFrame;
16 class nsPresContext;
18 namespace mozilla {
19 enum class PseudoStyleType : uint8_t;
20 class PresShell;
21 namespace dom {
22 class Element;
23 } // namespace dom
24 } // namespace mozilla
26 /**
27 * This frame type is used for <input type=search>.
29 class nsSearchControlFrame final : public nsTextControlFrame {
30 friend nsIFrame* NS_NewSearchControlFrame(mozilla::PresShell* aPresShell,
31 ComputedStyle* aStyle);
33 using PseudoStyleType = mozilla::PseudoStyleType;
34 using Element = mozilla::dom::Element;
36 explicit nsSearchControlFrame(ComputedStyle* aStyle,
37 nsPresContext* aPresContext);
39 public:
40 NS_DECL_QUERYFRAME
41 NS_DECL_FRAMEARENA_HELPERS(nsSearchControlFrame)
43 void DestroyFrom(nsIFrame* aDestructRoot,
44 PostDestroyData& aPostDestroyData) override;
46 // nsIAnonymousContentCreator
47 nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
48 void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
49 uint32_t aFilter) override;
51 #ifdef DEBUG_FRAME_DUMP
52 nsresult GetFrameName(nsAString& aResult) const override {
53 return MakeFrameName(u"SearchControl"_ns, aResult);
55 #endif
57 Element* GetAnonClearButton() const { return mClearButton; }
59 /**
60 * Update visbility of the clear button depending on the value
62 void UpdateClearButtonState();
64 private:
65 // See nsSearchControlFrame::CreateAnonymousContent of a description of these
66 RefPtr<Element> mClearButton;
69 #endif // nsSearchControlFrame_h__