OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library trydart.editor; | 5 library trydart.editor; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 | 8 |
9 import 'package:compiler/implementation/scanner/scannerlib.dart' show | 9 import 'package:compiler/implementation/scanner/scannerlib.dart' show |
10 EOF_TOKEN, | 10 EOF_TOKEN, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 if (kind == 'error') { | 157 if (kind == 'error') { |
158 alert = error(message); | 158 alert = error(message); |
159 } else if (kind == 'warning') { | 159 } else if (kind == 'warning') { |
160 alert = warning(message); | 160 alert = warning(message); |
161 } else { | 161 } else { |
162 alert = info(message); | 162 alert = info(message); |
163 } | 163 } |
164 Element parent = node.parent; | 164 Element parent = node.parent; |
165 if (parent.classes.contains("diagnostic") && | 165 if (parent.classes.contains("diagnostic") && |
166 !interaction.oldDiagnostics.contains(parent)) { | 166 !interaction.oldDiagnostics.contains(parent)) { |
167 Element other = parent.lastChild; | 167 Element other = parent.firstChild; |
168 other.remove(); | 168 other.remove(); |
169 SpanElement wrapper = new SpanElement(); | 169 SpanElement wrapper = new SpanElement(); |
170 wrapper.style | 170 wrapper.style |
171 ..fontWeight = 'normal'; | 171 ..fontWeight = 'normal'; |
172 var root = getShadowRoot(wrapper); | 172 var root = getShadowRoot(wrapper); |
173 if (root is ShadowRoot) { | 173 if (root is ShadowRoot) { |
174 // When https://code.google.com/p/chromium/issues/detail?id=313458 | 174 // When https://code.google.com/p/chromium/issues/detail?id=313458 |
175 // is fixed: | 175 // is fixed: |
176 // var link = new LinkElement() | 176 // var link = new LinkElement() |
177 // ..rel = "stylesheet" | 177 // ..rel = "stylesheet" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 content = new Text(content); | 262 content = new Text(content); |
263 } | 263 } |
264 if (content is! List) { | 264 if (content is! List) { |
265 content = [content]; | 265 content = [content]; |
266 } | 266 } |
267 return new AnchorElement() | 267 return new AnchorElement() |
268 ..classes.add('diagnostic') | 268 ..classes.add('diagnostic') |
269 ..append(tip) // Should be first for better Firefox editing. | 269 ..append(tip) // Should be first for better Firefox editing. |
270 ..nodes.addAll(content); | 270 ..nodes.addAll(content); |
271 } | 271 } |
OLD | NEW |