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

Side by Side Diff: tools/dom/templates/html/dartium/html_dartium.darttemplate

Issue 1392723003: Switch dart:html objects not to be NativeFieldWrapper subclasses with JsInterop (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 // DO NOT EDIT 5 // DO NOT EDIT
6 // Auto-generated dart:html library. 6 // Auto-generated dart:html library.
7 7
8 /** 8 /**
9 * HTML elements and other resources for web-based applications that need to 9 * HTML elements and other resources for web-based applications that need to
10 * interact with the browser and the DOM (Document Object Model). 10 * interact with the browser and the DOM (Document Object Model).
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // List of known tagName to DartClass for custom elements, used for upgrade. 354 // List of known tagName to DartClass for custom elements, used for upgrade.
355 var _knownCustomeElements = new Map<String, Type>(); 355 var _knownCustomeElements = new Map<String, Type>();
356 356
357 Rectangle make_dart_rectangle(r) => 357 Rectangle make_dart_rectangle(r) =>
358 r == null ? null : new Rectangle( 358 r == null ? null : new Rectangle(
359 js.JsNative.getProperty(r, 'left'), 359 js.JsNative.getProperty(r, 'left'),
360 js.JsNative.getProperty(r, 'top'), 360 js.JsNative.getProperty(r, 'top'),
361 js.JsNative.getProperty(r, 'width'), 361 js.JsNative.getProperty(r, 'width'),
362 js.JsNative.getProperty(r, 'height')); 362 js.JsNative.getProperty(r, 'height'));
363 363
364 // Need a default constructor for constructing classes with mixins that are 364 /// An abstract class for all DOM objects we wrap in dart:html and related
365 // also extending NativeFieldWrapperClass2. Defining JsoNativeFieldWrapper 365 /// libraries.
366 // extending NativeFieldWrapperClass2 creates a default constructor. 366 class DartHtmlDomObject {
367 class JsoNativeFieldWrapper extends NativeFieldWrapperClass2 {} 367
368 /// The underlying JS DOM object.
369 js.JsObject blink_jsObject;
370
371 }
368 372
369 // Flag to disable JS interop asserts. Setting to false will speed up the 373 // Flag to disable JS interop asserts. Setting to false will speed up the
370 // wrap_jso calls. 374 // wrap_jso calls.
371 bool __interop_checks = true; 375 bool __interop_checks = true;
372 376
373 /** Expando for JsObject, used by every Dart class associated with a Javascript 377 /** Expando for JsObject, used by every Dart class associated with a Javascript
374 * class (e.g., DOM, WebAudio, etc.). 378 * class (e.g., DOM, WebAudio, etc.).
375 */ 379 */
376 380
377 /** 381 /**
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 createCustomUpgrader(Type customElementClass, $this) { 683 createCustomUpgrader(Type customElementClass, $this) {
680 var dartClass; 684 var dartClass;
681 try { 685 try {
682 dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this); 686 dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
683 } catch (e) { 687 } catch (e) {
684 dartClass.badUpgrade(); 688 dartClass.badUpgrade();
685 throw e; 689 throw e;
686 } finally { 690 } finally {
687 // Need to remember the Dart class that was created for this custom so 691 // Need to remember the Dart class that was created for this custom so
688 // return it and setup the blink_jsObject to the $this that we'll be working 692 // return it and setup the blink_jsObject to the $this that we'll be working
689 // with as we talk to blink. 693 // with as we talk to blink.
690 js.setDartHtmlWrapperFor($this, dartClass); 694 js.setDartHtmlWrapperFor($this, dartClass);
691 } 695 }
692 696
693 return dartClass; 697 return dartClass;
694 } 698 }
695 699
696 $else 700 $else
697 class JsoNativeFieldWrapper extends NativeFieldWrapperClass2 {} 701 class DartHtmlDomObject extends NativeFieldWrapperClass2 {}
698 702
699 unwrap_jso(dartClass_instance) => dartClass_instance; 703 unwrap_jso(dartClass_instance) => dartClass_instance;
700 wrap_jso(jsObject) => jsObject; 704 wrap_jso(jsObject) => jsObject;
701 make_dart_rectangle(r) => r; 705 make_dart_rectangle(r) => r;
702 convertDartToNative_Dictionary(Map dict) => dict; 706 convertDartToNative_Dictionary(Map dict) => dict;
703 List convertDartToNative_StringArray(List<String> input) => input; 707 List convertDartToNative_StringArray(List<String> input) => input;
704 convertDartToNative_List(List input) => input; 708 convertDartToNative_List(List input) => input;
705 createCustomUpgrader(Type customElementClass, $this) => $this; 709 createCustomUpgrader(Type customElementClass, $this) => $this;
706 710
707 $endif 711 $endif
OLDNEW
« no previous file with comments | « tools/dom/src/native_DOMImplementation.dart ('k') | tools/dom/templates/html/dartium/svg_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698