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

Side by Side Diff: dart/site/try/src/editor.dart

Issue 374363002: Fix problem that caused deletion of tokens with multiple diagnostics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« 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 (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
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
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 }
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