OLD | NEW |
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 dart.dom.html; | 5 part of dart.dom.html; |
6 | 6 |
7 _callConstructor(constructor, interceptor) { | 7 _callConstructor(constructor, interceptor) { |
8 return (receiver) { | 8 return (receiver) { |
9 setNativeSubclassDispatchRecord(receiver, interceptor); | 9 setNativeSubclassDispatchRecord(receiver, interceptor); |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 JS('void', '#.attributeChangedCallback = #', properties, | 106 JS('void', '#.attributeChangedCallback = #', properties, |
107 JS('=Object', '{value: #}', _makeCallbackMethod3(_callAttributeChanged))); | 107 JS('=Object', '{value: #}', _makeCallbackMethod3(_callAttributeChanged))); |
108 | 108 |
109 var baseProto = JS('=Object', '#.prototype', baseConstructor); | 109 var baseProto = JS('=Object', '#.prototype', baseConstructor); |
110 var proto = JS('=Object', 'Object.create(#, #)', baseProto, properties); | 110 var proto = JS('=Object', 'Object.create(#, #)', baseProto, properties); |
111 | 111 |
112 setNativeSubclassDispatchRecord(proto, interceptor); | 112 setNativeSubclassDispatchRecord(proto, interceptor); |
113 | 113 |
114 var options = JS('=Object', '{prototype: #}', proto); | 114 var options = JS('=Object', '{prototype: #}', proto); |
115 | 115 |
116 if (baseClassName != 'HTMLElement') { | 116 if (extendsTagName != null) { |
117 if (extendsTagName != null) { | 117 JS('=Object', '#.extends = #', options, extendsTagName); |
118 JS('=Object', '#.extends = #', options, extendsTagName); | |
119 } | |
120 } | 118 } |
121 | 119 |
122 JS('void', '#.register(#, #)', document, tag, options); | 120 JS('void', '#.register(#, #)', document, tag, options); |
123 } | 121 } |
124 | 122 |
125 //// Called by Element.created to do validation & initialization. | 123 //// Called by Element.created to do validation & initialization. |
126 void _initializeCustomElement(Element e) { | 124 void _initializeCustomElement(Element e) { |
127 // TODO(blois): Add validation that this is only in response to an upgrade. | 125 // TODO(blois): Add validation that this is only in response to an upgrade. |
128 } | 126 } |
OLD | NEW |