Backed out changeset 6c2f46733945 (bug 1003380) for frequent Android mochitest-2 failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 30 Apr 2014 14:08:44 -0400
changeset 181450 34887cdb561622ec80c4d80e249a87224be9b553
parent 181449 a6864d25a859d0918bd52e12f409d8247edd9d35
child 181451 44e189f0fd67e5eb4d184c5bba0a85018dc0bd3a
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs1003380
milestone32.0a1
backs out6c2f467339452af119e07f2024e15e74092aa1a8
Backed out changeset 6c2f46733945 (bug 1003380) for frequent Android mochitest-2 failures. CLOSED TREE
content/canvas/src/CanvasRenderingContext2D.cpp
content/canvas/test/mochitest.ini
content/canvas/test/test_canvas.html
content/canvas/test/test_createPattern_broken.html
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -1485,23 +1485,17 @@ CanvasRenderingContext2D::CreatePattern(
       RefPtr<SourceSurface> srcSurf = srcCanvas->GetSurfaceSnapshot();
 
       nsRefPtr<CanvasPattern> pat =
         new CanvasPattern(this, srcSurf, repeatMode, htmlElement->NodePrincipal(), canvas->IsWriteOnly(), false);
 
       return pat.forget();
     }
   } else if (element.IsHTMLImageElement()) {
-    HTMLImageElement* img = &element.GetAsHTMLImageElement();
-    if (img->IntrinsicState().HasState(NS_EVENT_STATE_BROKEN)) {
-      error.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-      return nullptr;
-    }
-
-    htmlElement = img;
+    htmlElement = &element.GetAsHTMLImageElement();
   } else {
     htmlElement = &element.GetAsHTMLVideoElement();
   }
 
   EnsureTarget();
 
   // The canvas spec says that createPattern should use the first frame
   // of animated images
--- a/content/canvas/test/mochitest.ini
+++ b/content/canvas/test/mochitest.ini
@@ -208,9 +208,8 @@ skip-if = (buildapp == 'b2g' && toolkit 
 [test_mozGetAsFile.html]
 [test_strokeText_throw.html]
 [test_toBlob.html]
 [test_toDataURL_alpha.html]
 [test_toDataURL_lowercase_ascii.html]
 [test_toDataURL_parameters.html]
 [test_windingRuleUndefined.html]
 [test_2d.fillText.gradient.html]
-[test_createPattern_broken.html]
--- a/content/canvas/test/test_canvas.html
+++ b/content/canvas/test/test_canvas.html
@@ -15103,17 +15103,17 @@ function test_2d_pattern_image_incomplet
 
 var canvas = document.getElementById('c466');
 var ctx = canvas.getContext('2d');
 
 var img = new Image();
 todo(img.complete === false, "img.complete === false");
 var _thrown = undefined; try {
   ctx.createPattern(img, 'repeat');
-} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
+} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
 
 
 }
 </script>
 
 <!-- [[[ test_2d.pattern.image.null.html ]]] -->
 
 <p>Canvas test: 2d.pattern.image.null</p>
deleted file mode 100644
--- a/content/canvas/test/test_createPattern_broken.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test for createPattern with a broken image</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
-  <script type="application/javascript" src="file_drawWindow_common.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-
-  SimpleTest.waitForExplicitFinish();
-  window.addEventListener("load", function(){
-    var _thrown = undefined;
-
-    try{
-      var img = document.getElementById('broken.png');
-      var ctx = document.getElementById('c').getContext('2d');
-      var p = ctx.createPattern(img, 'repeat');
-    } catch (e) {
-      _thrown = e
-    };
-
-    ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
-
-    SimpleTest.finish();
-    });
-
-  </script>
-</head>
-<body>
-<canvas id="c" class="output" width="100" height="50"></canvas>
-<img src="/images/broken.png" id="broken.png" class="resource"/>
-</body>
-</html>