Bug 612018 - "ASSERTION: frame must not be dirty" and non-blinking caret; r,a=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 16 Nov 2010 13:55:25 -0500
changeset 57591 b0d1532292908180f818be63dc1c4a8f9bd58d19
parent 57590 fdb62b0ef6993d2d85a2bf0a084b19a48d8e70c1
child 57593 c4a3a81c7f5f100829ef2543499fa8ae50b5fa7d
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersroc
bugs612018
milestone2.0b8pre
Bug 612018 - "ASSERTION: frame must not be dirty" and non-blinking caret; r,a=roc
dom/base/crashtests/612018-1.html
dom/base/crashtests/crashtests.list
dom/base/nsFocusManager.cpp
new file mode 100644
--- /dev/null
+++ b/dom/base/crashtests/612018-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script>
+
+function boom()
+{
+  var input = document.createElement("input");
+  document.body.appendChild(input);
+  input.focus();
+  document.body.appendChild(input);
+  input.focus();
+
+  document.documentElement.removeAttribute("class");
+}
+
+</script>
+</head>
+
+<body onload="setTimeout(boom, 0);"></body>
+</html>
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -19,8 +19,9 @@ load 462947.html
 load 439206-1.html
 load 473284.xul
 load 499006-1.html
 load 499006-2.html
 load 502617.html
 asserts(1) load 504224.html # bug 564098
 load 603531.html
 load 601247.html
+load 612018-1.html
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1353,17 +1353,17 @@ nsFocusManager::CheckIfFocusable(nsICont
 
   nsCOMPtr<nsIDocument> doc = aContent->GetCurrentDoc();
   // can't focus elements that are not in documents
   if (!doc)
     return nsnull;
 
   // Make sure that our frames are up to date
   if (doc)
-    doc->FlushPendingNotifications(Flush_Frames);
+    doc->FlushPendingNotifications(Flush_Layout);
 
   nsIPresShell *shell = doc->GetShell();
   if (!shell)
     return nsnull;
 
   // the root content can always be focused
   if (aContent == doc->GetRootElement())
     return aContent;