Bug 813358 part 5: Add a post-condition to SortFrameList() to assert that it's actually sorted. r=dbaron
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 30 Nov 2012 15:25:33 -0800
changeset 114668 ceddb3b529deb83302e9c10e427ad75ee9c56e48
parent 114667 58cb9bf14a4c8d3fe4a1789fd1a61941fb2c0d02
child 114669 87c2c1ecf58b19365a7ed31de31a177386acba84
push id18911
push userdholbert@mozilla.com
push dateFri, 30 Nov 2012 23:27:10 +0000
treeherdermozilla-inbound@ceddb3b529de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs813358
milestone20.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 813358 part 5: Add a post-condition to SortFrameList() to assert that it's actually sorted. r=dbaron
layout/base/nsLayoutUtils.h
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -1896,16 +1896,18 @@ nsLayoutUtils::MergeSort(nsIFrame *aSour
 }
 
 template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
 /* static */ void
 nsLayoutUtils::SortFrameList(nsFrameList& aFrameList)
 {
   nsIFrame* head = MergeSort<IsLessThanOrEqual>(aFrameList.FirstChild());
   aFrameList = nsFrameList(head, GetLastSibling(head));
+  MOZ_ASSERT(IsFrameListSorted<IsLessThanOrEqual>(aFrameList),
+             "After we sort a frame list, it should be in sorted order...");
 }
 
 template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
 /* static */ bool
 nsLayoutUtils::IsFrameListSorted(nsFrameList& aFrameList)
 {
   if (aFrameList.IsEmpty()) {
     // empty lists are trivially sorted.