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

Side by Side Diff: pkg/polymer/lib/src/build/import_inliner.dart

Issue 723393003: update to polymer js 0.5.1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final tweaks Created 6 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Transfomer that inlines polymer-element definitions from html imports. 5 /// Transfomer that inlines polymer-element definitions from html imports.
6 library polymer.src.build.import_inliner; 6 library polymer.src.build.import_inliner;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:collection' show LinkedHashSet; 10 import 'dart:collection' show LinkedHashSet;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 inlinedStylesheetIds.add(id); 146 inlinedStylesheetIds.add(id);
147 return _inlineStylesheet(id, tag); 147 return _inlineStylesheet(id, tag);
148 } 148 }
149 }).then((_) => changed); 149 }).then((_) => changed);
150 } 150 }
151 151
152 /// To preserve the order of scripts with respect to inlined 152 /// To preserve the order of scripts with respect to inlined
153 /// link rel=import, we move both of those into the body before we do any 153 /// link rel=import, we move both of those into the body before we do any
154 /// inlining. We do not start doing this until the first import is found 154 /// inlining. We do not start doing this until the first import is found
155 /// however, as some scripts do need to be ran in the head to work 155 /// however, as some scripts do need to be ran in the head to work
156 /// properly (platform.js for instance). 156 /// properly (webcomponents.js for instance).
157 /// 157 ///
158 /// Note: we do this for stylesheets as well to preserve ordering with 158 /// Note: we do this for stylesheets as well to preserve ordering with
159 /// respect to eachother, because stylesheets can be pulled in transitively 159 /// respect to eachother, because stylesheets can be pulled in transitively
160 /// from imports. 160 /// from imports.
161 // TODO(jmesserly): vulcanizer doesn't need this because they inline JS 161 // TODO(jmesserly): vulcanizer doesn't need this because they inline JS
162 // scripts, causing them to be naturally moved as part of the inlining. 162 // scripts, causing them to be naturally moved as part of the inlining.
163 // Should we do the same? Alternatively could we inline head into head and 163 // Should we do the same? Alternatively could we inline head into head and
164 // body into body and avoid this whole thing? 164 // body into body and avoid this whole thing?
165 void _moveHeadToBody(Document doc) { 165 void _moveHeadToBody(Document doc) {
166 var foundImport = false; 166 var foundImport = false;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 /// style tag except these ones. 560 /// style tag except these ones.
561 const IGNORED_LINKED_STYLE_ATTRS = 561 const IGNORED_LINKED_STYLE_ATTRS =
562 const ['charset', 'href', 'href-lang', 'rel', 'rev']; 562 const ['charset', 'href', 'href-lang', 'rel', 'rev'];
563 563
564 /// Global RegExp objects. 564 /// Global RegExp objects.
565 final _INVALID_LIB_CHARS_REGEX = new RegExp('[^a-z0-9_]'); 565 final _INVALID_LIB_CHARS_REGEX = new RegExp('[^a-z0-9_]');
566 final _NUM_REGEX = new RegExp('[0-9]'); 566 final _NUM_REGEX = new RegExp('[0-9]');
567 final _BINDING_REGEX = new RegExp(r'(({{.*}})|(\[\[.*\]\]))'); 567 final _BINDING_REGEX = new RegExp(r'(({{.*}})|(\[\[.*\]\]))');
568 568
569 _getSpan(SourceFile file, AstNode node) => file.span(node.offset, node.end); 569 _getSpan(SourceFile file, AstNode node) => file.span(node.offset, node.end);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698