Chromium Code Reviews

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11411347: Refine types of EventTarget (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/scripts/generator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:html_common'; 3 import 'dart:html_common';
4 import 'dart:isolate'; 4 import 'dart:isolate';
5 import 'dart:json'; 5 import 'dart:json';
6 import 'dart:svg' as svg; 6 import 'dart:svg' as svg;
7 import 'dart:web_audio' as web_audio; 7 import 'dart:web_audio' as web_audio;
8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9 // for details. All rights reserved. Use of this source code is governed by a 9 // for details. All rights reserved. Use of this source code is governed by a
10 // BSD-style license that can be found in the LICENSE file. 10 // BSD-style license that can be found in the LICENSE file.
(...skipping 5999 matching lines...)
6010 6010
6011 /// @domName DirectoryReaderSync.readEntries; @docsEditable true 6011 /// @domName DirectoryReaderSync.readEntries; @docsEditable true
6012 @Returns('_EntryArraySync') @Creates('_EntryArraySync') 6012 @Returns('_EntryArraySync') @Creates('_EntryArraySync')
6013 List<EntrySync> readEntries() native; 6013 List<EntrySync> readEntries() native;
6014 } 6014 }
6015 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6015 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6016 // for details. All rights reserved. Use of this source code is governed by a 6016 // for details. All rights reserved. Use of this source code is governed by a
6017 // BSD-style license that can be found in the LICENSE file. 6017 // BSD-style license that can be found in the LICENSE file.
6018 6018
6019 6019
6020 /**
6021 * Represents an HTML <div> element.
6022 *
6023 * The [DivElement] is a generic container for content and does not have any
6024 * special significance. It is functionally similar to [SpanElement].
6025 *
6026 * The [DivElement] is a block-level element, as opposed to [SpanElement],
6027 * which is an inline-level element.
6028 *
6029 * Example usage:
6030 *
6031 * DivElement div = new DivElement();
6032 * div.text = 'Here's my new DivElem
6033 * document.body.elements.add(elem);
6034 *
6035 * See also:
6036 *
6037 * * [HTML <div> element](http://www.w3.org/TR/html-markup/div.html) from W3C.
6038 * * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) f rom W3C.
6039 * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
6040 */
6020 /// @domName HTMLDivElement; @docsEditable true 6041 /// @domName HTMLDivElement; @docsEditable true
6021 class DivElement extends Element implements Element native "*HTMLDivElement" { 6042 class DivElement extends Element implements Element native "*HTMLDivElement" {
6022 6043
6023 factory DivElement() => document.$dom_createElement("div"); 6044 factory DivElement() => document.$dom_createElement("div");
6024 } 6045 }
6025 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6046 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6026 // for details. All rights reserved. Use of this source code is governed by a 6047 // for details. All rights reserved. Use of this source code is governed by a
6027 // BSD-style license that can be found in the LICENSE file. 6048 // BSD-style license that can be found in the LICENSE file.
6028 6049
6029 6050
(...skipping 18 matching lines...)
6048 /// @domName Document.body; @docsEditable true 6069 /// @domName Document.body; @docsEditable true
6049 @JSName('body') 6070 @JSName('body')
6050 Element $dom_body; 6071 Element $dom_body;
6051 6072
6052 /// @domName Document.charset; @docsEditable true 6073 /// @domName Document.charset; @docsEditable true
6053 String charset; 6074 String charset;
6054 6075
6055 /// @domName Document.cookie; @docsEditable true 6076 /// @domName Document.cookie; @docsEditable true
6056 String cookie; 6077 String cookie;
6057 6078
6079 /// Returns the [Window] associated with the document.
6058 /// @domName Document.defaultView; @docsEditable true 6080 /// @domName Document.defaultView; @docsEditable true
6059 Window get window => _convertNativeToDart_Window(this._window); 6081 Window get window => _convertNativeToDart_Window(this._window);
6060 @JSName('defaultView') 6082 @JSName('defaultView')
6061 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') 6083 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object')
6062 final dynamic _window; 6084 final dynamic _window;
6063 6085
6064 /// @domName Document.documentElement; @docsEditable true 6086 /// @domName Document.documentElement; @docsEditable true
6065 final Element documentElement; 6087 final Element documentElement;
6066 6088
6067 /// @domName Document.domain; @docsEditable true 6089 /// @domName Document.domain; @docsEditable true
(...skipping 1739 matching lines...)
7807 7829
7808 /// @domName Event.cancelable; @docsEditable true 7830 /// @domName Event.cancelable; @docsEditable true
7809 final bool cancelable; 7831 final bool cancelable;
7810 7832
7811 /// @domName Event.clipboardData; @docsEditable true 7833 /// @domName Event.clipboardData; @docsEditable true
7812 final Clipboard clipboardData; 7834 final Clipboard clipboardData;
7813 7835
7814 /// @domName Event.currentTarget; @docsEditable true 7836 /// @domName Event.currentTarget; @docsEditable true
7815 EventTarget get currentTarget => _convertNativeToDart_EventTarget(this._curren tTarget); 7837 EventTarget get currentTarget => _convertNativeToDart_EventTarget(this._curren tTarget);
7816 @JSName('currentTarget') 7838 @JSName('currentTarget')
7817 @Creates('EventTarget|=Object') @Returns('EventTarget|=Object') 7839 @Creates('Null') @Returns('EventTarget|=Object')
7818 final dynamic _currentTarget; 7840 final dynamic _currentTarget;
7819 7841
7820 /// @domName Event.defaultPrevented; @docsEditable true 7842 /// @domName Event.defaultPrevented; @docsEditable true
7821 final bool defaultPrevented; 7843 final bool defaultPrevented;
7822 7844
7823 /// @domName Event.eventPhase; @docsEditable true 7845 /// @domName Event.eventPhase; @docsEditable true
7824 final int eventPhase; 7846 final int eventPhase;
7825 7847
7826 /// @domName Event.returnValue; @docsEditable true 7848 /// @domName Event.returnValue; @docsEditable true
7827 bool returnValue; 7849 bool returnValue;
7828 7850
7829 /// @domName Event.target; @docsEditable true 7851 /// @domName Event.target; @docsEditable true
7830 EventTarget get target => _convertNativeToDart_EventTarget(this._target); 7852 EventTarget get target => _convertNativeToDart_EventTarget(this._target);
7831 @JSName('target') 7853 @JSName('target')
7832 @Creates('EventTarget|=Object') @Returns('EventTarget|=Object') 7854 @Creates('Node') @Returns('EventTarget|=Object')
7833 final dynamic _target; 7855 final dynamic _target;
7834 7856
7835 /// @domName Event.timeStamp; @docsEditable true 7857 /// @domName Event.timeStamp; @docsEditable true
7836 final int timeStamp; 7858 final int timeStamp;
7837 7859
7838 /// @domName Event.type; @docsEditable true 7860 /// @domName Event.type; @docsEditable true
7839 final String type; 7861 final String type;
7840 7862
7841 /// @domName Event.initEvent; @docsEditable true 7863 /// @domName Event.initEvent; @docsEditable true
7842 @JSName('initEvent') 7864 @JSName('initEvent')
(...skipping 4931 matching lines...)
12774 final int totalJSHeapSize; 12796 final int totalJSHeapSize;
12775 12797
12776 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true 12798 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true
12777 final int usedJSHeapSize; 12799 final int usedJSHeapSize;
12778 } 12800 }
12779 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 12801 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
12780 // for details. All rights reserved. Use of this source code is governed by a 12802 // for details. All rights reserved. Use of this source code is governed by a
12781 // BSD-style license that can be found in the LICENSE file. 12803 // BSD-style license that can be found in the LICENSE file.
12782 12804
12783 12805
12806 /**
12807 * An HTML <menu> element.
12808 *
12809 * A <menu> element represents an unordered list of menu commands.
12810 *
12811 * See also:
12812 *
12813 * * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
12814 * * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-e lement) from the W3C.
12815 */
12784 /// @domName HTMLMenuElement; @docsEditable true 12816 /// @domName HTMLMenuElement; @docsEditable true
12785 class MenuElement extends Element implements Element native "*HTMLMenuElement" { 12817 class MenuElement extends Element implements Element native "*HTMLMenuElement" {
12786 12818
12787 factory MenuElement() => document.$dom_createElement("menu"); 12819 factory MenuElement() => document.$dom_createElement("menu");
12788 } 12820 }
12789 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 12821 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
12790 // for details. All rights reserved. Use of this source code is governed by a 12822 // for details. All rights reserved. Use of this source code is governed by a
12791 // BSD-style license that can be found in the LICENSE file. 12823 // BSD-style license that can be found in the LICENSE file.
12792 12824
12793 12825
(...skipping 222 matching lines...)
13016 13048
13017 /// @domName MouseEvent.fromElement; @docsEditable true 13049 /// @domName MouseEvent.fromElement; @docsEditable true
13018 final Node fromElement; 13050 final Node fromElement;
13019 13051
13020 /// @domName MouseEvent.metaKey; @docsEditable true 13052 /// @domName MouseEvent.metaKey; @docsEditable true
13021 final bool metaKey; 13053 final bool metaKey;
13022 13054
13023 /// @domName MouseEvent.relatedTarget; @docsEditable true 13055 /// @domName MouseEvent.relatedTarget; @docsEditable true
13024 EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._relate dTarget); 13056 EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._relate dTarget);
13025 @JSName('relatedTarget') 13057 @JSName('relatedTarget')
13026 @Creates('EventTarget|=Object') @Returns('EventTarget|=Object') 13058 @Creates('Node') @Returns('EventTarget|=Object')
13027 final dynamic _relatedTarget; 13059 final dynamic _relatedTarget;
13028 13060
13029 /// @domName MouseEvent.screenX; @docsEditable true 13061 /// @domName MouseEvent.screenX; @docsEditable true
13030 final int screenX; 13062 final int screenX;
13031 13063
13032 /// @domName MouseEvent.screenY; @docsEditable true 13064 /// @domName MouseEvent.screenY; @docsEditable true
13033 final int screenY; 13065 final int screenY;
13034 13066
13035 /// @domName MouseEvent.shiftKey; @docsEditable true 13067 /// @domName MouseEvent.shiftKey; @docsEditable true
13036 final bool shiftKey; 13068 final bool shiftKey;
(...skipping 4378 matching lines...)
17415 17447
17416 /// @domName Touch.screenX; @docsEditable true 17448 /// @domName Touch.screenX; @docsEditable true
17417 final int screenX; 17449 final int screenX;
17418 17450
17419 /// @domName Touch.screenY; @docsEditable true 17451 /// @domName Touch.screenY; @docsEditable true
17420 final int screenY; 17452 final int screenY;
17421 17453
17422 /// @domName Touch.target; @docsEditable true 17454 /// @domName Touch.target; @docsEditable true
17423 EventTarget get target => _convertNativeToDart_EventTarget(this._target); 17455 EventTarget get target => _convertNativeToDart_EventTarget(this._target);
17424 @JSName('target') 17456 @JSName('target')
17425 @Creates('EventTarget|=Object') @Returns('EventTarget|=Object') 17457 @Creates('Element|Document') @Returns('Element|Document')
17426 final dynamic _target; 17458 final dynamic _target;
17427 17459
17428 /// @domName Touch.webkitForce; @docsEditable true 17460 /// @domName Touch.webkitForce; @docsEditable true
17429 final num webkitForce; 17461 final num webkitForce;
17430 17462
17431 /// @domName Touch.webkitRadiusX; @docsEditable true 17463 /// @domName Touch.webkitRadiusX; @docsEditable true
17432 final int webkitRadiusX; 17464 final int webkitRadiusX;
17433 17465
17434 /// @domName Touch.webkitRadiusY; @docsEditable true 17466 /// @domName Touch.webkitRadiusY; @docsEditable true
17435 final int webkitRadiusY; 17467 final int webkitRadiusY;
(...skipping 7620 matching lines...)
25056 if (length < 0) throw new ArgumentError('length'); 25088 if (length < 0) throw new ArgumentError('length');
25057 if (start < 0) throw new RangeError.value(start); 25089 if (start < 0) throw new RangeError.value(start);
25058 int end = start + length; 25090 int end = start + length;
25059 if (end > a.length) throw new RangeError.value(end); 25091 if (end > a.length) throw new RangeError.value(end);
25060 for (int i = start; i < end; i++) { 25092 for (int i = start; i < end; i++) {
25061 accumulator.add(a[i]); 25093 accumulator.add(a[i]);
25062 } 25094 }
25063 return accumulator; 25095 return accumulator;
25064 } 25096 }
25065 } 25097 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine