2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifndef nsLeafBoxFrame_h___
|
|
|
|
#define nsLeafBoxFrame_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsLeafFrame.h"
|
|
|
|
#include "nsBox.h"
|
|
|
|
|
|
|
|
class nsAccessKeyInfo;
|
|
|
|
|
|
|
|
class nsLeafBoxFrame : public nsLeafFrame
|
|
|
|
{
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2013-05-14 09:33:23 -07:00
|
|
|
virtual nsSize GetPrefSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nsSize GetMinSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsSize GetMaxSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetFlex(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
// This is bogus, but it's what we've always done.
|
|
|
|
// Note that nsLeafFrame is also eReplacedContainsBlock.
|
|
|
|
return nsLeafFrame::IsFrameOfType(aFlags &
|
2007-07-03 15:11:28 -07:00
|
|
|
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2014-01-05 15:31:14 -08:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2012-09-14 09:10:08 -07:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsIHTMLReflow overrides
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-01-27 12:24:06 -08:00
|
|
|
// Our auto size is that provided by nsFrame, not nsLeafFrame
|
2011-04-07 18:04:40 -07:00
|
|
|
virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
2008-01-27 12:24:06 -08:00
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
|
2008-01-27 12:24:06 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
NS_IMETHOD CharacterDataChanged(CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-03-19 18:47:48 -07:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* asPrevInFlow) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-02-14 03:12:27 -08:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
|
2007-06-18 16:22:46 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-09-14 09:10:08 -07:00
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2007-06-18 16:22:46 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual bool ComputesOwnOverflowArea() MOZ_OVERRIDE { return false; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifdef DEBUG_LAYOUT
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void GetBoxName(nsAutoString& aName) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext);
|
|
|
|
|
2007-06-18 16:22:46 -07:00
|
|
|
private:
|
|
|
|
|
|
|
|
void UpdateMouseThrough();
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
}; // class nsLeafBoxFrame
|
|
|
|
|
|
|
|
#endif /* nsLeafBoxFrame_h___ */
|