Index: runtime/observatory/lib/src/elements/script_inset.dart |
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart |
index 3aeaf67619f19ba9b79c790a47f3b2965a05860a..039529bc4a3ea756f451e72110322ddfb52157cc 100644 |
--- a/runtime/observatory/lib/src/elements/script_inset.dart |
+++ b/runtime/observatory/lib/src/elements/script_inset.dart |
@@ -390,7 +390,7 @@ class ScriptInsetElement extends ObservatoryElement { |
} |
void _scrollToCurrentPos() { |
- var line = querySelector('#${makeLineId(_currentLine)}'); |
+ var line = shadowRoot.getElementById(makeLineId(_currentLine)); |
if (line != null) { |
line.scrollIntoView(); |
} |
@@ -469,14 +469,19 @@ class ScriptInsetElement extends ObservatoryElement { |
computeAnnotations(); |
var table = linesTable(); |
+ var firstBuild = false; |
if (container == null) { |
// Indirect to avoid deleting the style element. |
container = new DivElement(); |
shadowRoot.append(container); |
+ firstBuild = true; |
} |
container.children.clear(); |
container.children.add(table); |
makeCssClassUncopyable(table, "noCopy"); |
+ if (firstBuild) { |
+ _scrollToCurrentPos(); |
+ } |
} |
void computeAnnotations() { |