OLD | NEW |
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 @DocsEditable() | 7 @DocsEditable() |
8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ | 8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ |
9 $!MEMBERS | 9 $!MEMBERS |
10 | 10 |
| 11 // As of Chrome 37, these all changed from long to double. This code |
| 12 // preserves backwards compatability for the time being. |
| 13 $if DART2JS |
| 14 int get __clientX => JS('num', '#.clientX', this).round(); |
| 15 int get __clientY => JS('num', '#.clientY', this).round(); |
| 16 int get __screenX => JS('num', '#.screenX', this).round(); |
| 17 int get __screenY => JS('num', '#.screenY', this).round(); |
| 18 int get __pageX => JS('num', '#.pageX', this).round(); |
| 19 int get __pageY => JS('num', '#.pageY', this).round(); |
| 20 int get __webkitRadiusX => JS('num', '#.webkitRadiusX', this).round(); |
| 21 int get __webkitRadiusY => JS('num', '#.webkitRadiusY', this).round(); |
| 22 $else |
| 23 int get __clientX => _blink.BlinkTouch.$clientX_Getter(this).round(); |
| 24 int get __clientY => _blink.BlinkTouch.$clientY_Getter(this).round(); |
| 25 int get __screenX => _blink.BlinkTouch.$screenX_Getter(this).round(); |
| 26 int get __screenY => _blink.BlinkTouch.$screenY_Getter(this).round(); |
| 27 int get __pageX => _blink.BlinkTouch.$pageX_Getter(this).round(); |
| 28 int get __pageY => _blink.BlinkTouch.$pageY_Getter(this).round(); |
| 29 int get __webkitRadiusX => _blink.BlinkTouch.$webkitRadiusX_Getter(this).round
(); |
| 30 int get __webkitRadiusY => _blink.BlinkTouch.$webkitRadiusY_Getter(this).round
(); |
| 31 $endif |
| 32 |
11 @DomName('Touch.clientX') | 33 @DomName('Touch.clientX') |
12 @DomName('Touch.clientY') | 34 @DomName('Touch.clientY') |
13 Point get client => new Point(_clientX, _clientY); | 35 Point get client => new Point(__clientX, __clientY); |
14 | 36 |
15 @DomName('Touch.pageX') | 37 @DomName('Touch.pageX') |
16 @DomName('Touch.pageY') | 38 @DomName('Touch.pageY') |
17 Point get page => new Point(_pageX, _pageY); | 39 Point get page => new Point(__pageX, __pageY); |
18 | 40 |
19 @DomName('Touch.screenX') | 41 @DomName('Touch.screenX') |
20 @DomName('Touch.screenY') | 42 @DomName('Touch.screenY') |
21 Point get screen => new Point(_screenX, _screenY); | 43 Point get screen => new Point(__screenX, __screenY); |
| 44 |
| 45 @DomName('Touch.webkitRadiusX') |
| 46 @DocsEditable() |
| 47 @SupportedBrowser(SupportedBrowser.CHROME) |
| 48 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 49 @Experimental() |
| 50 int get radiusX => __webkitRadiusX; |
| 51 |
| 52 @DomName('Touch.webkitRadiusY') |
| 53 @DocsEditable() |
| 54 @SupportedBrowser(SupportedBrowser.CHROME) |
| 55 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 56 @Experimental() |
| 57 int get radiusY => __webkitRadiusY; |
| 58 |
22 } | 59 } |
OLD | NEW |