Index: sdk/lib/html/dart2js/html_dart2js.dart |
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart |
index efe10ef2b15256d2be4fab6ac599ad46c005dfe8..2a525136f049e5697bf5105e4fd405cce3036139 100644 |
--- a/sdk/lib/html/dart2js/html_dart2js.dart |
+++ b/sdk/lib/html/dart2js/html_dart2js.dart |
@@ -10551,7 +10551,40 @@ class HtmlDocument extends Document native "*HTMLDocument" { |
return document.$dom_elementFromPoint(x, y); |
} |
- /** @domName Document.getCSSCanvasContext */ |
+ /** |
+ * Checks if the getCssCanvasContext API is supported on the current platform. |
+ * |
+ * See also: |
+ * |
+ * * [getCssCanvasContext] |
+ */ |
+ static bool get supportsCssCanvasContext => |
+ JS('bool', '!!(document.getCSSCanvasContext)'); |
+ |
+ |
+ /** |
+ * Gets a CanvasRenderingContext which can be used as the CSS background of an |
+ * element. |
+ * |
+ * CSS: |
+ * |
+ * background: -webkit-canvas(backgroundCanvas) |
+ * |
+ * Generate the canvas: |
+ * |
+ * var context = document.getCssCanvasContext('2d', 'backgroundCanvas', |
+ * 100, 100); |
+ * context.fillStyle = 'red'; |
+ * context.fillRect(0, 0, 100, 100); |
+ * |
+ * See also: |
+ * |
+ * * [supportsCssCanvasContext] |
+ * * [CanvasElement.getContext] |
+ */ |
+ @SupportedBrowser(SupportedBrowser.CHROME) |
+ @SupportedBrowser(SupportedBrowser.SAFARI) |
+ @Experimental() |
CanvasRenderingContext getCssCanvasContext(String contextId, String name, |
int width, int height) { |
return document.$dom_getCssCanvasContext(contextId, name, width, height); |