| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.shadow_root; | 5 library trydart.shadow_root; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 | 8 |
| 9 import 'selection.dart' show | 9 import 'selection.dart' show |
| 10 TrySelection; | 10 TrySelection; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 List<Node> polyfill = root.querySelectorAll('[try-dart-shadow-root]'); | 42 List<Node> polyfill = root.querySelectorAll('[try-dart-shadow-root]'); |
| 43 for (Element element in polyfill) { | 43 for (Element element in polyfill) { |
| 44 element.remove(); | 44 element.remove(); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 String getText(Element node) { | 49 String getText(Element node) { |
| 50 if (ShadowRoot.supported) return node.text; | 50 if (ShadowRoot.supported) return node.text; |
| 51 StringBuffer buffer = new StringBuffer(); | 51 StringBuffer buffer = new StringBuffer(); |
| 52 htmlToText(node, buffer, new TrySelection.empty(node)); | 52 htmlToText( |
| 53 node, buffer, new TrySelection.empty(node), treatRootAsInline: true); |
| 53 return '$buffer'; | 54 return '$buffer'; |
| 54 } | 55 } |
| OLD | NEW |