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

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

Issue 261413002: Use ShadowRoot to hide non-user content (for example, diagnostics). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Kasper's comments. 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/decoration.dart ('k') | dart/site/try/src/html_to_text.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/editor.dart
diff --git a/dart/site/try/src/editor.dart b/dart/site/try/src/editor.dart
index 9072ef8cc561ac74b9d9ea7da32125f8110d74fc..8007554151b22a19b725935d3e52f70019ab28c8 100644
--- a/dart/site/try/src/editor.dart
+++ b/dart/site/try/src/editor.dart
@@ -30,12 +30,16 @@ import 'decoration.dart' show
import 'selection.dart' show
isCollapsed;
+import 'shadow_root.dart' show
+ getShadowRoot;
+
const String INDENT = '\u{a0}\u{a0}';
Set<String> seenIdentifiers;
-Element moveActive(int distance) {
- List<Element> entries = document.querySelectorAll('.dart-static>.dart-entry');
+Element moveActive(int distance, Node ui) {
+ var /* ShadowRoot or Element */ root = getShadowRoot(ui);
+ List<Element> entries = root.querySelectorAll('.dart-static>.dart-entry');
int activeIndex = -1;
for (var i = 0; i < entries.length; i++) {
if (entries[i].classes.contains('activeEntry')) {
@@ -52,10 +56,10 @@ Element moveActive(int distance) {
if (0 <= newIndex && activeIndex != -1) {
entries[activeIndex].classes.remove('activeEntry');
}
- Element staticNode = document.querySelector('.dart-static');
+ Element staticNode = root.querySelector('.dart-static');
String visibility = computeVisibility(currentEntry, staticNode);
print(visibility);
- var serverResults = document.querySelectorAll('.dart-server>.dart-entry');
+ var serverResults = root.querySelectorAll('.dart-server>.dart-entry');
var serverResultCount = serverResults.length;
if (serverResultCount > 0) {
switch (visibility) {
@@ -76,7 +80,7 @@ Element moveActive(int distance) {
currentEntry.scrollIntoView(ScrollAlignment.BOTTOM);
}
if (serverResultCount == 0) {
- document.querySelector('.dart-server').style.display = 'none';
+ root.querySelector('.dart-server').style.display = 'none';
}
if (currentEntry != null) {
currentEntry.classes.add('activeEntry');
« no previous file with comments | « dart/site/try/src/decoration.dart ('k') | dart/site/try/src/html_to_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698