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

Unified Diff: tools/dom/templates/html/impl/impl_Document.darttemplate

Issue 1321613005: Dartium w/ JsInterop enabled (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: tools/dom/templates/html/impl/impl_Document.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate
index a9b19cf4467bf05c724769ca39c45bd358c9411f..ea3d901ead81f51ff56c446b24a75b4f275b750a 100644
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate
@@ -26,11 +26,7 @@ $!MEMBERS
* [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
ElementList<Element> querySelectorAll(String selectors) {
-$if JSINTEROP
- return _querySelectorAll(selectors);
-$else
return new _FrozenElementList._wrap(_querySelectorAll(selectors));
-$endif
}
/**
@@ -70,16 +66,49 @@ $endif
$if DART2JS
return _createElement(tagName, typeExtension);
$else
- $if JSINTEROP
- return _createElement(tagName, typeExtension);
- $else
- if (typeExtension != null) {
- return _createElement(tagName, typeExtension);
- } else {
- // Fast-path for Dartium when typeExtension is not needed.
- return _Utils.createElement(this, tagName);
- }
- $endif
+ var newElement = (typeExtension == null) ?
+ _blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) :
+ _blink.BlinkDocument.instance.createElement_Callback_2_(unwrap_jso(this), tagName, typeExtension);
+
+ var wrapped;
+
+ if (newElement['dart_class'] != null) {
+ wrapped = newElement['dart_class']; // Here's our Dart class.
+ wrapped.blink_jsObject = newElement;
+ } else {
+ wrapped = wrap_jso(newElement);
+ if (wrapped == null) {
+ wrapped = wrap_jso_custom_element(newElement);
+ }
+ }
+
+ return wrapped;
+$endif
+ }
+
+ @DomName('Document.createElementNS')
+ @DocsEditable()
+ Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
+$if DART2JS
+ return _createElementNS(tagName, qualifiedName, typeExtension);
+$else
+ var newElement = (typeExtension == null) ?
+ _blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this), namespaceURI, qualifiedName) :
+ _blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension);
+
+ var wrapped;
+
+ if (newElement['dart_class'] != null) {
+ wrapped = newElement['dart_class']; // Here's our Dart class.
+ wrapped.blink_jsObject = newElement;
+ } else {
+ wrapped = wrap_jso(newElement);
+ if (wrapped == null) {
+ wrapped = wrap_jso_custom_element(newElement);
+ }
+ }
+
+ return wrapped;
$endif
}

Powered by Google App Engine
This is Rietveld 408576698