diff --git a/layout/forms/crashtests/590302-1.xhtml b/layout/forms/crashtests/590302-1.xhtml new file mode 100644 index 00000000000..339a424f7b3 --- /dev/null +++ b/layout/forms/crashtests/590302-1.xhtml @@ -0,0 +1,4 @@ + +
+ + diff --git a/layout/forms/crashtests/crashtests.list b/layout/forms/crashtests/crashtests.list index d439c26895d..b3f8ea2068b 100644 --- a/layout/forms/crashtests/crashtests.list +++ b/layout/forms/crashtests/crashtests.list @@ -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 diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 5bde0b98a9a..2dac683f062 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -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;