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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: dart/site/try/src/editor.dart
diff --git a/dart/site/try/src/editor.dart b/dart/site/try/src/editor.dart
index 45bcb3bcb520d74f268d81ea979d35863030af4c..afe92ab8b111c8086cf527acc224eaef24be6b8e 100644
--- a/dart/site/try/src/editor.dart
+++ b/dart/site/try/src/editor.dart
@@ -257,12 +257,15 @@ Decoration getDecoration(Token token) {
return currentTheme.foreground;
}
-diagnostic(text, tip) {
- if (text is String) {
- text = new Text(text);
+diagnostic(content, tip) {
+ if (content is String) {
+ content = new Text(content);
+ }
+ if (content is! List) {
+ content = [content];
}
return new AnchorElement()
..classes.add('diagnostic')
- ..append(text)
- ..append(tip);
+ ..append(tip) // Should be first for better Firefox editing.
+ ..nodes.addAll(content);
}

Powered by Google App Engine
This is Rietveld 408576698