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

Side by Side Diff: tools/dom/src/dartium_KeyEvent.dart

Issue 1754523006: Beginning fix for KeyEvent,KeyboardEvent and UIEvent changes in roll 45 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 4 years, 9 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
OLDNEW
1 /** 1 /**
2 * A custom KeyboardEvent that attempts to eliminate cross-browser 2 * A custom KeyboardEvent that attempts to eliminate cross-browser
3 * inconsistencies, and also provide both keyCode and charCode information 3 * inconsistencies, and also provide both keyCode and charCode information
4 * for all key events (when such information can be determined). 4 * for all key events (when such information can be determined).
5 * 5 *
6 * KeyEvent tries to provide a higher level, more polished keyboard event 6 * KeyEvent tries to provide a higher level, more polished keyboard event
7 * information on top of the "raw" [KeyboardEvent]. 7 * information on top of the "raw" [KeyboardEvent].
8 * 8 *
9 * The mechanics of using KeyEvents is a little different from the underlying 9 * The mechanics of using KeyEvents is a little different from the underlying
10 * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add 10 * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add
(...skipping 25 matching lines...) Expand all
36 */ 36 */
37 @Deprecated("Internal Use Only") 37 @Deprecated("Internal Use Only")
38 js.JsObject blink_jsObject; 38 js.JsObject blink_jsObject;
39 39
40 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ 40 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
41 KeyboardEvent _parent; 41 KeyboardEvent _parent;
42 42
43 /** The "fixed" value of whether the alt key is being pressed. */ 43 /** The "fixed" value of whether the alt key is being pressed. */
44 bool _shadowAltKey; 44 bool _shadowAltKey;
45 45
46 /** Caculated value of what the estimated charCode is for this event. */ 46 /** Calculated value of what the estimated charCode is for this event. */
47 int _shadowCharCode; 47 int _shadowCharCode;
48 48
49 /** Caculated value of what the estimated keyCode is for this event. */ 49 /** Calculated value of what the estimated keyCode is for this event. */
50 int _shadowKeyCode; 50 int _shadowKeyCode;
51 51
52 /** Caculated value of what the estimated keyCode is for this event. */ 52 /** Calculated value of what the estimated keyCode is for this event. */
53 int get keyCode => _shadowKeyCode; 53 int get keyCode => _shadowKeyCode;
54 54
55 /** Caculated value of what the estimated charCode is for this event. */ 55 /** Calculated value of what the estimated charCode is for this event. */
56 int get charCode => this.type == 'keypress' ? _shadowCharCode : 0; 56 int get charCode => this.type == 'keypress' ? _shadowCharCode : 0;
57 57
58 /** Caculated value of whether the alt key is pressed is for this event. */ 58 /** Calculated value of whether the alt key is pressed is for this event. */
59 bool get altKey => _shadowAltKey; 59 bool get altKey => _shadowAltKey;
60 60
61 /** Caculated value of what the estimated keyCode is for this event. */ 61 /** Calculated value of what the estimated keyCode is for this event. */
62 int get which => keyCode; 62 int get which => keyCode;
63 63
64 /** Accessor to the underlying keyCode value is the parent event. */ 64 /** Accessor to the underlying keyCode value is the parent event. */
65 int get _realKeyCode => _parent.keyCode; 65 int get _realKeyCode => _parent.keyCode;
66 66
67 /** Accessor to the underlying charCode value is the parent event. */ 67 /** Accessor to the underlying charCode value is the parent event. */
68 int get _realCharCode => _parent.charCode; 68 int get _realCharCode => _parent.charCode;
69 69
70 /** Accessor to the underlying altKey value is the parent event. */ 70 /** Accessor to the underlying altKey value is the parent event. */
71 bool get _realAltKey => _parent.altKey; 71 bool get _realAltKey => _parent.altKey;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 bool get shiftKey => _parent.shiftKey; 132 bool get shiftKey => _parent.shiftKey;
133 Window get view => _parent.view; 133 Window get view => _parent.view;
134 void _initUIEvent(String type, bool canBubble, bool cancelable, 134 void _initUIEvent(String type, bool canBubble, bool cancelable,
135 Window view, int detail) { 135 Window view, int detail) {
136 throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent."); 136 throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent.");
137 } 137 }
138 String get _shadowKeyIdentifier => _parent._keyIdentifier; 138 String get _shadowKeyIdentifier => _parent._keyIdentifier;
139 139
140 int get _charCode => charCode; 140 int get _charCode => charCode;
141 int get _keyCode => keyCode; 141 int get _keyCode => keyCode;
142 int get _which => which;
142 String get _keyIdentifier { 143 String get _keyIdentifier {
143 throw new UnsupportedError("keyIdentifier is unsupported."); 144 throw new UnsupportedError("keyIdentifier is unsupported.");
144 } 145 }
145 void _initKeyboardEvent(String type, bool canBubble, bool cancelable, 146 void _initKeyboardEvent(String type, bool canBubble, bool cancelable,
146 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, 147 Window view, String keyIdentifier, int keyLocation, bool ctrlKey,
147 bool altKey, bool shiftKey, bool metaKey) { 148 bool altKey, bool shiftKey, bool metaKey) {
148 throw new UnsupportedError( 149 throw new UnsupportedError(
149 "Cannot initialize a KeyboardEvent from a KeyEvent."); 150 "Cannot initialize a KeyboardEvent from a KeyEvent.");
150 } 151 }
151 int get _layerX => throw new UnsupportedError('Not applicable to KeyEvent');
152 int get _layerY => throw new UnsupportedError('Not applicable to KeyEvent');
153 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent');
154 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent');
155 @Experimental() // untriaged 152 @Experimental() // untriaged
156 bool getModifierState(String keyArgument) => throw new UnimplementedError(); 153 bool getModifierState(String keyArgument) => throw new UnimplementedError();
157 @Experimental() // untriaged 154 @Experimental() // untriaged
158 int get location => throw new UnimplementedError(); 155 int get location => throw new UnimplementedError();
159 @Experimental() // untriaged 156 @Experimental() // untriaged
160 bool get repeat => throw new UnimplementedError(); 157 bool get repeat => throw new UnimplementedError();
161 dynamic get _get_view => throw new UnimplementedError(); 158 dynamic get _get_view => throw new UnimplementedError();
162 } 159 }
OLDNEW
« no previous file with comments | « tools/dom/src/dart2js_KeyEvent.dart ('k') | tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698