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

Side by Side Diff: sky/framework/sky-element/TemplateBinding.sky

Issue 697773002: Remove Element#attributes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix template binding. Created 6 years, 1 month 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
« no previous file with comments | « sky/framework/inspector/dom-agent.sky ('k') | sky/tests/lowlevel/attribute-collection.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <link rel="import" href="observe.sky" as="observe" /> 6 <link rel="import" href="observe.sky" as="observe" />
7 7
8 <script> 8 <script>
9 Node.prototype.bind = function(name, observable, oneTime) { 9 Node.prototype.bind = function(name, observable, oneTime) {
10 var self = this; 10 var self = this;
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 532
533 function parseWithDefault(el, name, prepareBindingFn) { 533 function parseWithDefault(el, name, prepareBindingFn) {
534 var v = el.getAttribute(name); 534 var v = el.getAttribute(name);
535 return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn); 535 return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn);
536 } 536 }
537 537
538 function parseAttributeBindings(element, prepareBindingFn) { 538 function parseAttributeBindings(element, prepareBindingFn) {
539 var bindings = []; 539 var bindings = [];
540 var ifFound = false; 540 var ifFound = false;
541 var bindFound = false; 541 var bindFound = false;
542 var attributes = element.getAttributes();
542 543
543 for (var i = 0; i < element.attributes.length; i++) { 544 for (var i = 0; i < attributes.length; i++) {
544 var attr = element.attributes[i]; 545 var attr = attributes[i];
545 var name = attr.name; 546 var name = attr.name;
546 var value = attr.value; 547 var value = attr.value;
547 548
548 if (isTemplate(element) && 549 if (isTemplate(element) &&
549 (name === IF || name === BIND || name === REPEAT)) { 550 (name === IF || name === BIND || name === REPEAT)) {
550 continue; 551 continue;
551 } 552 }
552 553
553 var tokens = parseMustaches(value, name, element, 554 var tokens = parseMustaches(value, name, element,
554 prepareBindingFn); 555 prepareBindingFn);
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 this.closeInstanceBindings(this.instances[i]); 995 this.closeInstanceBindings(this.instances[i]);
995 } 996 }
996 997
997 this.instances.length = 0; 998 this.instances.length = 0;
998 this.closeDeps(); 999 this.closeDeps();
999 this.templateElement_.iterator_ = undefined; 1000 this.templateElement_.iterator_ = undefined;
1000 this.closed = true; 1001 this.closed = true;
1001 } 1002 }
1002 }; 1003 };
1003 </script> 1004 </script>
OLDNEW
« no previous file with comments | « sky/framework/inspector/dom-agent.sky ('k') | sky/tests/lowlevel/attribute-collection.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698