Bustage fix (bug 804991 - Make FromContent expect a non-null pointer and add FromContentOrNull)
authorPeter Van der Beken <peterv@propagandism.org>
Fri, 09 Nov 2012 22:10:06 +0100
changeset 112876 0e0750c14c491abac564321317e4f268e76c573e
parent 112875 191155ed17b0989a8210ed4c07c163a6e851770b
child 112877 b80ac0b99a8f3296ee9fb1fc035a1c3411dd259d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs804991
milestone19.0a1
Bustage fix (bug 804991 - Make FromContent expect a non-null pointer and add FromContentOrNull)
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4506,23 +4506,25 @@ nsLayoutUtils::SurfaceFromElement(nsHTML
   return result;
 }
 
 nsLayoutUtils::SurfaceFromElementResult
 nsLayoutUtils::SurfaceFromElement(dom::Element* aElement,
                                   uint32_t aSurfaceFlags)
 {
   // If it's a <canvas>, we may be able to just grab its internal surface
-  if (nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(aElement)) {
+  if (nsHTMLCanvasElement* canvas =
+        nsHTMLCanvasElement::FromContentOrNull(aElement)) {
     return SurfaceFromElement(canvas, aSurfaceFlags);
   }
 
 #ifdef MOZ_MEDIA
   // Maybe it's <video>?
-  if (nsHTMLVideoElement* video = nsHTMLVideoElement::FromContent(aElement)) {
+  if (nsHTMLVideoElement* video =
+        nsHTMLVideoElement::FromContentOrNull(aElement)) {
     return SurfaceFromElement(video, aSurfaceFlags);
   }
 #endif
 
   // Finally, check if it's a normal image
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aElement);
 
   if (!imageLoader) {