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

Side by Side Diff: lib/dom/templates/html/dartium/impl_EventTarget.darttemplate

Issue 10445011: Events operator [] shouldn't convert event name to lower case. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 _EventsImpl implements Events { 5 class _EventsImpl implements Events {
6 6
7 final _EventTargetImpl _ptr; 7 final _EventTargetImpl _ptr;
8 8
9 final Map<String, EventListenerList> _listenerMap; 9 final Map<String, EventListenerList> _listenerMap;
10 10
11 _EventsImpl(this._ptr) : _listenerMap = <EventListenerList>{}; 11 _EventsImpl(this._ptr) : _listenerMap = <EventListenerList>{};
12 12
13 EventListenerList operator [](String type) { 13 EventListenerList operator [](String type) {
14 return _get(type.toLowerCase());
15 }
16
17 EventListenerList _get(String type) {
18 return _listenerMap.putIfAbsent(type, 14 return _listenerMap.putIfAbsent(type,
19 () => new _EventListenerListImpl(_ptr, type)); 15 () => new _EventListenerListImpl(_ptr, type));
20 } 16 }
21 } 17 }
22 18
23 class _EventListenerWrapper { 19 class _EventListenerWrapper {
24 final EventListener raw; 20 final EventListener raw;
25 final Function wrapped; 21 final Function wrapped;
26 final bool useCapture; 22 final bool useCapture;
27 _EventListenerWrapper(this.raw, this.wrapped, this.useCapture); 23 _EventListenerWrapper(this.raw, this.wrapped, this.useCapture);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 102
107 Events _on; 103 Events _on;
108 104
109 Events get on() { 105 Events get on() {
110 if (_on == null) _on = new _EventsImpl(this); 106 if (_on == null) _on = new _EventsImpl(this);
111 return _on; 107 return _on;
112 } 108 }
113 109
114 $!MEMBERS 110 $!MEMBERS
115 } 111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698