Bug 591737 - Add SummaryFrame. r=bz

--HG--
extra : commitid : 61ZPHBOWyKH
extra : rebase_source : 860919e85da1fc1593f084dcc1e011e1e6cddba3
This commit is contained in:
Ting-Yu Lin 2016-02-02 17:39:06 +08:00
parent cff36a1352
commit 802d6dee0d
7 changed files with 73 additions and 1 deletions

View File

@ -1999,6 +1999,7 @@ GK_ATOM(scrollFrame, "ScrollFrame")
GK_ATOM(scrollbarFrame, "ScrollbarFrame")
GK_ATOM(sequenceFrame, "SequenceFrame")
GK_ATOM(sliderFrame, "sliderFrame")
GK_ATOM(summaryFrame, "SummaryFrame")
GK_ATOM(tableCellFrame, "TableCellFrame")
GK_ATOM(tableColFrame, "TableColFrame")
GK_ATOM(tableColGroupFrame, "TableColGroupFrame")

View File

@ -35,7 +35,6 @@ public:
return MakeFrameName(NS_LITERAL_STRING("Details"), aResult);
}
#endif
};
#endif // DetailsFrame_h

View File

@ -0,0 +1,32 @@
/* -*- 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 "SummaryFrame.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLSummaryElement.h"
NS_IMPL_FRAMEARENA_HELPERS(SummaryFrame)
SummaryFrame*
NS_NewSummaryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) SummaryFrame(aContext);
}
SummaryFrame::SummaryFrame(nsStyleContext* aContext)
: nsBlockFrame(aContext)
{
}
SummaryFrame::~SummaryFrame()
{
}
nsIAtom*
SummaryFrame::GetType() const
{
return nsGkAtoms::summaryFrame;
}

View File

@ -0,0 +1,35 @@
/* -*- 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 SummaryFrame_h
#define SummaryFrame_h
#include "nsBlockFrame.h"
class nsStyleContext;
// SummaryFrame is generated by HTMLSummaryElement.
//
class SummaryFrame final : public nsBlockFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
explicit SummaryFrame(nsStyleContext* aContext);
virtual ~SummaryFrame();
nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
nsresult GetFrameName(nsAString& aResult) const override
{
return MakeFrameName(NS_LITERAL_STRING("Summary"), aResult);
}
#endif
};
#endif // SummaryFrame_h

View File

@ -167,6 +167,7 @@ UNIFIED_SOURCES += [
'ScrollbarActivity.cpp',
'ScrollVelocityQueue.cpp',
'StickyScrollContainer.cpp',
'SummaryFrame.cpp',
'TextOverflow.cpp',
]

View File

@ -176,4 +176,5 @@ FRAME_ID(nsTreeColFrame)
FRAME_ID(nsVideoFrame)
FRAME_ID(nsXULLabelFrame)
FRAME_ID(nsXULScrollFrame)
FRAME_ID(SummaryFrame)
FRAME_ID(ViewportFrame)

View File

@ -178,6 +178,9 @@ NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
class DetailsFrame;
DetailsFrame*
NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
class SummaryFrame;
SummaryFrame*
NS_NewSummaryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// Table frame factories
class nsTableOuterFrame;