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

Side by Side Diff: pkg/polymer/lib/src/declaration.dart

Issue 189213003: Refactoring two pieces of polymer: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 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 part of polymer; 5 part of polymer;
6 6
7 /// *Warning* this class is experimental and subject to change. 7 /// *Warning* this class is experimental and subject to change.
8 /// 8 ///
9 /// The data associated with a polymer-element declaration, if it is backed 9 /// The data associated with a polymer-element declaration, if it is backed
10 /// by a Dart class instead of a JavaScript prototype. 10 /// by a Dart class instead of a JavaScript prototype.
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 const _STYLE_GLOBAL_SCOPE = 'global'; 446 const _STYLE_GLOBAL_SCOPE = 'global';
447 const _SCOPE_ATTR = 'polymer-scope'; 447 const _SCOPE_ATTR = 'polymer-scope';
448 const _STYLE_SCOPE_ATTRIBUTE = 'element'; 448 const _STYLE_SCOPE_ATTRIBUTE = 'element';
449 const _STYLE_CONTROLLER_SCOPE = 'controller'; 449 const _STYLE_CONTROLLER_SCOPE = 'controller';
450 450
451 String _cssTextFromSheet(LinkElement sheet) { 451 String _cssTextFromSheet(LinkElement sheet) {
452 if (sheet == null) return ''; 452 if (sheet == null) return '';
453 453
454 // In deploy mode we should never do a sync XHR; link rel=stylesheet will 454 // In deploy mode we should never do a sync XHR; link rel=stylesheet will
455 // be inlined into a <style> tag by ImportInliner. 455 // be inlined into a <style> tag by ImportInliner.
456 if (_deployMode) return ''; 456 if (loader.deployMode) return '';
457 457
458 // TODO(jmesserly): sometimes the href property is wrong after deployment. 458 // TODO(jmesserly): sometimes the href property is wrong after deployment.
459 var href = sheet.href; 459 var href = sheet.href;
460 if (href == '') href = sheet.attributes["href"]; 460 if (href == '') href = sheet.attributes["href"];
461 461
462 // TODO(jmesserly): it seems like polymer-js is always polyfilling 462 // TODO(jmesserly): it seems like polymer-js is always polyfilling
463 // HTMLImports, because their code depends on "__resource" to work, so I 463 // HTMLImports, because their code depends on "__resource" to work, so I
464 // don't see how it can work with native HTML Imports. We use a sync-XHR 464 // don't see how it can work with native HTML Imports. We use a sync-XHR
465 // under the assumption that the file is likely to have been already 465 // under the assumption that the file is likely to have been already
466 // downloaded and cached by HTML Imports. 466 // downloaded and cached by HTML Imports.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 // Dart note: we need this function because we have additional renames JS does 517 // Dart note: we need this function because we have additional renames JS does
518 // not have. The JS renames are simply case differences, whereas we have ones 518 // not have. The JS renames are simply case differences, whereas we have ones
519 // like doubleclick -> dblclick and stripping the webkit prefix. 519 // like doubleclick -> dblclick and stripping the webkit prefix.
520 String _eventNameFromType(String eventType) { 520 String _eventNameFromType(String eventType) {
521 final result = _reverseEventTranslations[eventType]; 521 final result = _reverseEventTranslations[eventType];
522 return result != null ? result : eventType; 522 return result != null ? result : eventType;
523 } 523 }
524 524
525 final _ATTRIBUTES_REGEX = new RegExp(r'\s|,'); 525 final _ATTRIBUTES_REGEX = new RegExp(r'\s|,');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698