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

Side by Side Diff: tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate

Issue 27983005: Make getLineDash return [] instead of null if it has not yet been set. (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:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 $!MEMBERS 8 $!MEMBERS
9 9
10 /** 10 /**
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 $if DART2JS 255 $if DART2JS
256 @DomName('CanvasRenderingContext2D.lineDashOffset') 256 @DomName('CanvasRenderingContext2D.lineDashOffset')
257 num get lineDashOffset => JS('num', 257 num get lineDashOffset => JS('num',
258 '#.lineDashOffset || #.webkitLineDashOffset', this, this); 258 '#.lineDashOffset || #.webkitLineDashOffset', this, this);
259 259
260 @DomName('CanvasRenderingContext2D.lineDashOffset') 260 @DomName('CanvasRenderingContext2D.lineDashOffset')
261 void set lineDashOffset(num value) => JS('void', 261 void set lineDashOffset(num value) => JS('void',
262 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : ' 262 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
263 '#.webkitLineDashOffset = #', this, this, value, this, value); 263 '#.webkitLineDashOffset = #', this, this, value, this, value);
264
265 @DomName('CanvasRenderingContext2D.getLineDash')
266 List<num> getLineDash() => _getLineDash();
264 $else 267 $else
268 @DomName('CanvasRenderingContext2D.getLineDash')
269 List<num> getLineDash() {
270 var result = _getLineDash();
271 if (result == null) {
272 result = [];
273 setLineDash(result);
blois 2013/10/22 00:50:40 why set?
274 }
275 return result;
276 }
265 // TODO(amouravski): Add Dartium native methods for drawImage once we figure 277 // TODO(amouravski): Add Dartium native methods for drawImage once we figure
266 // out how to not break native bindings. 278 // out how to not break native bindings.
267 $endif 279 $endif
268 $if DART2JS 280 $if DART2JS
269 281
270 /** 282 /**
271 * Draws text to the canvas. 283 * Draws text to the canvas.
272 * 284 *
273 * The text is drawn starting at coordinates ([x], [y]). 285 * The text is drawn starting at coordinates ([x], [y]).
274 * If [maxWidth] is provided and the [text] is computed to be wider than 286 * If [maxWidth] is provided and the [text] is computed to be wider than
(...skipping 10 matching lines...) Expand all
285 void fillText(String text, num x, num y, [num maxWidth]) { 297 void fillText(String text, num x, num y, [num maxWidth]) {
286 if (maxWidth != null) { 298 if (maxWidth != null) {
287 JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth); 299 JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth);
288 } else { 300 } else {
289 JS('void', '#.fillText(#, #, #)', this, text, x, y); 301 JS('void', '#.fillText(#, #, #)', this, text, x, y);
290 } 302 }
291 } 303 }
292 $endif 304 $endif
293 } 305 }
294 306
OLDNEW
« tests/html/canvasrenderingcontext2d_test.dart ('K') | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698