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

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

Issue 1391353002: Dartium typed js interop work dart repo side of the change. Also tries to get (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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 @DocsEditable() 7 @DocsEditable()
8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends Node 8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends Node
9 { 9 {
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (typeExtension == null) { 67 if (typeExtension == null) {
68 return _createElement_2(tagName); 68 return _createElement_2(tagName);
69 } else { 69 } else {
70 return _createElement(tagName, typeExtension); 70 return _createElement(tagName, typeExtension);
71 } 71 }
72 $else 72 $else
73 var newElement = (typeExtension == null) ? 73 var newElement = (typeExtension == null) ?
74 _blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) : 74 _blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) :
75 _blink.BlinkDocument.instance.createElement_Callback_2_(unwrap_jso(this), tagName, typeExtension); 75 _blink.BlinkDocument.instance.createElement_Callback_2_(unwrap_jso(this), tagName, typeExtension);
76 76
77 var wrapped; 77 var wrapped = js.getDartHtmlWrapperFor(newElement); // Here's our Dart clas s.
78 78 if (wrapped != null) {
79 if (newElement['dart_class'] != null) {
80 wrapped = newElement['dart_class']; // Here's our Dart class.
81 wrapped.blink_jsObject = newElement; 79 wrapped.blink_jsObject = newElement;
82 } else { 80 } else {
83 wrapped = wrap_jso(newElement); 81 wrapped = wrap_jso(newElement);
84 if (wrapped == null) { 82 if (wrapped == null) {
85 wrapped = wrap_jso_custom_element(newElement); 83 wrapped = wrap_jso_custom_element(newElement);
86 } else { 84 } else {
87 wrapped.blink_jsObject['dart_class'] = wrapped; 85 js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped);
88 } 86 }
89 } 87 }
90 88
91 return wrapped; 89 return wrapped;
92 $endif 90 $endif
93 } 91 }
94 92
95 $if DART2JS 93 $if DART2JS
96 // The two-argument version of this is automatically generated, but we need to 94 // The two-argument version of this is automatically generated, but we need to
97 // omit the typeExtension if it's null on Firefox or we get an is="null" attri bute. 95 // omit the typeExtension if it's null on Firefox or we get an is="null" attri bute.
(...skipping 16 matching lines...) Expand all
114 } else { 112 } else {
115 return _createElementNS(namespaceURI, qualifiedName, typeExtension); 113 return _createElementNS(namespaceURI, qualifiedName, typeExtension);
116 } 114 }
117 $else 115 $else
118 var newElement = (typeExtension == null) ? 116 var newElement = (typeExtension == null) ?
119 _blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this) , namespaceURI, qualifiedName) : 117 _blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this) , namespaceURI, qualifiedName) :
120 _blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this) , namespaceURI, qualifiedName, typeExtension); 118 _blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this) , namespaceURI, qualifiedName, typeExtension);
121 119
122 var wrapped; 120 var wrapped;
123 121
124 if (newElement['dart_class'] != null) { 122 wrapped = js.getDartHtmlWrapperFor(newElement); // Here's our Dart class.
125 wrapped = newElement['dart_class']; // Here's our Dart class. 123 if (wrapped != null) {
126 wrapped.blink_jsObject = newElement; 124 wrapped.blink_jsObject = newElement;
127 } else { 125 } else {
128 wrapped = wrap_jso(newElement); 126 wrapped = wrap_jso(newElement);
129 if (wrapped == null) { 127 if (wrapped == null) {
130 wrapped = wrap_jso_custom_element(newElement); 128 wrapped = wrap_jso_custom_element(newElement);
131 } else { 129 } else {
132 wrapped.blink_jsObject['dart_class'] = wrapped; 130 js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped); // Here's ou r Dart class.
133 } 131 }
134 } 132 }
135 133
136 return wrapped; 134 return wrapped;
137 $endif 135 $endif
138 } 136 }
139 137
140 $if DART2JS 138 $if DART2JS
141 @DomName('Document.createNodeIterator') 139 @DomName('Document.createNodeIterator')
142 NodeIterator _createNodeIterator(Node root, 140 NodeIterator _createNodeIterator(Node root,
143 [int whatToShow, NodeFilter filter]) 141 [int whatToShow, NodeFilter filter])
144 => JS('NodeIterator', '#.createNodeIterator(#, #, #, false)', 142 => JS('NodeIterator', '#.createNodeIterator(#, #, #, false)',
145 this, root, whatToShow, filter); 143 this, root, whatToShow, filter);
146 144
147 @DomName('Document.createTreeWalker') 145 @DomName('Document.createTreeWalker')
148 TreeWalker _createTreeWalker(Node root, 146 TreeWalker _createTreeWalker(Node root,
149 [int whatToShow, NodeFilter filter]) 147 [int whatToShow, NodeFilter filter])
150 => JS('TreeWalker', '#.createTreeWalker(#, #, #, false)', 148 => JS('TreeWalker', '#.createTreeWalker(#, #, #, false)',
151 this, root, whatToShow, filter); 149 this, root, whatToShow, filter);
152 $endif 150 $endif
153 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698