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

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

Issue 10913125: Remove lib/dom directory! (Closed) Base URL: http://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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
6 $!MEMBERS
7
8 int get offsetX() {
9 if (JS('bool', '!!this.offsetX')) {
10 return this._offsetX;
11 } else {
12 // Firefox does not support offsetX.
13 var target = this.target;
14 if (!(target is Element)) {
15 throw const UnsupportedOperationException(
16 'offsetX is only supported on elements');
17 }
18 return this.clientX - this.target.$dom_getBoundingClientRect().left;
19 }
20 }
21
22 int get offsetY() {
23 if (JS('bool', '!!this.offsetY')) {
24 return this._offsetY;
25 } else {
26 // Firefox does not support offsetY.
27 var target = this.target;
28 if (!(target is Element)) {
29 throw const UnsupportedOperationException(
30 'offsetX is only supported on elements');
31 }
32 return this.clientY - this.target.$dom_getBoundingClientRect().top;
33 }
34 }
35
36 int get _offsetX() native 'return this.offsetX';
37 int get _offsetY() native 'return this.offsetY';
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698