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

Unified Diff: sky/specs/events.md

Issue 873803003: Specs: Change event model to support default return values. Change (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/ui.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 1ae7492f895235cadb4b5d9a8108629b2b136efc..8e49acced3bb974e0b2930fa13bebd0da7e60406 100644
--- a/sky/specs/events.md
+++ b/sky/specs/events.md
@@ -27,7 +27,7 @@ Sky Event Model
//
// The advantage of this would be the ability to enforce (or at
// least better catch) incorrect uses of the API, e.g. to make sure
- // people don't stop on themselves in 'pointer-down' capture.
+ // people don't stomp on themselves with the return value.
callback EventListener any (Event event);
// if the return value is not undefined:
@@ -35,8 +35,8 @@ Sky Event Model
// set event.handled to true
abstract class EventTarget {
- any dispatchEvent(Event event); // O(N) in total number of listeners for this type in the chain
- // sets event.handled to false and event.result to undefined
+ any dispatchEvent(Event event, any defaultResult = null); // O(N) in total number of listeners for this type in the chain
+ // sets event.handled to false and event.result to defaultResult
// makes a record of the event target chain by calling getEventDispatchChain()
// invokes all the handlers on the chain in turn
// returns event.result
« no previous file with comments | « no previous file | sky/specs/ui.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698