зеркало из https://github.com/mozilla/gecko-dev.git
b=17546. Changed block frame code to save/restore space manager when create
a space manager, and changes button code to use the NS_BLOCK_SPACE_MGR flag when creating the area frame
This commit is contained in:
Родитель
475e7d2c79
Коммит
2e7ee4874b
|
@ -387,7 +387,10 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
PRUint32 flags = NS_BLOCK_SPACE_MGR;
|
||||
if (mInline) {
|
||||
flags |= NS_BLOCK_SHRINK_WRAP;
|
||||
}
|
||||
nsIFrame* areaFrame;
|
||||
NS_NewAreaFrame(&areaFrame, flags);
|
||||
mFrames.SetFrames(areaFrame);
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -1393,6 +1393,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Should we create a space manager?
|
||||
nsCOMPtr<nsISpaceManager> spaceManager;
|
||||
nsISpaceManager* oldSpaceManager = aReflowState.mSpaceManager;
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsSpaceManager* rawPtr = new nsSpaceManager(this);
|
||||
if (!rawPtr) {
|
||||
|
@ -1529,6 +1530,13 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
// If we set the space manager, then restore the old space manager now that we're
|
||||
// going out of scope
|
||||
if (NS_BLOCK_SPACE_MGR & mState) {
|
||||
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
|
||||
reflowState.mSpaceManager = oldSpaceManager;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NOISY_SPACEMANAGER
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
|
|
|
@ -387,7 +387,10 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
PRUint32 flags = NS_BLOCK_SPACE_MGR;
|
||||
if (mInline) {
|
||||
flags |= NS_BLOCK_SHRINK_WRAP;
|
||||
}
|
||||
nsIFrame* areaFrame;
|
||||
NS_NewAreaFrame(&areaFrame, flags);
|
||||
mFrames.SetFrames(areaFrame);
|
||||
|
|
Загрузка…
Ссылка в новой задаче