From f0721d083d25f727552f2c17e59e8ec7eaa8166e Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 23 Aug 2012 14:08:42 -0700 Subject: [PATCH] Back out b88ccf7bd3e3 for Linux test_canvas.html failures on a CLOSED TREE --- content/canvas/test/test_canvas.html | 17 ++++------------- .../canvas/nsIDOMCanvasRenderingContext2D.idl | 2 +- dom/webidl/CanvasRenderingContext2D.webidl | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/content/canvas/test/test_canvas.html b/content/canvas/test/test_canvas.html index 1a71c68d13ae..c5ad6c7cc46c 100644 --- a/content/canvas/test/test_canvas.html +++ b/content/canvas/test/test_canvas.html @@ -16078,17 +16078,9 @@ function test_2d_pattern_repeat_null() { var canvas = document.getElementById('c494'); var ctx = canvas.getContext('2d'); -ctx.fillStyle = '#f00'; -ctx.fillRect(0, 0, 100, 50); -var img = document.getElementById('green-1x1_2.png'); -var pattern = ctx.createPattern(img, null); -ctx.fillStyle = pattern; -ctx.fillRect(0, 0, 100, 50); - -isPixel(ctx, 1,1, 0,255,0,255, 0); -isPixel(ctx, 98,1, 0,255,0,255, 0); -isPixel(ctx, 1,48, 0,255,0,255, 0); -isPixel(ctx, 98,48, 0,255,0,255, 0); +var _thrown = undefined; try { + ctx.createPattern(canvas, null); +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); } @@ -16127,8 +16119,7 @@ var ctx = canvas.getContext('2d'); var _thrown = undefined; try { ctx.createPattern(canvas, undefined); - // XXXbz TODO fix bug 784869 -} catch (e) { _thrown = e }; todo(_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"); } diff --git a/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl b/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl index 3ac4475e5fd0..e739a90f2492 100644 --- a/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl +++ b/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl @@ -93,7 +93,7 @@ enum CanvasMultiGetterType { nsIDOMCanvasGradient createLinearGradient (in float x0, in float y0, in float x1, in float y1); nsIDOMCanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1); - nsIDOMCanvasPattern createPattern(in nsIDOMHTMLElement image, in DOMString repetition); + nsIDOMCanvasPattern createPattern(in nsIDOMHTMLElement image, [Null(Stringify)] in DOMString repetition); attribute float lineWidth; /* default 1 */ [binaryname(MozLineCap)] attribute DOMString lineCap; /* "butt", "round", "square" (default) */ diff --git a/dom/webidl/CanvasRenderingContext2D.webidl b/dom/webidl/CanvasRenderingContext2D.webidl index 721a5edb0dee..e09cbcba57cf 100644 --- a/dom/webidl/CanvasRenderingContext2D.webidl +++ b/dom/webidl/CanvasRenderingContext2D.webidl @@ -55,7 +55,7 @@ interface CanvasRenderingContext2D { 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, DOMString repetition); // shadows [Infallible]