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

Side by Side Diff: lib/src/emitters.dart

Issue 23072022: [pkg:web_ui] fix insertBefore case (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: also change pubspec Created 7 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** Collects several code emitters for the template tool. */ 5 /** Collects several code emitters for the template tool. */
6 library emitters; 6 library emitters;
7 7
8 import 'package:csslib/parser.dart' as css; 8 import 'package:csslib/parser.dart' as css;
9 import 'package:csslib/visitor.dart'; 9 import 'package:csslib/visitor.dart';
10 import 'package:html5lib/dom.dart'; 10 import 'package:html5lib/dom.dart';
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 var bootstrapScript = parseFragment( 914 var bootstrapScript = parseFragment(
915 '<script type="application/dart" src="$bootstrapOutName"></script>'); 915 '<script type="application/dart" src="$bootstrapOutName"></script>');
916 if (dartLoaderTag == null) { 916 if (dartLoaderTag == null) {
917 document.body.nodes.add(bootstrapScript); 917 document.body.nodes.add(bootstrapScript);
918 document.body.nodes.add(parseFragment( 918 document.body.nodes.add(parseFragment(
919 '<script type="text/javascript" src="packages/browser/dart.js">' 919 '<script type="text/javascript" src="packages/browser/dart.js">'
920 '</script>\n')); 920 '</script>\n'));
921 } else if (dartLoaderTag.parent != document.body) { 921 } else if (dartLoaderTag.parent != document.body) {
922 document.body.nodes.add(bootstrapScript); 922 document.body.nodes.add(bootstrapScript);
923 } else { 923 } else {
924 document.body.nodes.insertBefore(bootstrapScript, dartLoaderTag); 924 document.body.insertBefore(bootstrapScript, dartLoaderTag);
925 } 925 }
926 926
927 // Insert the "auto-generated" comment after the doctype, otherwise IE will 927 // Insert the "auto-generated" comment after the doctype, otherwise IE will
928 // go into quirks mode. 928 // go into quirks mode.
929 int commentIndex = 0; 929 int commentIndex = 0;
930 DocumentType doctype = find(document.nodes, (n) => n is DocumentType); 930 DocumentType doctype = find(document.nodes, (n) => n is DocumentType);
931 if (doctype != null) { 931 if (doctype != null) {
932 commentIndex = document.nodes.indexOf(doctype) + 1; 932 commentIndex = document.nodes.indexOf(doctype) + 1;
933 // TODO(jmesserly): the html5lib parser emits a warning for missing 933 // TODO(jmesserly): the html5lib parser emits a warning for missing
934 // doctype, but it allows you to put it after comments. Presumably they do 934 // doctype, but it allows you to put it after comments. Presumably they do
(...skipping 17 matching lines...) Expand all
952 return """ 952 return """
953 // Auto-generated from $filename. 953 // Auto-generated from $filename.
954 // DO NOT EDIT. 954 // DO NOT EDIT.
955 $lib 955 $lib
956 import 'dart:html' as autogenerated; 956 import 'dart:html' as autogenerated;
957 import 'dart:svg' as autogenerated_svg; 957 import 'dart:svg' as autogenerated_svg;
958 import 'package:web_ui/web_ui.dart' as autogenerated; 958 import 'package:web_ui/web_ui.dart' as autogenerated;
959 import 'package:web_ui/observe/observable.dart' as __observe; 959 import 'package:web_ui/observe/observable.dart' as __observe;
960 """; 960 """;
961 } 961 }
OLDNEW
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698