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

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

Issue 270703005: Fix source_update_test on Chrome. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « dart/site/try/src/selection.dart ('k') | dart/tests/try/try.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/shadow_root.dart
diff --git a/dart/site/try/src/shadow_root.dart b/dart/site/try/src/shadow_root.dart
index 9ba086fac5fd36e0583bb6d568588473d896ce87..e1cd9a1658ed4cb3d8d2120b5daf0b26068cd4bd 100644
--- a/dart/site/try/src/shadow_root.dart
+++ b/dart/site/try/src/shadow_root.dart
@@ -6,6 +6,12 @@ library trydart.shadow_root;
import 'dart:html';
+import 'selection.dart' show
+ TrySelection;
+
+import 'html_to_text.dart' show
+ htmlToText;
+
void setShadowRoot(Element node, text) {
if (text is String) {
text = new Text(text);
@@ -39,3 +45,10 @@ void removeShadowRootPolyfill(Element root) {
}
}
}
+
+String getText(Element node) {
+ if (ShadowRoot.supported) return node.text;
+ StringBuffer buffer = new StringBuffer();
+ htmlToText(node, buffer, new TrySelection.empty(node));
+ return '$buffer';
ahe 2014/05/08 09:07:53 Firefox or htmlToText adds one too many newlines t
+}
« no previous file with comments | « dart/site/try/src/selection.dart ('k') | dart/tests/try/try.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698