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

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: 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
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..53c6810cbc4884200b1590dcc7b6bfbec3f5e5f4 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,12 @@ 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,
+ span: tag.sourceSpan);
+ }
+ inlinedStylesheetIds.add(id);
return _inlineStylesheet(id, tag);
}
}).then((_) => changed);

Powered by Google App Engine
This is Rietveld 408576698