Bug 458440 - Attempt to work around speculative parsing crash. r+sr=dbaron
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 11 Nov 2008 13:38:54 -0800
changeset 21571 9ac7c363cf78
parent 21570 37b3fdbb0f07
child 21572 1c473d3f87ea
child 21668 5b4fccb79b7e
push id3588
push usermrbkap@mozilla.com
push dateTue, 11 Nov 2008 21:40:00 +0000
treeherdermozilla-central@9ac7c363cf78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs458440
milestone1.9.1b2pre
Bug 458440 - Attempt to work around speculative parsing crash. r+sr=dbaron
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2228,17 +2228,20 @@ nsCSSFrameConstructor::CreateInputFrame(
                                         PRBool                   aHasPseudoParent)
 {
   // Make sure to keep IsSpecialContent in synch with this code
   
   // Note: do not do anything in this method that assumes pseudo-frames have
   // been processed.  If you feel the urge to do something like that, fix
   // callers accordingly.
   nsCOMPtr<nsIFormControl> control = do_QueryInterface(aContent);
-  NS_ASSERTION(control, "input is not an nsIFormControl!");
+  if (!control) {
+    NS_ERROR("input doesn't implement nsIFormControl?");
+    return NS_OK;
+  }
 
   switch (control->GetType()) {
     case NS_FORM_INPUT_SUBMIT:
     case NS_FORM_INPUT_RESET:
     case NS_FORM_INPUT_BUTTON:
     {
       if (gUseXBLForms)
         return NS_OK; // update IsSpecialContent if this becomes functional