| OLD | NEW |
| 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 library fn; | 5 library fn; |
| 6 | 6 |
| 7 import 'app.dart'; | 7 import 'app.dart'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 | 1054 |
| 1055 if (transform != null) | 1055 if (transform != null) |
| 1056 current = new Transform(transform: transform, child: current); | 1056 current = new Transform(transform: transform, child: current); |
| 1057 | 1057 |
| 1058 return current; | 1058 return current; |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 class _AppView extends AppView { | 1063 class _AppView extends AppView { |
| 1064 |
| 1064 _AppView() : super(null); | 1065 _AppView() : super(null); |
| 1065 | 1066 |
| 1066 void dispatchEvent(sky.Event event, HitTestResult result) { | 1067 void dispatchEvent(sky.Event event, HitTestResult result) { |
| 1067 super.dispatchEvent(event, result); | 1068 super.dispatchEvent(event, result); |
| 1068 | 1069 for (HitTestEntry entry in result.path.reversed) { |
| 1069 UINode target = RenderObjectWrapper._getMounted(result.path.first.target); | 1070 UINode target = RenderObjectWrapper._getMounted(entry.target); |
| 1070 | 1071 if (target == null) |
| 1071 // TODO(rafaelw): StopPropagation? | 1072 continue; |
| 1072 while (target != null) { | 1073 RenderObject targetRoot = target.root; |
| 1073 if (target is EventListenerNode) | 1074 while (target != null && target.root == targetRoot) { |
| 1074 target._handleEvent(event); | 1075 if (target is EventListenerNode) |
| 1075 target = target._parent; | 1076 target._handleEvent(event); |
| 1077 target = target._parent; |
| 1078 } |
| 1076 } | 1079 } |
| 1077 } | 1080 } |
| 1081 |
| 1078 } | 1082 } |
| 1079 | 1083 |
| 1080 abstract class App extends Component { | 1084 abstract class App extends Component { |
| 1081 | 1085 |
| 1082 App() : super(stateful: true) { | 1086 App() : super(stateful: true) { |
| 1083 _appView = new _AppView(); | 1087 _appView = new _AppView(); |
| 1084 _scheduleComponentForRender(this); | 1088 _scheduleComponentForRender(this); |
| 1085 _mounted = true; | 1089 _mounted = true; |
| 1086 } | 1090 } |
| 1087 | 1091 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1098 } | 1102 } |
| 1099 | 1103 |
| 1100 } | 1104 } |
| 1101 | 1105 |
| 1102 class Text extends Component { | 1106 class Text extends Component { |
| 1103 Text(this.data) : super(key: '*text*'); | 1107 Text(this.data) : super(key: '*text*'); |
| 1104 final String data; | 1108 final String data; |
| 1105 bool get interchangeable => true; | 1109 bool get interchangeable => true; |
| 1106 UINode build() => new Paragraph(text: data); | 1110 UINode build() => new Paragraph(text: data); |
| 1107 } | 1111 } |
| OLD | NEW |