Bug 1758813 [wpt PR 33142] - Implement RP sign out, a=testonly
[gecko.git] / layout / generic / DetailsFrame.h
blobf2b8e1be51474eb4ef65f6685e875db6279eb991
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 DetailsFrame_h
8 #define DetailsFrame_h
10 #include "nsBlockFrame.h"
11 #include "nsIAnonymousContentCreator.h"
13 class nsContainerFrame;
15 namespace mozilla {
17 // DetailsFrame is generated by HTMLDetailsElement. See
18 // nsCSSFrameConstructor::ConstructDetailsFrame for the structure of a
19 // DetailsFrame.
21 class DetailsFrame final : public nsBlockFrame,
22 public nsIAnonymousContentCreator {
23 public:
24 NS_DECL_FRAMEARENA_HELPERS(DetailsFrame)
25 NS_DECL_QUERYFRAME
27 explicit DetailsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
29 virtual ~DetailsFrame();
31 #ifdef DEBUG_FRAME_DUMP
32 nsresult GetFrameName(nsAString& aResult) const override {
33 return MakeFrameName(u"Details"_ns, aResult);
35 #endif
37 #ifdef DEBUG
38 // Check the frame of the main summary element is the first child in the frame
39 // list. Returns true if we found the main summary frame; false otherwise.
40 bool CheckValidMainSummary(const nsFrameList& aFrameList) const;
41 #endif
43 void SetInitialChildList(ChildListID aListID,
44 nsFrameList& aChildList) override;
46 void DestroyFrom(nsIFrame* aDestructRoot,
47 PostDestroyData& aPostDestroyData) override;
49 // nsIAnonymousContentCreator
50 nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
52 void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
53 uint32_t aFilter) override;
54 // Returns true if |aSummaryFrame| is the main summary (i.e. the first child
55 // of this details frame).
56 // This function is used when the summary element is removed from the parent
57 // details element since at that moment the summary element has been already
58 // removed from the details element children.
59 bool HasMainSummaryFrame(nsIFrame* aSummaryFrame);
61 private:
62 nsCOMPtr<nsIContent> mDefaultSummary;
65 } // namespace mozilla
67 #endif // DetailsFrame_h