2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2000-03-31 07:02:06 +00:00
|
|
|
#ifndef nsLeafBoxFrame_h___
|
|
|
|
#define nsLeafBoxFrame_h___
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-03-02 03:01:30 +00:00
|
|
|
#include "nsLeafFrame.h"
|
2000-03-31 07:02:06 +00:00
|
|
|
#include "nsBox.h"
|
2000-03-02 03:01:30 +00:00
|
|
|
|
|
|
|
class nsAccessKeyInfo;
|
|
|
|
|
2004-09-28 18:37:50 +00:00
|
|
|
class nsLeafBoxFrame : public nsLeafFrame
|
2000-03-02 03:01:30 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2013-05-14 16:33:23 +00:00
|
|
|
virtual nsSize GetPrefSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nsSize GetMinSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nsSize GetMaxSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetFlex(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2007-02-24 18:33:33 +00: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 22:11:28 +00:00
|
|
|
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
|
2007-02-24 18:33:33 +00:00
|
|
|
}
|
|
|
|
|
2014-01-05 23:31:14 +00:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
2001-09-15 00:45:54 +00:00
|
|
|
#endif
|
2000-03-02 03:01:30 +00:00
|
|
|
|
|
|
|
// nsIHTMLReflow overrides
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2008-01-27 20:24:06 +00:00
|
|
|
// Our auto size is that provided by nsFrame, not nsLeafFrame
|
2011-04-08 01:04:40 +00:00
|
|
|
virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
2008-01-27 20:24:06 +00:00
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
|
2008-01-27 20:24:06 +00:00
|
|
|
|
2014-05-12 22:47:41 +00:00
|
|
|
virtual nsresult Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2000-03-31 07:02:06 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE;
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2013-03-20 01:47:48 +00:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* asPrevInFlow) MOZ_OVERRIDE;
|
2000-03-31 07:02:06 +00:00
|
|
|
|
2013-02-14 11:12:27 +00:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2006-01-26 02:29:17 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 08:36:33 +00:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2007-06-18 23:22:46 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual bool ComputesOwnOverflowArea() MOZ_OVERRIDE { return false; }
|
2004-09-28 18:37:50 +00:00
|
|
|
|
2000-03-02 03:01:30 +00:00
|
|
|
protected:
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE;
|
2004-09-28 18:37:50 +00:00
|
|
|
|
2002-09-09 21:32:33 +00:00
|
|
|
#ifdef DEBUG_LAYOUT
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual void GetBoxName(nsAutoString& aName) MOZ_OVERRIDE;
|
2002-09-09 21:32:33 +00:00
|
|
|
#endif
|
2000-05-15 04:12:31 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE;
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext);
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2007-06-18 23:22:46 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
void UpdateMouseThrough();
|
|
|
|
|
|
|
|
|
2000-03-31 07:02:06 +00:00
|
|
|
}; // class nsLeafBoxFrame
|
2000-03-02 03:01:30 +00:00
|
|
|
|
2000-03-31 07:02:06 +00:00
|
|
|
#endif /* nsLeafBoxFrame_h___ */
|