Revert the second half of r151257. WebGLRenderingContext::create can return null.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 04:42:47 +0000 (04:42 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 04:42:47 +0000 (04:42 +0000)
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCanvasElement.cpp

index 00a1eee..b40a32b 100644 (file)
@@ -1,5 +1,12 @@
 2013-06-05  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Revert the second half of r151257. WebGLRenderingContext::create can return null.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext):
+
+2013-06-05  Ryosuke Niwa  <rniwa@webkit.org>
+
         Remove unnecessary null check in HTMLCanvasElement.cpp.
 
         Rubber-stamped by Benjamin Poulain.
index 1a93bd4..e1a62dc 100644 (file)
@@ -209,8 +209,10 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
                 return 0;
             if (!m_context) {
                 m_context = WebGLRenderingContext::create(this, static_cast<WebGLContextAttributes*>(attrs));
-                // Need to make sure a RenderLayer and compositing layer get created for the Canvas
-                setNeedsStyleRecalc(SyntheticStyleChange);
+                if (m_context) {
+                    // Need to make sure a RenderLayer and compositing layer get created for the Canvas
+                    setNeedsStyleRecalc(SyntheticStyleChange);
+                }
             }
             return m_context.get();
         }