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

Side by Side Diff: tools/dom/templates/html/impl/impl_EventTarget.darttemplate

Issue 1879253004: Revert "Fix a few strong mode errors in dart:html" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 // 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 /** 7 /**
8 * Base class that supports listening for and dispatching browser events. 8 * Base class that supports listening for and dispatching browser events.
9 * 9 *
10 * Normally events are accessed via the Stream getter: 10 * Normally events are accessed via the Stream getter:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 final EventTarget _ptr; 45 final EventTarget _ptr;
46 46
47 Events(this._ptr); 47 Events(this._ptr);
48 48
49 Stream operator [](String type) { 49 Stream operator [](String type) {
50 return new _EventStream(_ptr, type, false); 50 return new _EventStream(_ptr, type, false);
51 } 51 }
52 } 52 }
53 53
54 class ElementEvents extends Events { 54 class ElementEvents extends Events {
55 /* Raw event target. */
56 final Element _ptr;
55 static final webkitEvents = { 57 static final webkitEvents = {
56 'animationend' : 'webkitAnimationEnd', 58 'animationend' : 'webkitAnimationEnd',
57 'animationiteration' : 'webkitAnimationIteration', 59 'animationiteration' : 'webkitAnimationIteration',
58 'animationstart' : 'webkitAnimationStart', 60 'animationstart' : 'webkitAnimationStart',
59 'fullscreenchange' : 'webkitfullscreenchange', 61 'fullscreenchange' : 'webkitfullscreenchange',
60 'fullscreenerror' : 'webkitfullscreenerror', 62 'fullscreenerror' : 'webkitfullscreenerror',
61 'keyadded' : 'webkitkeyadded', 63 'keyadded' : 'webkitkeyadded',
62 'keyerror' : 'webkitkeyerror', 64 'keyerror' : 'webkitkeyerror',
63 'keymessage' : 'webkitkeymessage', 65 'keymessage' : 'webkitkeymessage',
64 'needkey' : 'webkitneedkey', 66 'needkey' : 'webkitneedkey',
65 'pointerlockchange' : 'webkitpointerlockchange', 67 'pointerlockchange' : 'webkitpointerlockchange',
66 'pointerlockerror' : 'webkitpointerlockerror', 68 'pointerlockerror' : 'webkitpointerlockerror',
67 'resourcetimingbufferfull' : 'webkitresourcetimingbufferfull', 69 'resourcetimingbufferfull' : 'webkitresourcetimingbufferfull',
68 'transitionend': 'webkitTransitionEnd', 70 'transitionend': 'webkitTransitionEnd',
69 'speechchange' : 'webkitSpeechChange' 71 'speechchange' : 'webkitSpeechChange'
70 }; 72 };
71 73
72 ElementEvents(Element ptr) : super(ptr); 74 ElementEvents(Element ptr) : this._ptr = ptr, super(ptr);
73 75
74 Stream operator [](String type) { 76 Stream operator [](String type) {
75 if (webkitEvents.keys.contains(type.toLowerCase())) { 77 if (webkitEvents.keys.contains(type.toLowerCase())) {
76 if (Device.isWebKit) { 78 if (Device.isWebKit) {
77 return new _ElementEventStreamImpl( 79 return new _ElementEventStreamImpl(
78 _ptr, webkitEvents[type.toLowerCase()], false); 80 _ptr, webkitEvents[type.toLowerCase()], false);
79 } 81 }
80 } 82 }
81 return new _ElementEventStreamImpl(_ptr, type, false); 83 return new _ElementEventStreamImpl(_ptr, type, false);
82 } 84 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // TODO(leafp): This check is avoid a bug in our dispatch code when 120 // TODO(leafp): This check is avoid a bug in our dispatch code when
119 // listener is null. The browser treats this call as a no-op in this 121 // listener is null. The browser treats this call as a no-op in this
120 // case, so it's fine to short-circuit it, but we should not have to. 122 // case, so it's fine to short-circuit it, but we should not have to.
121 if (listener != null) { 123 if (listener != null) {
122 _removeEventListener(type, listener, useCapture); 124 _removeEventListener(type, listener, useCapture);
123 } 125 }
124 } 126 }
125 127
126 $!MEMBERS 128 $!MEMBERS
127 } 129 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Event.darttemplate ('k') | tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698