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

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

Issue 35623004: Reapply lineDash with polyfill. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « tools/dom/scripts/systemhtml.py ('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_CanvasRenderingContext2D.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
index 103038464be745acfac9f9401d789eddaaaf07ad..08146ec24bd85da23e4572e03dadc303180ecc32 100644
--- a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
@@ -253,11 +253,23 @@ $else
$endif
$if DART2JS
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @SupportedBrowser(SupportedBrowser.IE, '11')
+ @Unstable()
@DomName('CanvasRenderingContext2D.lineDashOffset')
+ // TODO(14316): Firefox has this functionality with mozDashOffset, but it
+ // needs to be polyfilled.
num get lineDashOffset => JS('num',
'#.lineDashOffset || #.webkitLineDashOffset', this, this);
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @SupportedBrowser(SupportedBrowser.IE, '11')
+ @Unstable()
@DomName('CanvasRenderingContext2D.lineDashOffset')
+ // TODO(14316): Firefox has this functionality with mozDashOffset, but it
+ // needs to be polyfilled.
void set lineDashOffset(num value) => JS('void',
'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
'#.webkitLineDashOffset = #', this, this, value, this, value);
@@ -265,6 +277,47 @@ $else
// TODO(amouravski): Add Dartium native methods for drawImage once we figure
// out how to not break native bindings.
$endif
+
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @SupportedBrowser(SupportedBrowser.IE, '11')
+ @Unstable()
+ @DomName('CanvasRenderingContext2D.getLineDash')
+ List<num> getLineDash() {
+ // TODO(14316): Firefox has this functionality with mozDash, but it's a bit
+ // different.
+$if DART2JS
+ if (JS('bool', '!!#.getLineDash', this)) {
+ return JS('List<num>', '#.getLineDash()', this);
+ } else if (JS('bool', '!!#.webkitLineDash', this)) {
+ return JS('List<num>', '#.webkitLineDash', this);
+ }
+$else
+ var result = _getLineDash();
+ if (result == null) {
+ result = [];
+ }
+ return result;
+$endif
+ }
+
+$if DART2JS
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @SupportedBrowser(SupportedBrowser.IE, '11')
+ @Unstable()
+ @DomName('CanvasRenderingContext2D.setLineDash')
+ void setLineDash(List<num> dash) {
+ // TODO(14316): Firefox has this functionality with mozDash, but it's a bit
+ // different.
+ if (JS('bool', '!!#.setLineDash', this)) {
+ JS('void', '#.setLineDash(#)', this, dash);
+ } else if (JS('bool', '!!#.webkitLineDash', this)) {
+ JS('void', '#.webkitLineDash = #', this, dash);
+ }
+ }
+$endif
+
$if DART2JS
/**
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698