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

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

Issue 345553008: Fix issues that broke editing on browsers without Shadow DOM support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Johnni's changes, and fix bugs found during testing. 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
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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 if (tokenInfo == 'keyword') return currentTheme.keyword; 251 if (tokenInfo == 'keyword') return currentTheme.keyword;
252 if (tokenInfo == 'comment') return currentTheme.singleLineComment; 252 if (tokenInfo == 'comment') return currentTheme.singleLineComment;
253 if (tokenInfo == 'malformed input') { 253 if (tokenInfo == 'malformed input') {
254 isMalformedInput = true; 254 isMalformedInput = true;
255 return new DiagnosticDecoration('error', tokenValue); 255 return new DiagnosticDecoration('error', tokenValue);
256 } 256 }
257 return currentTheme.foreground; 257 return currentTheme.foreground;
258 } 258 }
259 259
260 diagnostic(text, tip) { 260 diagnostic(content, tip) {
261 if (text is String) { 261 if (content is String) {
262 text = new Text(text); 262 content = new Text(content);
263 }
264 if (content is! List) {
265 content = [content];
263 } 266 }
264 return new AnchorElement() 267 return new AnchorElement()
265 ..classes.add('diagnostic') 268 ..classes.add('diagnostic')
266 ..append(text) 269 ..append(tip) // Should be first for better Firefox editing.
267 ..append(tip); 270 ..nodes.addAll(content);
268 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698