Bug 591737 - Add DetailsFrame. r=bz

This commit is contained in:
Ting-Yu Lin 2016-01-20 23:20:41 +08:00
parent 403f25deee
commit 7371372968
6 changed files with 90 additions and 0 deletions

View File

@ -1959,6 +1959,7 @@ GK_ATOM(columnSetFrame, "ColumnSetFrame")
GK_ATOM(comboboxControlFrame, "ComboboxControlFrame")
GK_ATOM(comboboxDisplayFrame, "ComboboxDisplayFrame")
GK_ATOM(deckFrame, "DeckFrame")
GK_ATOM(detailsFrame, "DetailsFrame")
GK_ATOM(fieldSetFrame, "FieldSetFrame")
GK_ATOM(flexContainerFrame, "FlexContainerFrame")
GK_ATOM(formControlFrame, "FormControlFrame") // radio or checkbox

View File

@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "DetailsFrame.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLDetailsElement.h"
#include "mozilla/dom/HTMLSummaryElement.h"
#include "nsContentUtils.h"
#include "nsPlaceholderFrame.h"
#include "nsTextNode.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_FRAMEARENA_HELPERS(DetailsFrame)
NS_QUERYFRAME_HEAD(DetailsFrame)
NS_QUERYFRAME_ENTRY(DetailsFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
DetailsFrame*
NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) DetailsFrame(aContext);
}
DetailsFrame::DetailsFrame(nsStyleContext* aContext)
: nsBlockFrame(aContext)
{
}
DetailsFrame::~DetailsFrame()
{
}
nsIAtom*
DetailsFrame::GetType() const
{
return nsGkAtoms::detailsFrame;
}

View File

@ -0,0 +1,41 @@
/* -*- 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"
class nsContainerFrame;
class nsStyleContext;
// DetailsFrame is generated by HTMLDetailsElement. See
// nsCSSFrameConstructor::ConstructDetailsFrame for the structure of a
// DetailsFrame.
//
class DetailsFrame final : public nsBlockFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_QUERYFRAME_TARGET(DetailsFrame)
NS_DECL_QUERYFRAME
explicit DetailsFrame(nsStyleContext* aContext);
virtual ~DetailsFrame();
nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
nsresult GetFrameName(nsAString& aResult) const override
{
return MakeFrameName(NS_LITERAL_STRING("Details"), aResult);
}
#endif
};
#endif // DetailsFrame_h

View File

@ -112,6 +112,7 @@ EXPORTS.mozilla.layout += [
UNIFIED_SOURCES += [
'AsyncScrollBase.cpp',
'DetailsFrame.cpp',
'FrameChildList.cpp',
'MathMLTextRunFactory.cpp',
'nsAbsoluteContainingBlock.cpp',

View File

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
FRAME_ID(BRFrame)
FRAME_ID(DetailsFrame)
FRAME_ID(nsAutoRepeatBoxFrame)
FRAME_ID(nsBCTableCellFrame)
FRAME_ID(nsBackdropFrame)

View File

@ -175,6 +175,9 @@ nsIFrame*
NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
class DetailsFrame;
DetailsFrame*
NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// Table frame factories
class nsTableOuterFrame;