Chromium Code Reviews| Index: pkg/polymer/lib/src/build/linter.dart |
| diff --git a/pkg/polymer/lib/src/build/linter.dart b/pkg/polymer/lib/src/build/linter.dart |
| index 3ec663769151c6e0897c15c8178257374c4d84b3..29e2a15305f77149c6ef158144b5111ad0e1a342 100644 |
| --- a/pkg/polymer/lib/src/build/linter.dart |
| +++ b/pkg/polymer/lib/src/build/linter.dart |
| @@ -393,6 +393,28 @@ class _LinterVisitor extends TreeVisitor { |
| 'Did you mean to write <$baseTag is="$customTagName">?', |
| span: node.sourceSpan); |
| } |
| + |
| + // FOUC check, if content is supplied |
| + if (!node.innerHtml.isEmpty) { |
| + var parent = node; |
| + var hasFoucFix = false; |
| + while(parent != null && !hasFoucFix) { |
|
Siggi Cherem (dart-lang)
2014/09/04 00:12:32
nit: space before '('
|
| + if (parent.localName == 'polymer-element' || |
| + parent.attributes['unresolved'] != null) { |
| + hasFoucFix = true; |
| + } |
| + if (parent.localName == 'body') break; |
| + parent = parent.parent; |
| + } |
| + if (!hasFoucFix) { |
| + _logger.warning( |
| + 'Custom element found in document body without an ' |
| + '"unresolved" attribute on it or one of its parents. This means ' |
| + 'your app probably has a flash of unstyled content before it ' |
| + 'finishes loading. See http://goo.gl/iN03Pj for more info.', |
| + span: node.sourceSpan); |
| + } |
| + } |
| } |
| /// Validate an attribute on a custom-element. Returns true if valid. |