mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 03:18:41 +00:00
Fixed it to so the root-frame isn't considered a containing block, and
changed SetRect() so it only resizes the child frame larger if its 'height' is set to 'auto'
This commit is contained in:
parent
22229b372a
commit
c4b2263dbf
@ -67,7 +67,7 @@ public:
|
|||||||
nsGUIEvent* aEvent,
|
nsGUIEvent* aEvent,
|
||||||
nsEventStatus& aEventStatus);
|
nsEventStatus& aEventStatus);
|
||||||
NS_IMETHOD IsPercentageBase(PRBool& aBase) const {
|
NS_IMETHOD IsPercentageBase(PRBool& aBase) const {
|
||||||
aBase = PR_TRUE;
|
aBase = PR_FALSE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,13 +114,19 @@ RootFrame::SetRect(const nsRect& aRect)
|
|||||||
nsresult rv = nsHTMLContainerFrame::SetRect(aRect);
|
nsresult rv = nsHTMLContainerFrame::SetRect(aRect);
|
||||||
|
|
||||||
// Make sure our child's frame is adjusted as well
|
// Make sure our child's frame is adjusted as well
|
||||||
|
// Note: only do this if it's 'height' is 'auto'
|
||||||
nsIFrame* kidFrame = mFrames.FirstChild();
|
nsIFrame* kidFrame = mFrames.FirstChild();
|
||||||
if (nsnull != kidFrame) {
|
if (nsnull != kidFrame) {
|
||||||
nscoord yDelta = aRect.height - mNaturalHeight;
|
nsStylePosition* kidPosition;
|
||||||
nsSize kidSize;
|
kidFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)kidPosition);
|
||||||
|
|
||||||
kidFrame->GetSize(kidSize);
|
if (eStyleUnit_Auto == kidPosition->mHeight.GetUnit()) {
|
||||||
kidFrame->SizeTo(kidSize.width, kidSize.height + yDelta);
|
nscoord yDelta = aRect.height - mNaturalHeight;
|
||||||
|
nsSize kidSize;
|
||||||
|
|
||||||
|
kidFrame->GetSize(kidSize);
|
||||||
|
kidFrame->SizeTo(kidSize.width, kidSize.height + yDelta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
nsGUIEvent* aEvent,
|
nsGUIEvent* aEvent,
|
||||||
nsEventStatus& aEventStatus);
|
nsEventStatus& aEventStatus);
|
||||||
NS_IMETHOD IsPercentageBase(PRBool& aBase) const {
|
NS_IMETHOD IsPercentageBase(PRBool& aBase) const {
|
||||||
aBase = PR_TRUE;
|
aBase = PR_FALSE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,13 +114,19 @@ RootFrame::SetRect(const nsRect& aRect)
|
|||||||
nsresult rv = nsHTMLContainerFrame::SetRect(aRect);
|
nsresult rv = nsHTMLContainerFrame::SetRect(aRect);
|
||||||
|
|
||||||
// Make sure our child's frame is adjusted as well
|
// Make sure our child's frame is adjusted as well
|
||||||
|
// Note: only do this if it's 'height' is 'auto'
|
||||||
nsIFrame* kidFrame = mFrames.FirstChild();
|
nsIFrame* kidFrame = mFrames.FirstChild();
|
||||||
if (nsnull != kidFrame) {
|
if (nsnull != kidFrame) {
|
||||||
nscoord yDelta = aRect.height - mNaturalHeight;
|
nsStylePosition* kidPosition;
|
||||||
nsSize kidSize;
|
kidFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)kidPosition);
|
||||||
|
|
||||||
kidFrame->GetSize(kidSize);
|
if (eStyleUnit_Auto == kidPosition->mHeight.GetUnit()) {
|
||||||
kidFrame->SizeTo(kidSize.width, kidSize.height + yDelta);
|
nscoord yDelta = aRect.height - mNaturalHeight;
|
||||||
|
nsSize kidSize;
|
||||||
|
|
||||||
|
kidFrame->GetSize(kidSize);
|
||||||
|
kidFrame->SizeTo(kidSize.width, kidSize.height + yDelta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
Loading…
Reference in New Issue
Block a user