Bug 849263: Make OverflowChangedTracker actually sort by depth in the tree where it intended to. r=roc
authorL. David Baron <dbaron@dbaron.org>
Sun, 10 Mar 2013 12:44:13 -0700
changeset 124334 9a9689e414e452f7948fdf37445e2d1954811e26
parent 124333 6ff3de859ce3109659f5738a7625085bcc1be190
child 124335 cc6c725d463de2d2f55114a5fb7394bb1a634adc
push id24417
push userryanvm@gmail.com
push dateMon, 11 Mar 2013 23:58:07 +0000
treeherdermozilla-central@7433bc4545c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs849263
milestone22.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 849263: Make OverflowChangedTracker actually sort by depth in the tree where it intended to. r=roc
layout/base/RestyleTracker.h
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -121,21 +121,25 @@ private:
     {}
 
     bool operator==(const Entry& aOther) const
     {
       return mFrame == aOther.mFrame;
     }
  
     /**
-     * Sort by the frame pointer.
+     * Sort by *reverse* depth in the tree, and break ties with
+     * the frame pointer.
      */
     bool operator<(const Entry& aOther) const
     {
-      return mFrame < aOther.mFrame;
+      if (mDepth == aOther.mDepth) {
+        return mFrame < aOther.mFrame;
+      }
+      return mDepth > aOther.mDepth; /* reverse, want "min" to be deepest */
     }
 
     static int compare(const Entry& aOne, const Entry& aTwo)
     {
       if (aOne == aTwo) {
         return 0;
       } else if (aOne < aTwo) {
         return -1;