Bug 839302: Simplify logic in nsBlockFrame::DrainSelfOverflowList, and replace delete w/ nsAutoPtr. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 07 Feb 2013 17:19:57 -0800
changeset 131123 3f864c99009df4d9a93634450f9c29c10f59f53b
parent 131122 258b97787c17b8f30a4abb393d2debe4e6936910
child 131124 85751b3b03b6766273e0d2d52699731c1513750a
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs839302
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 839302: Simplify logic in nsBlockFrame::DrainSelfOverflowList, and replace delete w/ nsAutoPtr. r=mats
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4402,34 +4402,33 @@ nsBlockFrame::DrainOverflowLines()
 
   // Now append our own overflow lines.
   return DrainSelfOverflowList() || didFindOverflow;
 }
 
 bool
 nsBlockFrame::DrainSelfOverflowList()
 {
+  nsAutoPtr<FrameLines> ourOverflowLines(RemoveOverflowLines());
+  if (!ourOverflowLines) {
+    return false;
+  }
+
   // No need to reparent frames in our own overflow lines/oofs, because they're
   // already ours. But we should put overflow floats back in mFloats.
-  FrameLines* ourOverflowLines = RemoveOverflowLines();
-  if (ourOverflowLines) {
-    nsAutoOOFFrameList oofs(this);
-    if (oofs.mList.NotEmpty()) {
-      // The overflow floats go after our regular floats.
-      mFloats.AppendFrames(nullptr, oofs.mList);
-    }
-  } else {
-    return false;
+  nsAutoOOFFrameList oofs(this);
+  if (oofs.mList.NotEmpty()) {
+    // The overflow floats go after our regular floats.
+    mFloats.AppendFrames(nullptr, oofs.mList);
   }
 
   if (!ourOverflowLines->mLines.empty()) {
     mFrames.AppendFrames(nullptr, ourOverflowLines->mFrames);
     mLines.splice(mLines.end(), ourOverflowLines->mLines);
   }
-  delete ourOverflowLines;
   return true;
 }
 
 /**
  * Pushed floats are floats whose placeholders are in a previous
  * continuation.  They might themselves be next-continuations of a float
  * that partially fit in an earlier continuation, or they might be the
  * first continuation of a float that couldn't be placed at all.