Bug 666041 patch 3: Create boilerplate nsFlexContainerFrame class. r=bz

This commit is contained in:
Daniel Holbert 2012-06-26 15:12:13 -07:00
parent a445dcdc59
commit d0c73eda8f
5 changed files with 116 additions and 11 deletions

View File

@ -95,6 +95,9 @@
#include "nsIDOMXULDocument.h"
#include "nsIXULDocument.h"
#endif
#ifdef MOZ_FLEXBOX
#include "nsFlexContainerFrame.h"
#endif
#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
#endif
@ -4293,17 +4296,6 @@ nsCSSFrameConstructor::BuildScrollFrame(nsFrameConstructorState& aState,
return NS_OK;
}
#ifdef MOZ_FLEXBOX
// TEMPORARY CHUNK: No-op constructor, so we can compile at this
// intermediate state. Removed in subsequent patch.
nsIFrame*
NS_NewFlexContainerFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
return nsnull;
}
#endif // MOZ_FLEXBOX
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
Element* aElement,

View File

@ -93,6 +93,12 @@ CPPSRCS = \
nsViewportFrame.cpp \
$(NULL)
ifdef MOZ_FLEXBOX
CPPSRCS += \
nsFlexContainerFrame.cpp \
$(NULL)
endif
ifdef MOZ_MEDIA
CPPSRCS += \
nsVideoFrame.cpp \

View File

@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code is subject to the terms of the Mozilla Public License
* version 2.0 (the "License"). You can obtain a copy of the License at
* http://mozilla.org/MPL/2.0/. */
/* rendering object for CSS display: -moz-flex */
#include "nsFlexContainerFrame.h"
#include "nsPresContext.h"
#include "nsStyleContext.h"
#include "prlog.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* nsFlexContainerFrameLM = PR_NewLogModule("nsFlexContainerFrame");
#endif /* PR_LOGGING */
NS_IMPL_FRAMEARENA_HELPERS(nsFlexContainerFrame)
nsIFrame*
NS_NewFlexContainerFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
return new (aPresShell) nsFlexContainerFrame(aContext);
}
//----------------------------------------------------------------------
/* virtual */
nsFlexContainerFrame::~nsFlexContainerFrame()
{
}
NS_QUERYFRAME_HEAD(nsFlexContainerFrame)
NS_QUERYFRAME_ENTRY(nsFlexContainerFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsFlexContainerFrameSuper)
void
nsFlexContainerFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
DestroyAbsoluteFrames(aDestructRoot);
nsFlexContainerFrameSuper::DestroyFrom(aDestructRoot);
}
nsIAtom*
nsFlexContainerFrame::GetType() const
{
return nsGkAtoms::flexContainerFrame;
}
#ifdef DEBUG
NS_IMETHODIMP
nsFlexContainerFrame::GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("FlexContainer"), aResult);
}
#endif // DEBUG

View File

@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code is subject to the terms of the Mozilla Public License
* version 2.0 (the "License"). You can obtain a copy of the License at
* http://mozilla.org/MPL/2.0/. */
/* rendering object for CSS display: -moz-flex */
#ifndef nsFlexContainerFrame_h___
#define nsFlexContainerFrame_h___
#include "nsContainerFrame.h"
#include "mozilla/Types.h"
nsIFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
typedef nsContainerFrame nsFlexContainerFrameSuper;
class nsFlexContainerFrame : public nsFlexContainerFrameSuper {
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_QUERYFRAME_TARGET(nsFlexContainerFrame)
NS_DECL_QUERYFRAME
// Factory method:
friend nsIFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
// nsIFrame overrides
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
#endif
protected:
// Protected constructor & destructor
nsFlexContainerFrame(nsStyleContext* aContext) : nsFlexContainerFrameSuper(aContext) {}
virtual ~nsFlexContainerFrame();
// Protected nsIFrame overrides:
virtual void DestroyFrom(nsIFrame* aDestructRoot);
};
#endif /* nsFlexContainerFrame_h___ */

View File

@ -22,6 +22,9 @@ FRAME_ID(nsFieldSetFrame)
FRAME_ID(nsFileControlFrame)
FRAME_ID(nsFirstLetterFrame)
FRAME_ID(nsFirstLineFrame)
#ifdef MOZ_FLEXBOX
FRAME_ID(nsFlexContainerFrame)
#endif // MOZ_FLEXBOX
FRAME_ID(nsFormControlFrame)
FRAME_ID(nsFrame)
FRAME_ID(nsGfxButtonControlFrame)