Bug 430352. Use the same border throughout. r+sr=roc
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 17 Jul 2008 09:32:49 -0400
changeset 16011 bee72059de1597d0f4d8428a55a002effc710e53
parent 16010 b71578e7622ace13f38187e11849cb6c74eab20e
child 16012 fc4af4573716a012fa302592df7997f014009c30
push idunknown
push userunknown
push dateunknown
bugs430352
milestone1.9.1a1pre
Bug 430352. Use the same border throughout. r+sr=roc
layout/generic/crashtests/430352-1.html
layout/generic/crashtests/crashtests.list
layout/generic/nsBlockFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/430352-1.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html style="border: 1px dotted red; font-size: 0; -moz-appearance: scrollbartrack-horizontal; width: 12em;">
+<head></head>
+<body style="position: absolute;"></body>
+</html>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -132,8 +132,9 @@ load 412201-1.xhtml
 load 414061-1.html
 load 414719-1.html
 load 415685-1.html
 load 416264-1.html
 load 416476-1.html
 load 418532-1.html
 load 421404-1.html
 load 425253-1.html
+load 430352-1.html
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -791,19 +791,20 @@ CalculateContainingBlockSizeForAbsolutes
   // The issue here is that for a 'height' of 'auto' the reflow state
   // code won't know how to calculate the containing block height
   // because it's calculated bottom up. So we use our own computed
   // size as the dimensions.
   nsIFrame* frame = aReflowState.frame;
 
   nsSize cbSize(aFrameSize);
     // Containing block is relative to the padding edge
-  const nsMargin& border = aReflowState.mStyleBorder->GetActualBorder();
-  cbSize.width -= border.left + border.right;
-  cbSize.height -= border.top + border.bottom;
+  const nsMargin& border =
+    aReflowState.mComputedBorderPadding - aReflowState.mComputedPadding;
+  cbSize.width -= border.LeftRight();
+  cbSize.height -= border.TopBottom();
 
   if (frame->GetParent()->GetContent() == frame->GetContent()) {
     // We are a wrapped frame for the content. Use the container's
     // dimensions, if they have been precomputed.
     // XXX This is a hack! We really should be waiting until the outermost
     // frame is fully reflowed and using the resulting dimensions, even
     // if they're intrinsic.
     // In fact we should be attaching absolute children to the outermost