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

Side by Side Diff: pkg/mdv/lib/src/template_iterator.dart

Issue 34613005: Revert "Converting Polymer and TemplateElement to use deprecated Node.document" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « pkg/mdv/lib/src/input_bindings.dart ('k') | pkg/polymer/lib/src/instance.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 mdv; 5 part of mdv;
6 6
7 // This code is a port of Model-Driven-Views: 7 // This code is a port of Model-Driven-Views:
8 // https://github.com/polymer-project/mdv 8 // https://github.com/polymer-project/mdv
9 // The code mostly comes from src/template_element.js 9 // The code mostly comes from src/template_element.js
10 10
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 330
331 void _handleChanges(Iterable<ChangeRecord> splices) { 331 void _handleChanges(Iterable<ChangeRecord> splices) {
332 if (closed) return; 332 if (closed) return;
333 333
334 splices = splices.where((s) => s is ListChangeRecord); 334 splices = splices.where((s) => s is ListChangeRecord);
335 335
336 var template = _templateElement; 336 var template = _templateElement;
337 var delegate = template.bindingDelegate; 337 var delegate = template.bindingDelegate;
338 338
339 if (template.parentNode == null || template.document.window == null) { 339 if (template.parentNode == null || template.ownerDocument.window == null) {
340 close(); 340 close();
341 // TODO(jmesserly): MDV calls templateIteratorTable.delete(this) here, 341 // TODO(jmesserly): MDV calls templateIteratorTable.delete(this) here,
342 // but I think that's a no-op because only nodes are used as keys. 342 // but I think that's a no-op because only nodes are used as keys.
343 // See https://github.com/Polymer/mdv/pull/114. 343 // See https://github.com/Polymer/mdv/pull/114.
344 return; 344 return;
345 } 345 }
346 346
347 var instanceCache = new HashMap(equals: identical); 347 var instanceCache = new HashMap(equals: identical);
348 var removeDelta = 0; 348 var removeDelta = 0;
349 for (var splice in splices) { 349 for (var splice in splices) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 nodeExt._templateIterator = null; 405 nodeExt._templateIterator = null;
406 } 406 }
407 } 407 }
408 408
409 _nodeOrCustom(node).unbindAll(); 409 _nodeOrCustom(node).unbindAll();
410 for (var c = node.firstChild; c != null; c = c.nextNode) { 410 for (var c = node.firstChild; c != null; c = c.nextNode) {
411 _unbindAllRecursively(c); 411 _unbindAllRecursively(c);
412 } 412 }
413 } 413 }
414 } 414 }
OLDNEW
« no previous file with comments | « pkg/mdv/lib/src/input_bindings.dart ('k') | pkg/polymer/lib/src/instance.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698