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

Unified Diff: sky/specs/events.md

Issue 872993007: Specs: dartification of pointer and wheel events (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/specs/pointer.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/events.md
diff --git a/sky/specs/events.md b/sky/specs/events.md
index 43abffcea0362358a2985370ff1afe0222c5b2d8..d5571095bb99f4f343397704b0c59d897582709c 100644
--- a/sky/specs/events.md
+++ b/sky/specs/events.md
@@ -6,11 +6,10 @@ SKY MODULE
<!-- part of sky:core -->
<script>
-abstract class Event {
- Event({bool bubbles}) : this._bubbles = bubbles;
+abstract class Event<ReturnType> {
+ Event({bool this.bubbles});
- bool _bubbles;
- bool get bubbles => _bubbles;
+ final bool bubbles;
EventTarget _target;
EventTarget get target => _target;
@@ -19,7 +18,7 @@ abstract class Event {
EventTarget get currentTarget => _currentTarget;
bool handled; // precise semantics depend on the event type, but in general, set this when you set result
- dynamic result;
+ ReturnType result;
// TODO(ianh): abstract API for doing things at shadow tree boundaries
// TODO(ianh): do events get blocked at scope boundaries, e.g. focus events when both sides are in the scope?
@@ -45,17 +44,17 @@ class EventTarget {
final DispatcherController _eventsController;
dynamic dispatchEvent(Event event, { defaultResult: null }) { // O(N*M) where N is the length of the chain and M is the average number of listeners per link in the chain
- // note: this will throw if any of the listeners threw
+ // note: this will throw an ExceptionListException<ExceptionListException> if any of the listeners threw
assert(event != null); // event must be non-null
event.handled = false;
event.result = defaultResult;
event._target = this;
var chain = this.getEventDispatchChain();
- var exceptions = new ExceptionListException<ExceptionListException<Exception>>();
+ var exceptions = new ExceptionListException<ExceptionListException>();
for (var link in chain) {
try {
link._dispatchEventLocally(event);
- } on ExceptionListException<Exception> catch (e) {
+ } on ExceptionListException catch (e) {
exceptions.add(e);
}
}
« no previous file with comments | « no previous file | sky/specs/pointer.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698