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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 35623004: Reapply lineDash with polyfill. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dec8d31cfa4a78be2888e0b4a785225a6a517ef3..baa088935bfb718de1f1f219e10d3d939b2520fd 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -1383,9 +1383,10 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
@Creates('ImageData|=Object')
_getImageData_1(sx, sy, sw, sh) native;
+ @JSName('getLineDash')
@DomName('CanvasRenderingContext2D.getLineDash')
@DocsEditable()
- List<num> getLineDash() native;
+ List<num> _getLineDash() native;
@DomName('CanvasRenderingContext2D.isPointInPath')
@DocsEditable()
@@ -1455,10 +1456,6 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
@DocsEditable()
void scale(num sx, num sy) native;
- @DomName('CanvasRenderingContext2D.setLineDash')
- @DocsEditable()
- void setLineDash(List<num> dash) native;
-
@DomName('CanvasRenderingContext2D.setTransform')
@DocsEditable()
void setTransform(num m11, num m12, num m21, num m22, num dx, num dy) native;
@@ -1738,15 +1735,58 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
num sourceX, num sourceY, num sourceWidth, num sourceHeight,
num destX, num destY, num destWidth, num destHeight) native;
+ @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);
+ @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 (JS('bool', '!!#.getLineDash', this)) {
+ return JS('List<num>', '#.getLineDash()', this);
+ } else if (JS('bool', '!!#.webkitLineDash', this)) {
+ return JS('List<num>', '#.webkitLineDash', this);
+ }
+ }
+
+ @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);
+ }
+ }
+
+
/**
* Draws text to the canvas.
*
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698