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

Unified Diff: site/try/src/interaction_manager.dart

Issue 494253002: Fix Try Dart newline handling on IE11. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | tests/try/try.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site/try/src/interaction_manager.dart
===================================================================
--- site/try/src/interaction_manager.dart (revision 39473)
+++ site/try/src/interaction_manager.dart (working copy)
@@ -394,7 +394,13 @@
selection.collapse(text, offset + 1);
} else if (node is Element) {
node.appendText('\n\n');
- selection.collapse(node.firstChild, 1);
+ if (node.firstChild is Text) {
+ selection.collapse(node.firstChild, 1);
+ } else {
+ // This else-branch accomodates IE11, which
+ // puts <BR> instead of '\n' in content-editable Divs.
+ selection.collapse(node, 1);
ahe 2014/08/22 09:46:52 How does this interact with getText in shadow_root
aam-me 2014/08/22 12:05:14 By the time we get to that getText <br>'s are gone
ahe 2014/08/22 12:13:44 In other words, this wouldn't work if IE supported
+ }
} else {
window.console
..error('Unexpected node')
« no previous file with comments | « no previous file | tests/try/try.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698