anchor.diff:      });
     }
   
  +  /// Switch to the Dart / Html / Css tab depending on the sample type.
  +  void _autoSwitchSourceTab() {
  +    String htmlSrc = _context.htmlSource.trim();
  +    String dartSrc = _context.dartSource.trim();
  +
  +    if (htmlSrc.isEmpty && dartSrc.isNotEmpty) {
  +      sourceTabController.selectTab('dart');
  +    }
  +  }
  +
     /// Switch to the console or html results tab depending on whether the sample
     /// has html content or not.
  -  void _switchOutputTab(String html, String dart) {
  -    if (html.trim().isEmpty && !dart.contains("'dart:html'")
  -        && !dart.contains('"dart:html"')) {
  -      outputTabController.selectTab("console");
  +  void _autoSwitchOutputTab() {
  +    String htmlSrc = _context.htmlSource.trim();
  +    String dartSrc = _context.dartSource.trim();
  +
  +    if (htmlSrc.isNotEmpty) {
  +      outputTabController.selectTab('result');
  +    } else if (dartSrc.contains("'dart:html'") || dartSrc.contains('"dart:html"')) {
  +      outputTabController.selectTab('result');
       } else {
  -      outputTabController.selectTab("result");
  -    }
  -  }
  -  
  +      outputTabController.selectTab('console');
  +    }
  +  }
  +
     Future<String> _createSummary() {
       SourceRequest input = new SourceRequest()..source = _context.dartSource;
       return dartServices
  
positive.code:       ga.sendTiming('action-perf', "compilation-e2e",
            compilationTimer.elapsedMilliseconds);
  
        _switchOutputTab(_context.htmlSource, _context.dartSource);
  
        return executionService.execute(
            _context.htmlSource, _context.cssSource, response.result);
  
negative.code:     }
  
      _clearOutput();
      // We delay this because of the latency in populating the editors from the
      // gist data.
      Timer.run(_autoSwitchSourceTab);
  
      // Analyze and run it.
      Timer.run(() {
  