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

Unified Diff: pkg/polymer/lib/src/build/import_inliner.dart

Issue 589743002: warn if inlining the same css file more than once (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: generate messages.html, update pubspec/changelog for release Created 6 years, 3 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 | « pkg/polymer/lib/src/build/generated/messages.html ('k') | pkg/polymer/lib/src/build/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/import_inliner.dart
diff --git a/pkg/polymer/lib/src/build/import_inliner.dart b/pkg/polymer/lib/src/build/import_inliner.dart
index b6a973f3e4ea39775df00de740df11bf42eacb0e..cf3b7d931e3c6ad44e52c0f90bc95b0d30f83bb2 100644
--- a/pkg/polymer/lib/src/build/import_inliner.dart
+++ b/pkg/polymer/lib/src/build/import_inliner.dart
@@ -31,6 +31,7 @@ class _HtmlInliner extends PolymerTransformer {
final AssetId docId;
final seen = new Set<AssetId>();
final scriptIds = <AssetId>[];
+ final inlinedStylesheetIds = new Set<AssetId>();
final extractedFiles = new Set<AssetId>();
bool experimentalBootstrap = false;
final Element importsWrapper = new Element.html('<div hidden></div>');
@@ -135,6 +136,13 @@ class _HtmlInliner extends PolymerTransformer {
if (!options.shouldInlineStylesheet(id)) return null;
changed = true;
+ if (inlinedStylesheetIds.contains(id)
+ && !options.stylesheetInliningIsOverridden(id)) {
+ logger.warning(
+ CSS_FILE_INLINED_MULTIPLE_TIMES.create({'url': id.path}),
+ span: tag.sourceSpan);
+ }
+ inlinedStylesheetIds.add(id);
return _inlineStylesheet(id, tag);
}
}).then((_) => changed);
« no previous file with comments | « pkg/polymer/lib/src/build/generated/messages.html ('k') | pkg/polymer/lib/src/build/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698