Bug 590302 - Crash [@ nsTextControlFrame::CalcIntrinsicSize] on print preview with textarea, position:fixed; r=roc a=blocking2.0:final+

This commit is contained in:
Ehsan Akhgari 2010-08-25 01:44:18 -04:00
parent 07de814ba1
commit 669cfe263b
3 changed files with 13 additions and 5 deletions

View File

@ -0,0 +1,4 @@
<html class="reftest-print" xmlns="http://www.w3.org/1999/xhtml" style=" float: left; white-space: pre; ">
<div style="page-break-before: always;"></div>
<textarea style="position: fixed;"></textarea>
</html>

View File

@ -42,3 +42,4 @@ load 513113-1.html
load 570624-1.html
load 498698-1.html
asserts(1) load 578604-1.html # bug 584564
asserts(5) load 590302-1.xhtml # bug 584564

View File

@ -299,7 +299,8 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
// been reflowed yet, so we can't get its used padding, but it shouldn't be
// using percentage padding anyway.
nsMargin childPadding;
if (GetFirstChild(nsnull)->GetStylePadding()->GetPadding(childPadding)) {
nsIFrame* firstChild = GetFirstChild(nsnull);
if (firstChild && firstChild->GetStylePadding()->GetPadding(childPadding)) {
aIntrinsicSize.width += childPadding.LeftRight();
} else {
NS_ERROR("Percentage padding on value div?");
@ -328,12 +329,14 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
nsIScrollableFrame *scrollableFrame = do_QueryFrame(first);
NS_ASSERTION(scrollableFrame, "Child must be scrollable");
nsMargin scrollbarSizes =
if (scrollableFrame) {
nsMargin scrollbarSizes =
scrollableFrame->GetDesiredScrollbarSizes(PresContext(), aRenderingContext);
aIntrinsicSize.width += scrollbarSizes.LeftRight();
aIntrinsicSize.height += scrollbarSizes.TopBottom();;
aIntrinsicSize.width += scrollbarSizes.LeftRight();
aIntrinsicSize.height += scrollbarSizes.TopBottom();;
}
}
return NS_OK;