Remove unnecessary null check in HTMLCanvasElement.cpp.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 04:40:12 +0000 (04:40 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 04:40:12 +0000 (04:40 +0000)
Rubber-stamped by Benjamin Poulain.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):

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

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

index f8975393733ec3add1ef6271454b8353328344ba..00a1eee12c313e9e4ebca7bb08f73faf09064686 100644 (file)
@@ -1,3 +1,12 @@
+2013-06-05  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Remove unnecessary null check in HTMLCanvasElement.cpp.
+
+        Rubber-stamped by Benjamin Poulain.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext):
+
 2013-06-05  Peter Gal  <galpeter@inf.u-szeged.hu>
 
         [curl] Add implementation for HTTP PUT method.
index 6e8ba7a1c6bbd50ccc3b84415c29cde5aa7337d5..1a93bd4289132a9d8e525aa1f5532a05e26c624b 100644 (file)
@@ -193,10 +193,8 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
 #endif
             m_context = CanvasRenderingContext2D::create(this, document()->inQuirksMode(), usesDashbardCompatibilityMode);
 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || (ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING))
-            if (m_context) {
-                // Need to make sure a RenderLayer and compositing layer get created for the Canvas
-                setNeedsStyleRecalc(SyntheticStyleChange);
-            }
+            // Need to make sure a RenderLayer and compositing layer get created for the Canvas
+            setNeedsStyleRecalc(SyntheticStyleChange);
 #endif
         }
         return m_context.get();
@@ -211,10 +209,8 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
                 return 0;
             if (!m_context) {
                 m_context = WebGLRenderingContext::create(this, static_cast<WebGLContextAttributes*>(attrs));
-                if (m_context) {
-                    // Need to make sure a RenderLayer and compositing layer get created for the Canvas
-                    setNeedsStyleRecalc(SyntheticStyleChange);
-                }
+                // Need to make sure a RenderLayer and compositing layer get created for the Canvas
+                setNeedsStyleRecalc(SyntheticStyleChange);
             }
             return m_context.get();
         }