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

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1181503002: Dispatch events to fn nodes for each RenderObject that the event goes through, instead of starting … (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index 994449538cdef559702f7cde54f1466f7c94bf5e..fe02f0a2f42f6fed29895920d41273f5a6d88008 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -1061,20 +1061,24 @@ class Container extends Component {
}
class _AppView extends AppView {
+
_AppView() : super(null);
void dispatchEvent(sky.Event event, HitTestResult result) {
super.dispatchEvent(event, result);
-
- UINode target = RenderObjectWrapper._getMounted(result.path.first.target);
-
- // TODO(rafaelw): StopPropagation?
- while (target != null) {
- if (target is EventListenerNode)
- target._handleEvent(event);
- target = target._parent;
+ for (HitTestEntry entry in result.path.reversed) {
+ UINode target = RenderObjectWrapper._getMounted(entry.target);
+ if (target == null)
+ continue;
+ RenderObject targetRoot = target.root;
+ while (target != null && target.root == targetRoot) {
+ if (target is EventListenerNode)
+ target._handleEvent(event);
+ target = target._parent;
+ }
}
}
+
}
abstract class App extends Component {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698