Back out rev bf05b4614f5f, I landed the wrong patch. r=me a=backout
authorMats Palmgren <matspal@gmail.com>
Sat, 19 May 2012 21:42:56 +0200
changeset 95801 1532b1e3741b4a341250667ceeac709280ee98bc
parent 95799 bf05b4614f5f63df332ef28b49643da0cb33029a
child 95802 c605ef5e27a32d4fa2f963fd5b046b2add139df0
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, backout
milestone14.0a2
Back out rev bf05b4614f5f, I landed the wrong patch. r=me a=backout
layout/generic/nsFrame.cpp
layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html
layout/reftests/margin-collapsing/scrollable-horizontal-margin.html
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6733,16 +6733,36 @@ nsIFrame::FinishAndStoreOverflow(nsOverf
   // even if the frame rect is empty.
   // Pending a real fix for bug 426879, don't do this for inline frames
   // with zero width.
   if (aNewSize.width != 0 || !IsInlineFrame(this)) {
     NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
       nsRect& o = aOverflowAreas.Overflow(otype);
       o.UnionRectEdges(o, bounds);
     }
+
+    if (!nsLayoutUtils::IsPopup(this)) {
+      // Include margin in scrollable overflow.
+      // XXX In theory this should consider margin collapsing
+      nsRect marginBounds(bounds);
+      nsMargin margin = GetUsedMargin();
+
+      // Bug 724352 - vertical scrollable overflow only matters for
+      // scroll frames which are block margin roots and has already
+      // accumulated child vertical margins during reflow.  We need
+      // to revisit this when using UpdateOverflow for non-transform
+      // style changes (bug 719177).
+      margin.top = 0;
+      margin.bottom = 0;
+
+      ApplySkipSides(margin);
+      marginBounds.SaturatingInflate(margin);
+      nsRect& so = aOverflowAreas.ScrollableOverflow();
+      so.SaturatingUnionRectEdges(so, marginBounds);
+    }
   }
 
   // Note that NS_STYLE_OVERFLOW_CLIP doesn't clip the frame background,
   // so we add theme background overflow here so it's not clipped.
   if (!IsBoxWrapped() && IsThemed(disp)) {
     nsRect r(bounds);
     nsPresContext *presContext = PresContext();
     if (presContext->GetTheme()->
--- a/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html
+++ b/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html
@@ -6,20 +6,20 @@
 
         html,body {
             color:black; background-color:white; font-size:16px; padding:0; margin:0;
         }
 	
 x1,x2,x3,x4,x5,x6 { display:block; }
 x2 { overflow:auto; width:100px; background:grey; }
 x4 { width: 70px; }
-x3 { width: 70px; padding-left: 20px; padding-right: 10px; }
+x3 { width: 70px; padding: 0 20px; }
     </style>
 </head>
 <body>
 
 <x1><x2 style="height:50px;">
   <x3><x4 style="height:20px; background:lime; "></x4></x3>
-</x2></x1>
+</x2>
 
 
 </body>
 </html>
--- a/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html
+++ b/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html
@@ -12,13 +12,13 @@ x1,x2,x3,x4,x5,x6 { display:block; }
 x2 { overflow:auto; width:100px; background:grey; }
 x4 { width: 70px; margin: 0 20px; }
     </style>
 </head>
 <body>
 
 <x1><x2 style="height:50px;">
   <x4 style="height:20px; background:lime; "></x4>
-</x2></x1>
+</x2>
 
 
 </body>
 </html>