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

Side by Side Diff: sky/specs/events.md

Issue 927613002: Specs: Drop @nonnull from dom.md, drop ChildNode from dom.md, drop TreeRoot from dom.md, other mino… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: merge Document, TreeScope, and ShadowRoot, to simplify this API 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 unified diff | Download patch
« no previous file with comments | « sky/specs/elements.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Sky Event Model 1 Sky Event Model
2 =============== 2 ===============
3 3
4 ```dart 4 ```dart
5 SKY MODULE 5 SKY MODULE
6 <!-- part of sky:core --> 6 <!-- part of sky:core -->
7 7
8 <script> 8 <script>
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EventTarget get currentTarget => _currentTarget; 124 EventTarget get currentTarget => _currentTarget;
125 125
126 bool handled; // precise semantics depend on the event type, but in general, s et this when you set result 126 bool handled; // precise semantics depend on the event type, but in general, s et this when you set result
127 ReturnType result; 127 ReturnType result;
128 128
129 bool resultIsCompatible(dynamic candidate) => candidate is ReturnType; 129 bool resultIsCompatible(dynamic candidate) => candidate is ReturnType;
130 130
131 // TODO(ianh): abstract API for doing things at shadow tree boundaries 131 // TODO(ianh): abstract API for doing things at shadow tree boundaries
132 // TODO(ianh): do events get blocked at scope boundaries, e.g. focus events wh en both sides are in the scope? 132 // TODO(ianh): do events get blocked at scope boundaries, e.g. focus events wh en both sides are in the scope?
133 // TODO(ianh): do events get retargetted, e.g. focus when leaving a custom ele ment? 133 // TODO(ianh): do events get retargetted, e.g. focus when leaving a custom ele ment?
134 // e.g. sent from inside a shadow tree, when exiting the shadow tree, focus ev ent should:
135 // - disappear if we're moving from one to another element
136 // - be targetted if it's going to another node in a different scope
134 } 137 }
135 138
136 class EventTarget { 139 class EventTarget {
137 EventTarget() : _eventsController = new DispatcherController<Event>(); 140 EventTarget() : _eventsController = new DispatcherController<Event>();
138 141
139 Dispatcher get events => _eventsController.dispatcher; 142 Dispatcher get events => _eventsController.dispatcher;
140 EventTarget parentNode; 143 EventTarget parentNode;
141 144
142 List<EventTarget> getEventDispatchChain() { 145 List<EventTarget> getEventDispatchChain() {
143 if (this.parentNode == null) { 146 if (this.parentNode == null) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return event.result; 179 return event.result;
177 } 180 }
178 181
179 void _dispatchEventLocally(Event event) { 182 void _dispatchEventLocally(Event event) {
180 event._currentTarget = this; 183 event._currentTarget = this;
181 _eventsController.add(event); 184 _eventsController.add(event);
182 } 185 }
183 } 186 }
184 </script> 187 </script>
185 ``` 188 ```
OLDNEW
« no previous file with comments | « sky/specs/elements.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698