Bug 806192 - Fail instead of segfaulting when not passed nsIContent. r=bz a=lsblakk
authorBenjamin Peterson <benjamin@python.org>
Sat, 17 Nov 2012 21:17:35 -0500
changeset 114281 065e2b8abc1a075143e8fb1606b4a4d493e46058
parent 114280 2a9be71a13f47b8589f50c307dc9521555667dda
child 114282 3a977cce83599f816e9ec1796a0cbb71dfc4fbfb
push id2718
push userbenjamin@python.org
push dateSun, 18 Nov 2012 02:17:46 +0000
treeherdermozilla-aurora@065e2b8abc1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lsblakk
bugs806192
milestone18.0a2
Bug 806192 - Fail instead of segfaulting when not passed nsIContent. r=bz a=lsblakk
layout/inspector/src/inDOMUtils.cpp
layout/inspector/tests/Makefile.in
--- a/layout/inspector/src/inDOMUtils.cpp
+++ b/layout/inspector/src/inDOMUtils.cpp
@@ -238,17 +238,17 @@ inDOMUtils::GetBindingURLs(nsIDOMElement
 
   *_retval = nullptr;
 
   nsCOMPtr<nsIMutableArray> urls = do_CreateInstance(NS_ARRAY_CONTRACTID);
   if (!urls)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
-  NS_ASSERTION(content, "elements must implement nsIContent");
+  NS_ENSURE_ARG_POINTER(content);
 
   nsIDocument *ownerDoc = content->OwnerDoc();
   nsXBLBinding *binding = ownerDoc->BindingManager()->GetBinding(content);
 
   while (binding) {
     urls->AppendElement(binding->PrototypeBinding()->BindingURI(), false);
     binding = binding->GetBaseBinding();
   }
--- a/layout/inspector/tests/Makefile.in
+++ b/layout/inspector/tests/Makefile.in
@@ -14,12 +14,13 @@ include $(DEPTH)/config/autoconf.mk
 MOCHITEST_FILES =\
 		test_bug462787.html \
 		test_bug462789.html \
 		test_bug522601.xhtml \
 		test_bug536379.html \
 		test_bug536379-2.html \
 		test_bug557726.html \
 		test_bug609549.xhtml \
+		test_bug806192.html \
 		test_isinheritableproperty.html \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk