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

Side by Side Diff: lib/dom/templates/html/dart2js/impl_MouseEvent.darttemplate

Issue 10916177: Revert "Partially migrate from old getter syntax to new one." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 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 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
6 $!MEMBERS 6 $!MEMBERS
7 7
8 int get offsetX { 8 int get offsetX() {
9 if (JS('bool', '!!this.offsetX')) { 9 if (JS('bool', '!!this.offsetX')) {
10 return this._offsetX; 10 return this._offsetX;
11 } else { 11 } else {
12 // Firefox does not support offsetX. 12 // Firefox does not support offsetX.
13 var target = this.target; 13 var target = this.target;
14 if (!(target is Element)) { 14 if (!(target is Element)) {
15 throw const UnsupportedOperationException( 15 throw const UnsupportedOperationException(
16 'offsetX is only supported on elements'); 16 'offsetX is only supported on elements');
17 } 17 }
18 return this.clientX - this.target.$dom_getBoundingClientRect().left; 18 return this.clientX - this.target.$dom_getBoundingClientRect().left;
19 } 19 }
20 } 20 }
21 21
22 int get offsetY { 22 int get offsetY() {
23 if (JS('bool', '!!this.offsetY')) { 23 if (JS('bool', '!!this.offsetY')) {
24 return this._offsetY; 24 return this._offsetY;
25 } else { 25 } else {
26 // Firefox does not support offsetY. 26 // Firefox does not support offsetY.
27 var target = this.target; 27 var target = this.target;
28 if (!(target is Element)) { 28 if (!(target is Element)) {
29 throw const UnsupportedOperationException( 29 throw const UnsupportedOperationException(
30 'offsetX is only supported on elements'); 30 'offsetX is only supported on elements');
31 } 31 }
32 return this.clientY - this.target.$dom_getBoundingClientRect().top; 32 return this.clientY - this.target.$dom_getBoundingClientRect().top;
33 } 33 }
34 } 34 }
35 35
36 int get _offsetX native 'return this.offsetX'; 36 int get _offsetX() native 'return this.offsetX';
37 int get _offsetY native 'return this.offsetY'; 37 int get _offsetY() native 'return this.offsetY';
38 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698