| OLD | NEW |
| 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 /// Logic to validate that developers are correctly using Polymer constructs. | 5 /// Logic to validate that developers are correctly using Polymer constructs. |
| 6 /// This is mainly used to produce warnings for feedback in the editor. | 6 /// This is mainly used to produce warnings for feedback in the editor. |
| 7 library polymer.src.build.linter; | 7 library polymer.src.build.linter; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:convert'; | 10 import 'dart:convert'; |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 {'tag': customTagName, 'base': nodeTag}), span: node.sourceSpan); | 381 {'tag': customTagName, 'base': nodeTag}), span: node.sourceSpan); |
| 382 return; | 382 return; |
| 383 } | 383 } |
| 384 | 384 |
| 385 if (hasIsAttribute && baseTag != nodeTag) { | 385 if (hasIsAttribute && baseTag != nodeTag) { |
| 386 _logger.warning(BAD_INSTANTIATION_WRONG_BASE_TAG.create( | 386 _logger.warning(BAD_INSTANTIATION_WRONG_BASE_TAG.create( |
| 387 {'tag': customTagName, 'base': baseTag}), span: node.sourceSpan); | 387 {'tag': customTagName, 'base': baseTag}), span: node.sourceSpan); |
| 388 } | 388 } |
| 389 | 389 |
| 390 // FOUC check, if content is supplied | 390 // FOUC check, if content is supplied |
| 391 if (!node.innerHtml.isEmpty) { | 391 if (_isEntryPoint && !node.innerHtml.isEmpty) { |
| 392 var parent = node; | 392 var parent = node; |
| 393 var hasFoucFix = false; | 393 var hasFoucFix = false; |
| 394 while (parent != null && !hasFoucFix) { | 394 while (parent != null && !hasFoucFix) { |
| 395 if (parent.localName == 'polymer-element' || | 395 if (parent.localName == 'polymer-element' || |
| 396 parent.attributes['unresolved'] != null) { | 396 parent.attributes['unresolved'] != null) { |
| 397 hasFoucFix = true; | 397 hasFoucFix = true; |
| 398 } | 398 } |
| 399 if (parent.localName == 'body') break; | 399 if (parent.localName == 'body') break; |
| 400 parent = parent.parent; | 400 parent = parent.parent; |
| 401 } | 401 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 upDirCount = segments.length - 2; | 448 upDirCount = segments.length - 2; |
| 449 } | 449 } |
| 450 var reachOutPrefix = '../' * upDirCount; | 450 var reachOutPrefix = '../' * upDirCount; |
| 451 return USE_POLYMER_HTML.create({'reachOutPrefix': reachOutPrefix}); | 451 return USE_POLYMER_HTML.create({'reachOutPrefix': reachOutPrefix}); |
| 452 } | 452 } |
| 453 | 453 |
| 454 const List<String> INTERNALLY_DEFINED_ELEMENTS = | 454 const List<String> INTERNALLY_DEFINED_ELEMENTS = |
| 455 const ['auto-binding-dart', 'polymer-element']; | 455 const ['auto-binding-dart', 'polymer-element']; |
| 456 const List<String> AUTO_BINDING_ELEMENTS = | 456 const List<String> AUTO_BINDING_ELEMENTS = |
| 457 const ['auto-binding-dart', 'auto-binding']; | 457 const ['auto-binding-dart', 'auto-binding']; |
| OLD | NEW |