ae365d94aa
The biggest changes are in pkg:observe where we picked up a lot of optimizations to PathObserver/CompoundObserver. template_binding gets one-time bindings, synchronous expansion, and lightweight "bindable" objects. The tests are heavily refactored to use Future instead of the hacky observeTest/performMicrotaskCheckpoint pattern (I have been slowly changing the style for new tests, but observe-js made the change for all of them. yay!). Oh and the performMC stuff is gone from pkg:observe now. There's also a new pkg:polymer feature for observation, which was ported so we are at a consistent baseline. (http://www.polymer-project.org/polymer.html#observeblock) R=justinfagnani@google.com, sigmund@google.com Review URL: https://codereview.chromium.org//132403010 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32342 260f80e4-7a28-3924-810f-c04153c831b5
28 lines
854 B
Dart
28 lines
854 B
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of template_binding;
|
|
|
|
/** Extensions to the [InputElement] API. */
|
|
class _InputElementExtension extends _ElementExtension {
|
|
_InputElementExtension(InputElement node) : super(node);
|
|
|
|
InputElement get _node => super._node;
|
|
|
|
Bindable bind(String name, value, {bool oneTime: false}) {
|
|
if (name != 'value' && name != 'checked') {
|
|
return super.bind(name, value, oneTime: oneTime);
|
|
}
|
|
|
|
_node.attributes.remove(name);
|
|
if (oneTime) {
|
|
_InputBinding._updateProperty(_node, value, name);
|
|
return null;
|
|
}
|
|
|
|
_self.unbind(name);
|
|
return bindings[name] = new _InputBinding(_node, value, name);
|
|
}
|
|
}
|