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

Unified Diff: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate

Issue 11823035: Adding supported checks for getCssCanvasContext. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698