Bug 423436. Elements embedding SVG by reference don't resize if they depend on intrinsic percentage width/height. r+sr=dbaron@mozilla.com, blocking1.9=me

This commit is contained in:
jwatt@jwatt.org 2008-03-18 17:11:01 -07:00
parent 12d3737257
commit db01626178
2 changed files with 13 additions and 1 deletions

View File

@ -143,6 +143,7 @@ public:
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
virtual IntrinsicSize GetIntrinsicSize();
virtual nsSize GetIntrinsicRatio();
virtual nsSize ComputeAutoSize(nsIRenderingContext *aRenderingContext,
@ -443,6 +444,16 @@ nsSubDocumentFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
return result;
}
/* virtual */ nsIFrame::IntrinsicSize
nsSubDocumentFrame::GetIntrinsicSize()
{
nsIFrame* subDocRoot = ObtainIntrinsicSizeFrame();
if (subDocRoot) {
return subDocRoot->GetIntrinsicSize();
}
return nsLeafFrame::GetIntrinsicSize();
}
/* virtual */ nsSize
nsSubDocumentFrame::GetIntrinsicRatio()
{

View File

@ -409,7 +409,8 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext)
mStylePosition->mOffset.GetTopUnit() == eStyleUnit_Percent ||
mStylePosition->mOffset.GetBottomUnit() != eStyleUnit_Auto ||
frame->IsBoxFrame() ||
frame->GetIntrinsicSize().height.GetUnit() == eStyleUnit_Percent;
(mStylePosition->mHeight.GetUnit() == eStyleUnit_Auto &&
frame->GetIntrinsicSize().height.GetUnit() == eStyleUnit_Percent);
// If we're the descendant of a table cell that performs special height
// reflows and we could be the child that requires them, always set