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

Unified Diff: runtime/observatory/lib/src/elements/observatory_element.dart

Issue 1034503002: Fix reuse of <ref> elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/observatory_element.dart
diff --git a/runtime/observatory/lib/src/elements/observatory_element.dart b/runtime/observatory/lib/src/elements/observatory_element.dart
index 46f1ef555d74d310fe5e7e4aebe47ca221448eee..da2735eb41691efce1e933ea1790f161f887fe8d 100644
--- a/runtime/observatory/lib/src/elements/observatory_element.dart
+++ b/runtime/observatory/lib/src/elements/observatory_element.dart
@@ -164,7 +164,18 @@ class ObservatoryElement extends PolymerElement {
void clearShadowRoot() {
// Remove all non-style elements.
- shadowRoot.children.removeWhere((e) => e is! StyleElement);
+ // Have to do the following because removeWhere doesn't work on DOM child
+ // node lists. i.e. removeWhere((e) => e is! StyleElement);
+ var styleElements = [];
+ for (var child in shadowRoot.children) {
+ if (child is StyleElement) {
+ styleElements.add(child);
+ }
+ }
+ shadowRoot.children.clear();
+ for (var style in styleElements) {
+ shadowRoot.children.add(style);
+ }
}
void insertTextSpanIntoShadowRoot(String text) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698