Index: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate |
index e95cc72415f571e491fdd1bc7cdcce88a10333b2..caaaedb61d59cf8da8bb07bdc4db0cc69fc31a3a 100644 |
--- a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate |
@@ -27,7 +27,44 @@ $!MEMBERS |
return document.$dom_elementFromPoint(x, y); |
} |
- /** @domName Document.getCSSCanvasContext */ |
+ /** |
+ * Checks if the getCssCanvasContext API is supported on the current platform. |
+ * |
+ * See also: |
+ * |
+ * * [getCssCanvasContext] |
+ */ |
+$if DART2JS |
+ static bool get supportsCssCanvasContext => |
+ JS('bool', '!!(document.getCSSCanvasContext)'); |
+$else |
+ static bool get supportsState => true; |
+$endif |
+ |
+ |
+ /** |
+ * 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); |