Relanding bug 403657, since there was no obvious perf impact
authorbzbarsky@mit.edu
Mon, 03 Dec 2007 13:31:26 -0800
changeset 8602 368618a98a1454990bc44ac7cc7e1fbacb2dab37
parent 8601 5ba659aad0aabbcecba9356e87ca286134ea2ef2
child 8603 06e20efee31f98dc9a7b2cea0959fa1fbdf54660
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherderautoland@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs403657
milestone1.9b2pre
Relanding bug 403657, since there was no obvious perf impact
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1076,27 +1076,28 @@ nsBlockFrame::Reflow(nsPresContext*     
       (mLines.empty() ||
        mLines.front()->IsBlock() ||
        0 == mLines.front()->mBounds.height)) {
     // Reflow the bullet
     nsHTMLReflowMetrics metrics;
     ReflowBullet(state, metrics);
 
     nscoord baseline;
-    if (!nsLayoutUtils::GetFirstLineBaseline(this, &baseline)) {
-      baseline = 0;
-    }
+    if (nsLayoutUtils::GetFirstLineBaseline(this, &baseline)) {
+      // We have some lines to align the bullet with.  
+
+      // Doing the alignment using the baseline will also cater for
+      // bullets that are placed next to a child block (bug 92896)
     
-    // Doing the alignment using the baseline will also cater for
-    // bullets that are placed next to a child block (bug 92896)
-    
-    // Tall bullets won't look particularly nice here...
-    nsRect bbox = mBullet->GetRect();
-    bbox.y = baseline - metrics.ascent;
-    mBullet->SetRect(bbox);
+      // Tall bullets won't look particularly nice here...
+      nsRect bbox = mBullet->GetRect();
+      bbox.y = baseline - metrics.ascent;
+      mBullet->SetRect(bbox);
+    }
+    // Otherwise just leave the bullet where it is, up against our top padding.
   }
 
   // Compute our final size
   ComputeFinalSize(aReflowState, state, aMetrics);
 
   ComputeCombinedArea(aReflowState, aMetrics);
   // Factor overflow container child bounds into the overflow area
   aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea,