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

Side by Side Diff: sky/sdk/lib/widgets/widget.dart

Issue 1180243003: Fix event propagation (Closed) Base URL: git@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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'dart:sky' as sky; 8 import 'dart:sky' as sky;
9 9
10 import '../app/view.dart'; 10 import '../app/view.dart';
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 751
752 void dispatchEvent(sky.Event event, HitTestResult result) { 752 void dispatchEvent(sky.Event event, HitTestResult result) {
753 assert(_appView == this); 753 assert(_appView == this);
754 super.dispatchEvent(event, result); 754 super.dispatchEvent(event, result);
755 for (HitTestEntry entry in result.path.reversed) { 755 for (HitTestEntry entry in result.path.reversed) {
756 Widget target = RenderObjectWrapper._getMounted(entry.target); 756 Widget target = RenderObjectWrapper._getMounted(entry.target);
757 if (target == null) 757 if (target == null)
758 continue; 758 continue;
759 RenderObject targetRoot = target.root; 759 RenderObject targetRoot = target.root;
760 while (target != null && target.root == targetRoot) { 760 while (target != null && target.root == targetRoot) {
761 if (target is EventListener) 761 if (target is Listener)
762 target._handleEvent(event); 762 target._handleEvent(event);
763 target = target._parent; 763 target = target._parent;
764 } 764 }
765 } 765 }
766 } 766 }
767 767
768 } 768 }
769 769
770 abstract class AbstractWidgetRoot extends Component { 770 abstract class AbstractWidgetRoot extends Component {
771 771
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 if (root.parent == null) { 840 if (root.parent == null) {
841 // we haven't attached it yet 841 // we haven't attached it yet
842 assert(_container.child == null); 842 assert(_container.child == null);
843 _container.child = root; 843 _container.child = root;
844 } 844 }
845 assert(root.parent == _container); 845 assert(root.parent == _container);
846 } 846 }
847 847
848 Widget build() => builder(); 848 Widget build() => builder();
849 } 849 }
OLDNEW
« 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