Fix behavior of -moz-box-shadow on flexible non-flexbox children of flexboxes. (Bug 531098) r=roc
authorL. David Baron <dbaron@dbaron.org>
Sun, 13 Dec 2009 19:40:55 -0800
changeset 35703 038564bc6eb7
parent 35702 a26df386758f
child 35704 894a8e2bddb2
push id10686
push userdbaron@mozilla.com
push dateMon, 14 Dec 2009 03:43:27 +0000
treeherdermozilla-central@4700e3c42868 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs531098
milestone1.9.3a1pre
Fix behavior of -moz-box-shadow on flexible non-flexbox children of flexboxes. (Bug 531098) r=roc
layout/generic/nsFrame.cpp
layout/reftests/bugs/531098-1-ref.html
layout/reftests/bugs/531098-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6306,16 +6306,22 @@ nsFrame::DoLayout(nsBoxLayoutState& aSta
       }
 
       // ensure our size is what we think is should be. Someone could have
       // reset the frame to be smaller or something dumb like that. 
       SetSize(nsSize(ourRect.width, ourRect.height));
     }
   }
 
+  // Should we do this if IsCollapsed() is true?
+  nsSize size(GetSize());
+  desiredSize.mOverflowArea.UnionRect(desiredSize.mOverflowArea,
+                                      nsRect(nsPoint(0, 0), size));
+  FinishAndStoreOverflow(&desiredSize.mOverflowArea, size);
+
   SyncLayout(aState);
 
   return rv;
 }
 
 nsresult
 nsFrame::BoxReflow(nsBoxLayoutState&        aState,
                    nsPresContext*           aPresContext,
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/531098-1-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style type="text/css">
+html, body { margin: 0; padding: 0; border: none; }
+</style>
+
+<div style="position: absolute; width: 200px; height: 400px; top: 100px; left: 100px; -moz-box-shadow: 0 0 20px blue">A</div>
+<div style="position: absolute; width: 100px; height: 400px; top: 100px; left: 400px; -moz-box-shadow: 0 0 20px blue">B</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/531098-1.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<style type="text/css">
+html, body { margin: 0; padding: 0; border: none; }
+</style>
+
+<div style="margin: 100px; height: 400px; width: 400px; display: -moz-box; -moz-box-orient: horizontal">
+
+  <div style="width: 200px; -moz-box-shadow: 0 0 20px blue">A</div>
+  <div style="width: 100px"></div>
+  <div style="-moz-box-flex: 1; -moz-box-shadow: 0 0 20px blue">B</div>
+
+</div>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1344,9 +1344,10 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") ==
 == 528038-1a.html 528038-1-ref.html
 == 528038-1b.html 528038-1-ref.html
 == 528038-1c.html 528038-1-ref.html
 == 528038-1d.html 528038-1-ref.html
 == 528038-1e.html 528038-1-ref.html
 == 528038-1f.html 528038-1-ref.html
 == 528038-2.html 528038-2-ref.html
 == 530686-1.html 530686-1-ref.html
+== 531098-1.html 531098-1-ref.html
 == 531371-1.html 531371-1-ref.html