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

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

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ADded test expectations. Created 8 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 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', '!!#.offsetX', this)) { 9 if (JS('bool', '!!#.offsetX', this)) {
10 return JS('int', '#.offsetX', this); 10 return JS('int', '#.offsetX', this);
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 new UnsupportedError(
16 'offsetX is only supported on elements'); 16 'offsetX is only supported on elements');
17 } 17 }
18 return this.clientX - this.target.getBoundingClientRect().left; 18 return this.clientX - this.target.getBoundingClientRect().left;
19 } 19 }
20 } 20 }
21 21
22 int get offsetY { 22 int get offsetY {
23 if (JS('bool', '!!#.offsetY', this)) { 23 if (JS('bool', '!!#.offsetY', this)) {
24 return JS('int', '#.offsetY', this); 24 return JS('int', '#.offsetY', this);
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 new UnsupportedError(
30 'offsetY is only supported on elements'); 30 'offsetY is only supported on elements');
31 } 31 }
32 return this.clientY - this.target.getBoundingClientRect().top; 32 return this.clientY - this.target.getBoundingClientRect().top;
33 } 33 }
34 } 34 }
35 } 35 }
OLDNEW
« no previous file with comments | « lib/html/src/native_DOMImplementation.dart ('k') | lib/html/templates/html/impl/impl_DocumentFragment.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698