Bug 591737 - Add DetailsFrame. r=bz
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 20 Jan 2016 23:20:41 +0800
changeset 319398 95c721eb4e942fcb9201a5130daa4bf5fe840993
parent 319397 5cee7af18f881aab65f85e915e485b629fa26a99
child 319399 a4f84794091c8857ab78ee07400c5423937c4097
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs591737
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 591737 - Add DetailsFrame. r=bz
dom/base/nsGkAtomList.h
layout/generic/DetailsFrame.cpp
layout/generic/DetailsFrame.h
layout/generic/moz.build
layout/generic/nsFrameIdList.h
layout/generic/nsHTMLParts.h
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -1954,16 +1954,17 @@ GK_ATOM(blockFrame, "BlockFrame")
 GK_ATOM(boxFrame, "BoxFrame")
 GK_ATOM(brFrame, "BRFrame")
 GK_ATOM(bulletFrame, "BulletFrame")
 GK_ATOM(colorControlFrame, "colorControlFrame")
 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
 GK_ATOM(frameSetFrame, "FrameSetFrame")
 GK_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame")
 GK_ATOM(gridContainerFrame, "GridContainerFrame")
 GK_ATOM(HTMLButtonControlFrame, "HTMLButtonControlFrame")
 GK_ATOM(HTMLCanvasFrame, "HTMLCanvasFrame")
new file mode 100644
--- /dev/null
+++ b/layout/generic/DetailsFrame.cpp
@@ -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;
+}
new file mode 100644
--- /dev/null
+++ b/layout/generic/DetailsFrame.h
@@ -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
--- a/layout/generic/moz.build
+++ b/layout/generic/moz.build
@@ -107,16 +107,17 @@ EXPORTS.mozilla.dom += [
 ]
 
 EXPORTS.mozilla.layout += [
     'FrameChildList.h',
 ]
 
 UNIFIED_SOURCES += [
     'AsyncScrollBase.cpp',
+    'DetailsFrame.cpp',
     'FrameChildList.cpp',
     'MathMLTextRunFactory.cpp',
     'nsAbsoluteContainingBlock.cpp',
     'nsBackdropFrame.cpp',
     'nsBlockFrame.cpp',
     'nsBlockReflowContext.cpp',
     'nsBlockReflowState.cpp',
     'nsBRFrame.cpp',
--- a/layout/generic/nsFrameIdList.h
+++ b/layout/generic/nsFrameIdList.h
@@ -1,13 +1,14 @@
 /* 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/. */
 
 FRAME_ID(BRFrame)
+FRAME_ID(DetailsFrame)
 FRAME_ID(nsAutoRepeatBoxFrame)
 FRAME_ID(nsBCTableCellFrame)
 FRAME_ID(nsBackdropFrame)
 FRAME_ID(nsBlockFrame)
 FRAME_ID(nsBox)
 FRAME_ID(nsBoxFrame)
 FRAME_ID(nsBulletFrame)
 FRAME_ID(nsButtonBoxFrame)
--- a/layout/generic/nsHTMLParts.h
+++ b/layout/generic/nsHTMLParts.h
@@ -170,16 +170,19 @@ NS_NewComboboxControlFrame(nsIPresShell*
 nsIFrame*
 NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
 NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 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;
 nsTableOuterFrame*
 NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 class nsTableFrame;
 nsTableFrame*
 NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);