2016-01-20 18:20:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef DetailsFrame_h
|
|
|
|
#define DetailsFrame_h
|
|
|
|
|
|
|
|
#include "nsBlockFrame.h"
|
2016-01-20 18:20:41 +03:00
|
|
|
#include "nsIAnonymousContentCreator.h"
|
2016-01-20 18:20:41 +03:00
|
|
|
|
|
|
|
class nsContainerFrame;
|
|
|
|
|
2016-12-01 08:18:03 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
2016-01-20 18:20:41 +03:00
|
|
|
// DetailsFrame is generated by HTMLDetailsElement. See
|
|
|
|
// nsCSSFrameConstructor::ConstructDetailsFrame for the structure of a
|
|
|
|
// DetailsFrame.
|
|
|
|
//
|
|
|
|
class DetailsFrame final : public nsBlockFrame,
|
2016-01-20 18:20:41 +03:00
|
|
|
public nsIAnonymousContentCreator {
|
2016-01-20 18:20:41 +03:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(DetailsFrame)
|
2016-01-20 18:20:41 +03:00
|
|
|
NS_DECL_QUERYFRAME
|
|
|
|
|
2019-02-05 19:45:54 +03:00
|
|
|
explicit DetailsFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
2016-01-20 18:20:41 +03:00
|
|
|
|
|
|
|
virtual ~DetailsFrame();
|
|
|
|
|
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
|
|
|
nsresult GetFrameName(nsAString& aResult) const override {
|
2020-07-01 11:29:29 +03:00
|
|
|
return MakeFrameName(u"Details"_ns, aResult);
|
2016-01-20 18:20:41 +03:00
|
|
|
}
|
|
|
|
#endif
|
2016-02-02 12:39:49 +03:00
|
|
|
|
2016-10-05 09:43:31 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
// Check the frame of the main summary element is the first child in the frame
|
2016-10-05 09:43:32 +03:00
|
|
|
// list. Returns true if we found the main summary frame; false otherwise.
|
|
|
|
bool CheckValidMainSummary(const nsFrameList& aFrameList) const;
|
2016-10-05 09:43:31 +03:00
|
|
|
#endif
|
|
|
|
|
2016-02-02 12:39:49 +03:00
|
|
|
void SetInitialChildList(ChildListID aListID,
|
|
|
|
nsFrameList& aChildList) override;
|
2016-01-20 18:20:41 +03:00
|
|
|
|
2017-11-07 03:20:33 +03:00
|
|
|
void DestroyFrom(nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData) override;
|
2016-01-20 18:20:41 +03:00
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
|
|
|
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
|
|
|
|
|
|
|
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
|
|
|
uint32_t aFilter) override;
|
2017-07-05 09:52:37 +03:00
|
|
|
// Returns true if |aSummaryFrame| is the main summary (i.e. the first child
|
|
|
|
// of this details frame).
|
|
|
|
// This function is used when the summary element is removed from the parent
|
|
|
|
// details element since at that moment the summary element has been already
|
|
|
|
// removed from the details element children.
|
|
|
|
bool HasMainSummaryFrame(nsIFrame* aSummaryFrame);
|
2016-01-20 18:20:41 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIContent> mDefaultSummary;
|
2016-01-20 18:20:41 +03:00
|
|
|
};
|
|
|
|
|
2016-12-01 08:18:03 +03:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-01-20 18:20:41 +03:00
|
|
|
#endif // DetailsFrame_h
|