Bug 1173363 - Don't go through nsIDOMDocument in nsContentUtils::FlushLayoutForTree; r=khuey
authorMs2ger <ms2ger@gmail.com>
Sat, 20 Jun 2015 09:16:50 +0200
changeset 280645 44c7eaa948662964b32346e199c6ee648b8d16b7
parent 280644 d411a0c7047b8da90999e0dd80ec79f4312729ac
child 280646 18647c79fc2fd5470a2b369eef06e652e89ed204
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1173363
milestone41.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 1173363 - Don't go through nsIDOMDocument in nsContentUtils::FlushLayoutForTree; r=khuey
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -6308,20 +6308,17 @@ nsContentUtils::FlushLayoutForTree(nsIDO
     nsCOMPtr<nsPIDOMWindow> piWin = do_QueryInterface(aWindow);
     if (!piWin)
         return;
 
     // Note that because FlushPendingNotifications flushes parents, this
     // is O(N^2) in docshell tree depth.  However, the docshell tree is
     // usually pretty shallow.
 
-    nsCOMPtr<nsIDOMDocument> domDoc;
-    aWindow->GetDocument(getter_AddRefs(domDoc));
-    nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
-    if (doc) {
+    if (nsCOMPtr<nsIDocument> doc = piWin->GetDoc()) {
         doc->FlushPendingNotifications(Flush_Layout);
     }
 
     nsCOMPtr<nsIDocShell> docShell = piWin->GetDocShell();
     if (docShell) {
         int32_t i = 0, i_end;
         docShell->GetChildCount(&i_end);
         for (; i < i_end; ++i) {