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

Side by Side Diff: tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate

Issue 14732003: Implement Model-Driven-Views spec for Dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: trying upload again Created 7 years, 7 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS implements 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS implements
8 HiddenInputElement, 8 HiddenInputElement,
9 SearchInputElement, 9 SearchInputElement,
10 TextInputElement, 10 TextInputElement,
(...skipping 20 matching lines...) Expand all
31 factory InputElement({String type}) { 31 factory InputElement({String type}) {
32 var e = document.$dom_createElement("input"); 32 var e = document.$dom_createElement("input");
33 if (type != null) { 33 if (type != null) {
34 try { 34 try {
35 // IE throws an exception for unknown types. 35 // IE throws an exception for unknown types.
36 e.type = type; 36 e.type = type;
37 } catch(_) {} 37 } catch(_) {}
38 } 38 }
39 return e; 39 return e;
40 } 40 }
41
42 _ValueBinding _valueBinding;
43 _CheckedBinding _checkedBinding;
blois 2013/05/01 17:00:42 valueAsNumber and valueAsDate in the future? Or sh
Jennifer Messerly 2013/05/01 17:56:34 yeah, type conversion or filters or something for
44
45 @Experimental
46 void bind(String name, model, String path) {
47 switch (name) {
48 case 'value':
49 unbind('value');
50 attributes.remove('value');
51 _valueBinding = new _ValueBinding(this, model, path);
52 break;
53 case 'checked':
54 unbind('checked');
55 attributes.remove('checked');
56 _checkedBinding = new _CheckedBinding(this, model, path);
57 break;
58 default:
59 super.bind(name, model, path);
60 break;
61 }
62 }
63
64 @Experimental
65 void unbind(String name) {
66 switch (name) {
67 case 'value':
68 if (_valueBinding != null) {
69 _valueBinding.unbind();
70 _valueBinding = null;
71 }
72 break;
73 case 'checked':
74 if (_checkedBinding != null) {
75 _checkedBinding.unbind();
76 _checkedBinding = null;
77 }
78 break;
79 default:
80 super.unbind(name);
81 break;
82 }
83 }
84
85 @Experimental
86 void unbindAll() {
87 unbind('value');
88 unbind('checked');
89 super.unbindAll();
90 }
91
41 $!MEMBERS 92 $!MEMBERS
42 } 93 }
43 94
44 95
45 // Interfaces representing the InputElement APIs which are supported 96 // Interfaces representing the InputElement APIs which are supported
46 // for the various types of InputElement. 97 // for the various types of InputElement.
47 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element. 98 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element.
48 99
49 /** 100 /**
50 * Exposes the functionality common between all InputElement types. 101 * Exposes the functionality common between all InputElement types.
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 factory ResetButtonInputElement() => new InputElement(type: 'reset'); 640 factory ResetButtonInputElement() => new InputElement(type: 'reset');
590 } 641 }
591 642
592 /** 643 /**
593 * A button, with no default behavior. 644 * A button, with no default behavior.
594 */ 645 */
595 abstract class ButtonInputElement implements InputElementBase { 646 abstract class ButtonInputElement implements InputElementBase {
596 factory ButtonInputElement() => new InputElement(type: 'button'); 647 factory ButtonInputElement() => new InputElement(type: 'button');
597 } 648 }
598 649
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698