Bug 564652. Make sure to flush out restyles on our parent before checking for a presshell. r=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 13 Aug 2010 14:44:39 +1200
changeset 50364 3dd0ae2114288199f0292ecb3342601de68bd8fb
parent 50363 2ce3d3fdd6806e29c5b39b13d4e088bdbacdf5a7
child 50365 7d133a2a7d203c6b8d3b4d37cbee0abce2970272
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs564652
milestone2.0b4pre
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 564652. Make sure to flush out restyles on our parent before checking for a presshell. r=dbaron
content/html/document/src/nsHTMLDocument.cpp
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -3231,16 +3231,22 @@ nsHTMLDocument::EditingStateChanged()
     return NS_OK;
   }
 
   if (newState == eOff) {
     // Editing is being turned off.
     return TurnEditingOff();
   }
 
+  // Flush out style changes on our _parent_ document, if any, so that
+  // our check for a presshell won't get stale information.
+  if (mParentDocument) {
+    mParentDocument->FlushPendingNotifications(Flush_Style);
+  }
+
   // get editing session
   nsPIDOMWindow *window = GetWindow();
   if (!window)
     return NS_ERROR_FAILURE;
 
   nsIDocShell *docshell = window->GetDocShell();
   if (!docshell)
     return NS_ERROR_FAILURE;