Bug 622542. Ensure that the layer tree is updated after NS_DOCUMENT_STATE_WINDOW_INACTIVE has changed. r=tnikkel,a=blocking
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 03 Feb 2011 21:45:32 +1300
changeset 61837 c5b8aa1d4c8ac937c1ceeb518103f50ce3e99af1
parent 61836 2a13f323dfa05b3a249110a06e0ff219c795c982
child 61838 274e546e9da95d02da1e1706d2cf2ecfa5532020
push idunknown
push userunknown
push dateunknown
reviewerstnikkel, blocking
bugs622542
milestone2.0b12pre
Bug 622542. Ensure that the layer tree is updated after NS_DOCUMENT_STATE_WINDOW_INACTIVE has changed. r=tnikkel,a=blocking
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4991,28 +4991,17 @@ PresShell::DocumentStatesChanged(nsIDocu
     mFrameConstructor->PostRestyleEvent(mDocument->GetRootElement(),
                                         eRestyle_Subtree, NS_STYLE_HINT_NONE);
     VERIFY_STYLE_TREE;
   }
 
   if (aStateMask.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE)) {
     nsIFrame* root = FrameManager()->GetRootFrame();
     if (root) {
-      // It's a display root. So, invalidate the layer contents of
-      // everything we can find. We need to do this because the contents
-      // of controls etc can depend on whether the window is active,
-      // and when a window becomes (in)active it just gets repainted
-      // and we don't specifically invalidate each affected control.
-      nsIWidget* widget = root->GetNearestWidget();
-      if (widget) {
-        LayerManager* layerManager = widget->GetLayerManager();
-        if (layerManager) {
-          FrameLayerBuilder::InvalidateAllThebesLayerContents(layerManager);
-        }
-      }
+      root->InvalidateFrameSubtree();
     }
   }
 }
 
 void
 PresShell::AttributeWillChange(nsIDocument* aDocument,
                                Element*     aElement,
                                PRInt32      aNameSpaceID,