Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.idl

Issue 703783004: Use CanvasImageSource union type instead of overloading (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: don't append canvases to document.body Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.idl
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.idl b/Source/core/html/canvas/CanvasRenderingContext2D.idl
index 198cf3ade55877b017f060dcf61292783b4b5a86..1faf6e71c675fe86d4a80dee06562dea7ce6403d 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.idl
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.idl
@@ -26,14 +26,11 @@
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d
// FIXME: float => double throughout
-// FIXME: Use union type in drawImage and createPattern once supported:
-// http://crbug.com/372891
typedef (HTMLImageElement or
HTMLVideoElement or
- HTMLCanvasElement // or
+ HTMLCanvasElement or
// CanvasRenderingContext2D or
- // ImageBitmap
- ) CanvasImageSource;
+ ImageBitmap) CanvasImageSource;
enum CanvasFillRule { "nonzero", "evenodd" };
@@ -71,9 +68,7 @@ enum CanvasFillRule { "nonzero", "evenodd" };
[Custom] attribute object fillStyle; // (default black)
CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
[RaisesException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
- [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, DOMString? repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLImageElement image, DOMString? repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, DOMString? repetitionType);
+ [RaisesException] CanvasPattern createPattern(CanvasImageSource image, DOMString? repetitionType);
// shadows
attribute unrestricted float shadowOffsetX;
@@ -110,18 +105,9 @@ enum CanvasFillRule { "nonzero", "evenodd" };
TextMetrics measureText(DOMString text);
// drawing images
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y);
- [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+ [RaisesException] void drawImage(CanvasImageSource image, unrestricted float x, unrestricted float y);
+ [RaisesException] void drawImage(CanvasImageSource image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+ [RaisesException] void drawImage(CanvasImageSource image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
// hit regions
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegion(optional HitRegionOptions options);
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698