зеркало из https://github.com/mozilla/gecko-dev.git
Bug 386141: Switch NS_FRAME_IS_BOX to use IsFrameOfType. Patch by fantasai, r+sr=roc.
This commit is contained in:
Родитель
c062ff619a
Коммит
f8eb726afe
|
@ -1386,6 +1386,7 @@ GK_ATOM(imageBoxFrame, "ImageBoxFrame")
|
|||
GK_ATOM(imageFrame, "ImageFrame")
|
||||
GK_ATOM(imageControlFrame, "ImageControlFrame")
|
||||
GK_ATOM(inlineFrame, "InlineFrame")
|
||||
GK_ATOM(leafBoxFrame, "LeafBoxFrame")
|
||||
GK_ATOM(legendFrame, "LegendFrame")
|
||||
GK_ATOM(letterFrame, "LetterFrame")
|
||||
GK_ATOM(lineFrame, "LineFrame")
|
||||
|
|
|
@ -174,10 +174,6 @@ enum {
|
|||
// If this bit is set, then the frame corresponds to generated content
|
||||
NS_FRAME_GENERATED_CONTENT = 0x00000040,
|
||||
|
||||
// If this bit is set, then the frame uses XUL flexible box layout
|
||||
// for its children.
|
||||
NS_FRAME_IS_BOX = 0x00000080,
|
||||
|
||||
// If this bit is set, then the frame has been moved out of the flow,
|
||||
// e.g., it is absolutely positioned or floated
|
||||
NS_FRAME_OUT_OF_FLOW = 0x00000100,
|
||||
|
@ -1463,6 +1459,7 @@ public:
|
|||
// A frame that participates in inline reflow, i.e., one that
|
||||
// requires nsHTMLReflowState::mLineLayout.
|
||||
eLineParticipant = 1 << 6,
|
||||
eXULBox = 1 << 7,
|
||||
|
||||
|
||||
// These are to allow nsFrame::Init to assert that IsFrameOfType
|
||||
|
@ -1852,7 +1849,10 @@ NS_PTR_TO_INT32(frame->GetProperty(nsGkAtoms::embeddingLevel))
|
|||
// BOX LAYOUT METHODS
|
||||
// These methods have been migrated from nsIBox and are in the process of
|
||||
// being refactored. DO NOT USE OUTSIDE OF XUL.
|
||||
PRBool IsBoxFrame() const { return (mState & NS_FRAME_IS_BOX) != 0; }
|
||||
PRBool IsBoxFrame() const
|
||||
{
|
||||
return IsFrameOfType(nsIFrame::eXULBox);
|
||||
}
|
||||
PRBool IsBoxWrapped() const
|
||||
{ return (!IsBoxFrame() && mParent && mParent->IsBoxFrame()); }
|
||||
|
||||
|
|
|
@ -139,7 +139,6 @@ nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
|
|||
nsContainerFrame(aContext),
|
||||
mMouseThrough(unset)
|
||||
{
|
||||
mState |= NS_FRAME_IS_BOX;
|
||||
mState |= NS_STATE_IS_HORIZONTAL;
|
||||
mState |= NS_STATE_AUTO_STRETCH;
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
// that contains a block so nsHTMLReflowState doesn't tell us to be
|
||||
// NS_INTRINSICSIZE wide.)
|
||||
return nsContainerFrame::IsFrameOfType(aFlags &
|
||||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
||||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | eXULBox));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -75,7 +75,6 @@ NS_NewLeafBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
|
|||
nsLeafBoxFrame::nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext)
|
||||
: nsLeafFrame(aContext), mMouseThrough(unset)
|
||||
{
|
||||
mState |= NS_FRAME_IS_BOX;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
|
@ -373,6 +372,12 @@ nsLeafBoxFrame::GetFrameName(nsAString& aResult) const
|
|||
}
|
||||
#endif
|
||||
|
||||
nsIAtom*
|
||||
nsLeafBoxFrame::GetType() const
|
||||
{
|
||||
return nsGkAtoms::leafBoxFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt)
|
||||
nsLeafBoxFrame::AddRef(void)
|
||||
{
|
||||
|
|
|
@ -58,12 +58,13 @@ public:
|
|||
virtual nscoord GetFlex(nsBoxLayoutState& aState);
|
||||
virtual nscoord GetBoxAscent(nsBoxLayoutState& aState);
|
||||
|
||||
virtual nsIAtom* GetType() const;
|
||||
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
|
||||
{
|
||||
// This is bogus, but it's what we've always done.
|
||||
// Note that nsLeafFrame is also eReplacedContainsBlock.
|
||||
return nsLeafFrame::IsFrameOfType(aFlags &
|
||||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
||||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче