Bug 908987 - Honor mIsActive more aggressively to avoid calling IsVisibleConsideringAncestors. r=roc
authorL. David Baron <dbaron@dbaron.org>
Tue, 13 Jan 2015 21:03:11 -0800
changeset 223701 7d3ef4f3fa8fc5509203c0290fa7941bdbaad07b
parent 223700 2896167fae141cf518577a9d9e1d18161cd2bf72
child 223702 8b5e114c159c7d148603bd790883f3dce106e65c
push id10811
push usercbook@mozilla.com
push dateWed, 14 Jan 2015 13:52:17 +0000
treeherderfx-team@b8d38d19dbd9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs908987
milestone38.0a1
Bug 908987 - Honor mIsActive more aggressively to avoid calling IsVisibleConsideringAncestors. r=roc This means that we avoid an O(N^2) calling pattern of IsVisible when we call IsVisible for all tabs of a tabbrowser, since in a tabbrowser (which uses an nsDeckFrame), IsVisibleConsideringAncestors is O(N) in number of earlier tabs.
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -8856,27 +8856,27 @@ PresShell::DidPaintWindow()
     // about compositing of popups.
     return;
   }
 }
 
 bool
 PresShell::IsVisible()
 {
-  if (!mViewManager)
+  if (!mIsActive || !mViewManager)
     return false;
 
   nsView* view = mViewManager->GetRootView();
   if (!view)
     return true;
 
   // inner view of subdoc frame
   view = view->GetParent();
   if (!view)
-    return mIsActive;
+    return true;
 
   // subdoc view
   view = view->GetParent();
   if (!view)
     return true;
 
   nsIFrame* frame = view->GetFrame();
   if (!frame)