зеркало из https://github.com/mozilla/gecko-dev.git
Make XUL box debug code be #ifdef DEBUG_LAYOUT. r+sr=roc, bug 103844.
This commit is contained in:
Родитель
2217d0942c
Коммит
f87933eeda
|
@ -1973,7 +1973,9 @@ nsTextControlFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
|
|
|
@ -360,7 +360,9 @@ nsHTMLScrollFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsGfxScrollFrameInner::ScrollbarStyles styles = GetScrollbarStyles();
|
||||
|
||||
|
@ -474,7 +476,9 @@ nsHTMLScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsresult rv = mInner.mScrollAreaBox->GetMinSize(aState, aSize);
|
||||
|
||||
|
@ -509,7 +513,9 @@ nsHTMLScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = NS_INTRINSICSIZE;
|
||||
aSize.height = NS_INTRINSICSIZE;
|
||||
|
@ -898,7 +904,9 @@ nsXULScrollFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsGfxScrollFrameInner::ScrollbarStyles styles = GetScrollbarStyles();
|
||||
|
||||
|
@ -1012,7 +1020,9 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsresult rv = mInner.mScrollAreaBox->GetMinSize(aState, aSize);
|
||||
|
||||
|
@ -1047,7 +1057,9 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = NS_INTRINSICSIZE;
|
||||
aSize.height = NS_INTRINSICSIZE;
|
||||
|
|
|
@ -360,7 +360,9 @@ nsHTMLScrollFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsGfxScrollFrameInner::ScrollbarStyles styles = GetScrollbarStyles();
|
||||
|
||||
|
@ -474,7 +476,9 @@ nsHTMLScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsresult rv = mInner.mScrollAreaBox->GetMinSize(aState, aSize);
|
||||
|
||||
|
@ -509,7 +513,9 @@ nsHTMLScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = NS_INTRINSICSIZE;
|
||||
aSize.height = NS_INTRINSICSIZE;
|
||||
|
@ -898,7 +904,9 @@ nsXULScrollFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsGfxScrollFrameInner::ScrollbarStyles styles = GetScrollbarStyles();
|
||||
|
||||
|
@ -1012,7 +1020,9 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
nsresult rv = mInner.mScrollAreaBox->GetMinSize(aState, aSize);
|
||||
|
||||
|
@ -1047,7 +1057,9 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
NS_IMETHODIMP
|
||||
nsXULScrollFrame::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
{
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = NS_INTRINSICSIZE;
|
||||
aSize.height = NS_INTRINSICSIZE;
|
||||
|
|
|
@ -1973,7 +1973,9 @@ nsTextControlFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
#endif
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
|
|
|
@ -733,13 +733,6 @@ nsBox::NeedsRecalc()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsBox::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsBox::SizeNeedsRecalc(nsSize& aSize)
|
||||
{
|
||||
|
@ -1488,6 +1481,13 @@ nsBox::BoundsCheck(nsSize& aMinSize, nsSize& aPrefSize, nsSize& aMaxSize)
|
|||
BoundsCheck(aMinSize.height, aPrefSize.height, aMaxSize.height);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
nsresult
|
||||
nsBox::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBox::GetDebugBoxAt( const nsPoint& aPoint,
|
||||
nsIBox** aBox)
|
||||
|
@ -1542,6 +1542,7 @@ nsBox::GetDebug(PRBool& aDebug)
|
|||
aDebug = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBox::GetMouseThrough(PRBool& aMouseThrough)
|
||||
|
|
|
@ -59,7 +59,6 @@ public:
|
|||
NS_IMETHOD HasDirtyChildren(PRBool& aIsDirty);
|
||||
NS_IMETHOD MarkDirty(nsBoxLayoutState& aState);
|
||||
NS_IMETHOD MarkDirtyChildren(nsBoxLayoutState& aState);
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug);
|
||||
NS_IMETHOD SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect);
|
||||
NS_IMETHOD GetBounds(nsRect& aRect);
|
||||
NS_IMETHOD GetBorderAndPadding(nsMargin& aBorderAndPadding);
|
||||
|
@ -92,8 +91,6 @@ public:
|
|||
|
||||
NS_IMETHOD Redraw(nsBoxLayoutState& aState, const nsRect* aRect = nsnull, PRBool aImmediate = PR_FALSE);
|
||||
NS_IMETHOD NeedsRecalc();
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIBox** aBox);
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug);
|
||||
NS_IMETHOD RelayoutDirtyChild(nsBoxLayoutState& aState, nsIBox* aChild);
|
||||
NS_IMETHOD RelayoutStyleChange(nsBoxLayoutState& aState, nsIBox* aChild);
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild);
|
||||
|
@ -102,6 +99,10 @@ public:
|
|||
NS_IMETHOD MarkChildrenStyleChange();
|
||||
NS_IMETHOD MarkStyleChange(nsBoxLayoutState& aState);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIBox** aBox);
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug);
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug);
|
||||
|
||||
NS_IMETHOD DumpBox(FILE* out);
|
||||
#endif
|
||||
NS_IMETHOD ChildrenMustHaveWidgets(PRBool& aMust);
|
||||
|
|
|
@ -124,8 +124,10 @@ static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
|||
//#define DO_NOISY_REFLOW
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PRBool nsBoxFrame::gDebug = PR_FALSE;
|
||||
nsIBox* nsBoxFrame::mDebugChild = nsnull;
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
NS_NewBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
|
||||
|
@ -275,10 +277,11 @@ nsBoxFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
CacheAttributes();
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
// if we are root and this
|
||||
if (mState & NS_STATE_IS_ROOT)
|
||||
GetDebugPref(aPresContext);
|
||||
|
||||
#endif
|
||||
|
||||
mMouseThrough = unset;
|
||||
|
||||
|
@ -348,6 +351,7 @@ nsBoxFrame::CacheAttributes()
|
|||
mState &= ~NS_STATE_AUTO_STRETCH;
|
||||
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PRBool debug = mState & NS_STATE_SET_TO_DEBUG;
|
||||
PRBool debugSet = GetInitialDebug(debug);
|
||||
if (debugSet) {
|
||||
|
@ -359,8 +363,10 @@ nsBoxFrame::CacheAttributes()
|
|||
} else {
|
||||
mState &= ~NS_STATE_DEBUG_WAS_SET;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PRBool
|
||||
nsBoxFrame::GetInitialDebug(PRBool& aDebug)
|
||||
{
|
||||
|
@ -385,6 +391,7 @@ nsBoxFrame::GetInitialDebug(PRBool& aDebug)
|
|||
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool
|
||||
nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign)
|
||||
|
@ -927,7 +934,9 @@ nsBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aBoxLayoutState);
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
rv = nsContainerBox::GetPrefSize(aBoxLayoutState, mPrefSize);
|
||||
|
@ -945,7 +954,9 @@ nsBoxFrame::GetAscent(nsBoxLayoutState& aBoxLayoutState, nscoord& aAscent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aBoxLayoutState);
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
rv = nsContainerBox::GetAscent(aBoxLayoutState, mAscent);
|
||||
|
@ -963,7 +974,9 @@ nsBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aBoxLayoutState);
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -983,7 +996,9 @@ nsBoxFrame::GetMaxSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aBoxLayoutState);
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -1012,6 +1027,7 @@ nsBoxFrame::GetFlex(nsBoxLayoutState& aBoxLayoutState, nscoord& aFlex)
|
|||
return rv;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
void
|
||||
nsBoxFrame::PropagateDebug(nsBoxLayoutState& aState)
|
||||
{
|
||||
|
@ -1025,6 +1041,7 @@ nsBoxFrame::PropagateDebug(nsBoxLayoutState& aState)
|
|||
SetDebug(aState, gDebug);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::BeginLayout(nsBoxLayoutState& aState)
|
||||
|
@ -1035,8 +1052,9 @@ nsBoxFrame::BeginLayout(nsBoxLayoutState& aState)
|
|||
// mark ourselves as dirty so no child under us
|
||||
// can post an incremental layout.
|
||||
mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PropagateDebug(aState);
|
||||
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -1064,6 +1082,7 @@ nsBoxFrame::Destroy(nsIPresContext* aPresContext)
|
|||
return nsContainerFrame::Destroy(aPresContext);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
||||
{
|
||||
|
@ -1087,6 +1106,7 @@ nsBoxFrame::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::NeedsRecalc()
|
||||
|
@ -1146,9 +1166,11 @@ nsBoxFrame::InsertFrames(nsIPresContext* aPresContext,
|
|||
// insert the frames in out regular frame list
|
||||
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
// if we are in debug make sure our children are in debug as well.
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
|
||||
SetDebugOnChildList(state, mFirstChild, PR_TRUE);
|
||||
#endif
|
||||
|
||||
CheckFrameOrder();
|
||||
SanityCheck(mFrames);
|
||||
|
@ -1175,9 +1197,11 @@ nsBoxFrame::AppendFrames(nsIPresContext* aPresContext,
|
|||
// append in regular frames
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
// if we are in debug make sure our children are in debug as well.
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
|
||||
SetDebugOnChildList(state, mFirstChild, PR_TRUE);
|
||||
#endif
|
||||
|
||||
CheckFrameOrder();
|
||||
SanityCheck(mFrames);
|
||||
|
@ -1232,8 +1256,10 @@ nsBoxFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
aAttribute == nsHTMLAtoms::valign ||
|
||||
aAttribute == nsXULAtoms::orient ||
|
||||
aAttribute == nsXULAtoms::pack ||
|
||||
aAttribute == nsXULAtoms::dir ||
|
||||
aAttribute == nsXULAtoms::debug) {
|
||||
#ifdef DEBUG_LAYOUT
|
||||
aAttribute == nsXULAtoms::debug ||
|
||||
#endif
|
||||
aAttribute == nsXULAtoms::dir) {
|
||||
|
||||
mValign = nsBoxFrame::vAlign_Top;
|
||||
mHalign = nsBoxFrame::hAlign_Left;
|
||||
|
@ -1262,6 +1288,7 @@ nsBoxFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
else
|
||||
mState &= ~NS_STATE_EQUAL_SIZE;
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
PRBool debug = mState & NS_STATE_SET_TO_DEBUG;
|
||||
PRBool debugSet = GetInitialDebug(debug);
|
||||
if (debugSet) {
|
||||
|
@ -1274,6 +1301,7 @@ nsBoxFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
} else {
|
||||
mState &= ~NS_STATE_DEBUG_WAS_SET;
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool autostretch = mState & NS_STATE_AUTO_STRETCH;
|
||||
GetInitialAutoStretch(autostretch);
|
||||
|
@ -1322,6 +1350,7 @@ nsBoxFrame::GetInset(nsMargin& margin)
|
|||
{
|
||||
margin.SizeTo(0,0,0,0);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG) {
|
||||
nsMargin debugMargin(0,0,0,0);
|
||||
nsMargin debugBorder(0,0,0,0);
|
||||
|
@ -1336,6 +1365,7 @@ nsBoxFrame::GetInset(nsMargin& margin)
|
|||
margin += debugMargin;
|
||||
margin += debugPadding;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1397,11 +1427,13 @@ nsBoxFrame::CheckFrameOrder()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
void
|
||||
nsBoxFrame::GetDebugPref(nsIPresContext* aPresContext)
|
||||
{
|
||||
gDebug = nsContentUtils::GetBoolPref("xul.debug.box");
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::Paint(nsIPresContext* aPresContext,
|
||||
|
@ -1507,14 +1539,16 @@ nsBoxFrame::PaintChildren(nsIPresContext* aPresContext,
|
|||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags)
|
||||
{
|
||||
nsMargin debugBorder;
|
||||
nsMargin debugMargin;
|
||||
nsMargin debugPadding;
|
||||
nsMargin border;
|
||||
nsRect inner;
|
||||
|
||||
GetBorder(border);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
nsMargin debugBorder;
|
||||
nsMargin debugMargin;
|
||||
nsMargin debugPadding;
|
||||
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
|
||||
{
|
||||
PRBool isHorizontal = IsHorizontal();
|
||||
|
@ -1582,7 +1616,7 @@ nsBoxFrame::PaintChildren(nsIPresContext* aPresContext,
|
|||
aRenderingContext.SetColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const nsStyleDisplay* disp = GetStyleDisplay();
|
||||
|
||||
|
@ -1630,6 +1664,7 @@ nsBoxFrame::PaintChildren(nsIPresContext* aPresContext,
|
|||
if (hasClipped)
|
||||
aRenderingContext.PopState();
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
|
||||
{
|
||||
float p2t;
|
||||
|
@ -1710,6 +1745,7 @@ nsBoxFrame::PaintChildren(nsIPresContext* aPresContext,
|
|||
if (hasClipped)
|
||||
aRenderingContext.PopState();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt)
|
||||
|
@ -1761,12 +1797,14 @@ nsBoxFrame::GetType() const
|
|||
return nsLayoutAtoms::boxFrame;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::GetDebug(PRBool& aDebug)
|
||||
{
|
||||
aDebug = (mState & NS_STATE_CURRENTLY_IN_DEBUG);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
|
@ -1785,6 +1823,7 @@ nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||
nsPoint originOffset;
|
||||
GetOriginToViewOffset(aPresContext, originOffset, &view);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
// get the debug frame.
|
||||
if (view || (mState & NS_STATE_IS_ROOT))
|
||||
{
|
||||
|
@ -1801,6 +1840,7 @@ nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIFrame *hit = nsnull;
|
||||
nsPoint tmp;
|
||||
|
@ -2203,6 +2243,7 @@ nsBoxFrame::DrawSpacer(nsIPresContext* aPresContext, nsIRenderingContext& aRende
|
|||
//DrawKnob(aPresContext, aRenderingContext, x + size - spacerSize, y, spacerSize);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
void
|
||||
nsBoxFrame::GetDebugBorder(nsMargin& aInset)
|
||||
{
|
||||
|
@ -2225,7 +2266,7 @@ nsBoxFrame::GetDebugPadding(nsMargin& aPadding)
|
|||
{
|
||||
aPadding.SizeTo(2,2,2,2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
nsBoxFrame::PixelMarginToTwips(nsIPresContext* aPresContext, nsMargin& aMarginPixels)
|
||||
|
|
|
@ -103,7 +103,10 @@ public:
|
|||
NS_IMETHOD GetMaxSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
|
||||
NS_IMETHOD GetFlex(nsBoxLayoutState& aBoxLayoutState, nscoord& aFlex);
|
||||
NS_IMETHOD GetAscent(nsBoxLayoutState& aBoxLayoutState, nscoord& aAscent);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aBoxLayoutState, PRBool aDebug);
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug);
|
||||
#endif
|
||||
NS_IMETHOD GetFrame(nsIFrame** aFrame);
|
||||
NS_IMETHOD GetVAlign(Valignment& aAlign);
|
||||
NS_IMETHOD GetHAlign(Halignment& aAlign);
|
||||
|
@ -111,7 +114,6 @@ public:
|
|||
NS_IMETHOD GetInset(nsMargin& aInset);
|
||||
NS_IMETHOD BeginLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug);
|
||||
NS_IMETHOD SetParent(const nsIFrame* aParent);
|
||||
|
||||
//NS_IMETHOD GetMouseThrough(PRBool& aMouseThrough);
|
||||
|
@ -208,12 +210,12 @@ public:
|
|||
protected:
|
||||
#ifdef DEBUG_LAYOUT
|
||||
virtual void GetBoxName(nsAutoString& aName);
|
||||
virtual void PropagateDebug(nsBoxLayoutState& aState);
|
||||
#endif
|
||||
|
||||
virtual PRBool HasStyleChange();
|
||||
virtual void SetStyleChangeFlag(PRBool aDirty);
|
||||
|
||||
virtual void PropagateDebug(nsBoxLayoutState& aState);
|
||||
|
||||
|
||||
|
||||
|
@ -258,7 +260,6 @@ protected:
|
|||
nsIFrame** aFrame);
|
||||
|
||||
private:
|
||||
nsresult SetDebug(nsIPresContext* aPresContext, PRBool aDebug);
|
||||
|
||||
// helper methods
|
||||
void TranslateEventCoords(nsIPresContext* aPresContext,
|
||||
|
@ -268,23 +269,26 @@ private:
|
|||
static PRBool AdjustTargetToScope(nsIFrame* aParent, nsIFrame*& aTargetFrame);
|
||||
|
||||
|
||||
PRBool GetInitialDebug(PRBool& aDebug);
|
||||
|
||||
void GetDebugPref(nsIPresContext* aPresContext);
|
||||
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
nsresult SetDebug(nsIPresContext* aPresContext, PRBool aDebug);
|
||||
PRBool GetInitialDebug(PRBool& aDebug);
|
||||
void GetDebugPref(nsIPresContext* aPresContext);
|
||||
|
||||
nsresult DisplayDebugInfoFor(nsIBox* aBox,
|
||||
nsIPresContext* aPresContext,
|
||||
nsPoint& aPoint,
|
||||
PRInt32& aCursor);
|
||||
#endif
|
||||
|
||||
nsresult GetFrameSizeWithMargin(nsIBox* aBox, nsSize& aSize);
|
||||
|
||||
void GetDebugBorder(nsMargin& aInset);
|
||||
void GetDebugPadding(nsMargin& aInset);
|
||||
void GetDebugMargin(nsMargin& aInset);
|
||||
|
||||
#endif
|
||||
|
||||
nsresult GetFrameSizeWithMargin(nsIBox* aBox, nsSize& aSize);
|
||||
|
||||
void PixelMarginToTwips(nsIPresContext* aPresContext, nsMargin& aMarginPixels);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
|
@ -306,8 +310,10 @@ private:
|
|||
|
||||
nsIPresContext* mPresContext;
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
static PRBool gDebug;
|
||||
static nsIBox* mDebugChild;
|
||||
#endif
|
||||
|
||||
}; // class nsBoxFrame
|
||||
|
||||
|
|
|
@ -395,6 +395,7 @@ nsContainerBox::InitChildren(nsBoxLayoutState& aState, nsIFrame* aList)
|
|||
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
void
|
||||
nsContainerBox::SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, PRBool aDebug)
|
||||
{
|
||||
|
@ -406,6 +407,7 @@ nsContainerBox::SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, PR
|
|||
child->GetNextBox(&child);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsContainerBox::SanityCheck(nsFrameList& aFrameList)
|
||||
|
|
|
@ -79,7 +79,9 @@ public:
|
|||
virtual void InitChildren(nsBoxLayoutState& aState, nsIFrame* aList);
|
||||
virtual nsIBox* GetPrevious(nsIFrame* aChild);
|
||||
virtual void SanityCheck(nsFrameList& aFrameList);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
virtual void SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, PRBool aDebug);
|
||||
#endif
|
||||
virtual void CheckBoxOrder(nsBoxLayoutState& aState);
|
||||
|
||||
static nsresult LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect& aRect);
|
||||
|
|
|
@ -60,8 +60,8 @@ class nsBoxLayoutState;
|
|||
struct nsRect;
|
||||
struct nsSize;
|
||||
|
||||
// {162F6B5A-F926-11d3-BA06-001083023C1E}
|
||||
#define NS_IBOX_IID { 0x162f6b5a, 0xf926, 0x11d3, { 0xba, 0x6, 0x0, 0x10, 0x83, 0x2, 0x3c, 0x1e } }
|
||||
// {b29f0101-eb3c-4f66-804e-58faf9dbb380}
|
||||
#define NS_IBOX_IID { 0xb29f0101, 0xeb3c, 0x4f66, { 0x80, 0x4e, 0x58, 0xfa, 0xf9, 0xdb, 0xb3, 0x80 } }
|
||||
|
||||
#define DEFAULT_ORDINAL_GROUP 1
|
||||
|
||||
|
@ -100,8 +100,6 @@ public:
|
|||
NS_IMETHOD HasDirtyChildren(PRBool& aIsDirty)=0;
|
||||
NS_IMETHOD MarkDirty(nsBoxLayoutState& aState)=0;
|
||||
NS_IMETHOD MarkDirtyChildren(nsBoxLayoutState& aState)=0;
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug)=0;
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug)=0;
|
||||
NS_IMETHOD GetChildBox(nsIBox** aBox)=0;
|
||||
NS_IMETHOD GetNextBox(nsIBox** aBox)=0;
|
||||
NS_IMETHOD SetNextBox(nsIBox* aBox)=0;
|
||||
|
@ -123,7 +121,6 @@ public:
|
|||
NS_IMETHOD GetDirection(PRBool& aIsNormal)=0;
|
||||
NS_IMETHOD Redraw(nsBoxLayoutState& aState, const nsRect* aRect = nsnull, PRBool aImmediate = PR_FALSE)=0;
|
||||
NS_IMETHOD NeedsRecalc()=0;
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIBox** aBox)=0;
|
||||
NS_IMETHOD RelayoutDirtyChild(nsBoxLayoutState& aState, nsIBox* aChild)=0;
|
||||
NS_IMETHOD RelayoutStyleChange(nsBoxLayoutState& aState, nsIBox* aChild)=0;
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild)=0;
|
||||
|
@ -131,6 +128,10 @@ public:
|
|||
NS_IMETHOD MarkChildrenStyleChange()=0;
|
||||
NS_IMETHOD MarkStyleChange(nsBoxLayoutState& aState)=0;
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug)=0;
|
||||
NS_IMETHOD GetDebug(PRBool& aDebug)=0;
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIBox** aBox)=0;
|
||||
|
||||
NS_IMETHOD DumpBox(FILE* out)=0;
|
||||
#endif
|
||||
NS_IMETHOD ChildrenMustHaveWidgets(PRBool& aMust)=0;
|
||||
|
|
|
@ -1066,6 +1066,7 @@ nsMenuFrame::MarkChildrenStyleChange()
|
|||
return rv;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHODIMP
|
||||
nsMenuFrame::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
||||
{
|
||||
|
@ -1100,6 +1101,7 @@ nsMenuFrame::SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, PRBool aDebug)
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void ConvertPosition(nsIContent* aPopupElt, nsString& aAnchor, nsString& aAlign)
|
||||
{
|
||||
|
@ -1853,7 +1855,9 @@ nsMenuFrame::InsertFrames(nsIPresContext* aPresContext,
|
|||
mPopupFrames.InsertFrames(nsnull, nsnull, aFrameList);
|
||||
|
||||
nsBoxLayoutState state(aPresContext);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
|
||||
#endif
|
||||
rv = MarkDirtyChildren(state);
|
||||
} else {
|
||||
rv = nsBoxFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, aFrameList);
|
||||
|
@ -1882,7 +1886,9 @@ nsMenuFrame::AppendFrames(nsIPresContext* aPresContext,
|
|||
|
||||
mPopupFrames.AppendFrames(nsnull, aFrameList);
|
||||
nsBoxLayoutState state(aPresContext);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
|
||||
#endif
|
||||
rv = MarkDirtyChildren(state);
|
||||
} else {
|
||||
rv = nsBoxFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList);
|
||||
|
|
|
@ -91,7 +91,9 @@ public:
|
|||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug);
|
||||
#endif
|
||||
|
||||
NS_IMETHOD IsActive(PRBool& aResult) { aResult = PR_TRUE; return NS_OK; };
|
||||
|
||||
|
@ -229,7 +231,9 @@ protected:
|
|||
virtual ~nsMenuFrame();
|
||||
|
||||
protected:
|
||||
#ifdef DEBUG_LAYOUT
|
||||
nsresult SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, PRBool aDebug);
|
||||
#endif
|
||||
|
||||
nsFrameList mPopupFrames;
|
||||
PRPackedBool mIsMenu; // Whether or not we can even have children or not.
|
||||
|
|
|
@ -296,6 +296,7 @@ nsPopupSetFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHODIMP
|
||||
nsPopupSetFrame::SetDebug(nsBoxLayoutState& aState, PRBool aDebug)
|
||||
{
|
||||
|
@ -329,7 +330,7 @@ nsPopupSetFrame::SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, PRBool aDeb
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -96,7 +96,9 @@ public:
|
|||
|
||||
// nsIBox
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug);
|
||||
#endif
|
||||
|
||||
// Used to destroy our popup frames.
|
||||
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
||||
|
@ -139,7 +141,9 @@ protected:
|
|||
void UpdateDismissalListener(nsIMenuParent* aMenuParent);
|
||||
|
||||
protected:
|
||||
#ifdef DEBUG_LAYOUT
|
||||
nsresult SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, PRBool aDebug);
|
||||
#endif
|
||||
|
||||
nsPopupFrameList* mPopupList;
|
||||
|
||||
|
|
|
@ -335,12 +335,14 @@ nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
|
||||
EnsureOrient();
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
if (mState & NS_STATE_DEBUG_WAS_SET) {
|
||||
if (mState & NS_STATE_SET_TO_DEBUG)
|
||||
SetDebug(aState, PR_TRUE);
|
||||
else
|
||||
SetDebug(aState, PR_FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
// get the content area inside our borders
|
||||
nsRect clientRect(0,0,0,0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче