Bug 801440 - 'ASSERTION: Mutation event dispatched in native anonymous content', r=bz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 19 Oct 2012 03:22:35 +0300
changeset 110792 c4f3ea8eec81c9ec98acf2e3c13654c73cbda437
parent 110791 cf1bbed46731a5e9992805b931772be3ef3e31d6
child 110793 98597b6316d16c7c9d6160da89e435b51d166351
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbz
bugs801440
milestone19.0a1
Bug 801440 - 'ASSERTION: Mutation event dispatched in native anonymous content', r=bz
content/base/src/FragmentOrElement.cpp
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -883,21 +883,25 @@ nsIContent::PreHandleEvent(nsEventChainP
       }
     }
   }
 
   nsIContent* parent = GetParent();
   // Event may need to be retargeted if this is the root of a native
   // anonymous content subtree or event is dispatched somewhere inside XBL.
   if (isAnonForEvents) {
+#ifdef DEBUG
     // If a DOM event is explicitly dispatched using node.dispatchEvent(), then
     // all the events are allowed even in the native anonymous content..
-    NS_ASSERTION(aVisitor.mEvent->eventStructType != NS_MUTATION_EVENT ||
+    nsCOMPtr<nsIContent> t = do_QueryInterface(aVisitor.mEvent->originalTarget);
+    NS_ASSERTION(!t || !t->ChromeOnlyAccess() ||
+                 aVisitor.mEvent->eventStructType != NS_MUTATION_EVENT ||
                  aVisitor.mDOMEvent,
                  "Mutation event dispatched in native anonymous content!?!");
+#endif
     aVisitor.mEventTargetAtParent = parent;
   } else if (parent && aVisitor.mOriginalTargetIsInAnon) {
     nsCOMPtr<nsIContent> content(do_QueryInterface(aVisitor.mEvent->target));
     if (content && content->GetBindingParent() == parent) {
       aVisitor.mEventTargetAtParent = parent;
     }
   }