Bug 784869. Stop allowing undefined as the second argument to createPattern in the WebIDL 2d context bindings. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 28 Aug 2012 13:10:10 -0400
changeset 105715 ca53a84f1a9439b66a8c631e389ca1f4684e7035
parent 105714 9dbfbeaf89e385974a54a4bba7101a6b01419725
child 105716 539643ca53ec94b6d520c5ee5bc9ccfa63dbec7b
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerspeterv
bugs784869
milestone18.0a1
Bug 784869. Stop allowing undefined as the second argument to createPattern in the WebIDL 2d context bindings. r=peterv
content/canvas/test/test_canvas.html
dom/webidl/CanvasRenderingContext2D.webidl
--- a/content/canvas/test/test_canvas.html
+++ b/content/canvas/test/test_canvas.html
@@ -16120,22 +16120,19 @@ var _thrown = undefined; try {
 <canvas id="c496" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
 function test_2d_pattern_repeat_undefined() {
 
 var canvas = document.getElementById('c496');
 var ctx = canvas.getContext('2d');
 
-var undefinedHandler = IsAzureEnabled() ? todo : ok;
-
 var _thrown = undefined; try {
   ctx.createPattern(canvas, undefined);
-  // XXXbz TODO fix bug 784869
-} catch (e) { _thrown = e }; undefinedHandler(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError");
+} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError");
 
 
 }
 </script>
 
 <!-- [[[ test_2d.pattern.repeat.unrecognised.html ]]] -->
 
 <p>Canvas test: 2d.pattern.repeat.unrecognised</p>
--- a/dom/webidl/CanvasRenderingContext2D.webidl
+++ b/dom/webidl/CanvasRenderingContext2D.webidl
@@ -50,17 +50,17 @@ interface CanvasRenderingContext2D {
 
   // colors and styles (see also the CanvasDrawingStyles interface)
            [SetterInfallible]
            attribute any strokeStyle; // (default black)
            [SetterInfallible]
            attribute any fillStyle; // (default black)
   CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
   CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
-  CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, DOMString? repetition);
+  CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition);
 
   // shadows
            [Infallible]
            attribute double shadowOffsetX; // (default 0)
            [Infallible]
            attribute double shadowOffsetY; // (default 0)
            [Infallible]
            attribute double shadowBlur; // (default 0)