OLD | NEW |
1 library html; | 1 library html; |
2 | 2 |
3 import 'dart:collection'; | 3 import 'dart:collection'; |
4 import 'dart:html_common'; | 4 import 'dart:html_common'; |
5 import 'dart:indexed_db'; | 5 import 'dart:indexed_db'; |
6 import 'dart:isolate'; | 6 import 'dart:isolate'; |
7 import 'dart:json'; | 7 import 'dart:json'; |
8 import 'dart:svg' as svg; | 8 import 'dart:svg' as svg; |
9 import 'dart:web_audio' as web_audio; | 9 import 'dart:web_audio' as web_audio; |
10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 class CanvasElement extends Element native "*HTMLCanvasElement" { | 778 class CanvasElement extends Element native "*HTMLCanvasElement" { |
779 | 779 |
780 ///@docsEditable true | 780 ///@docsEditable true |
781 factory CanvasElement({int width, int height}) { | 781 factory CanvasElement({int width, int height}) { |
782 var e = document.$dom_createElement("canvas"); | 782 var e = document.$dom_createElement("canvas"); |
783 if (width != null) e.width = width; | 783 if (width != null) e.width = width; |
784 if (height != null) e.height = height; | 784 if (height != null) e.height = height; |
785 return e; | 785 return e; |
786 } | 786 } |
787 | 787 |
| 788 /// The height of this canvas element in CSS pixels. |
788 /// @domName HTMLCanvasElement.height; @docsEditable true | 789 /// @domName HTMLCanvasElement.height; @docsEditable true |
789 int height; | 790 int height; |
790 | 791 |
| 792 /// The width of this canvas element in CSS pixels. |
791 /// @domName HTMLCanvasElement.width; @docsEditable true | 793 /// @domName HTMLCanvasElement.width; @docsEditable true |
792 int width; | 794 int width; |
793 | 795 |
| 796 /** |
| 797 * Returns a data URI containing a representation of the image in the |
| 798 * format specified by type (defaults to 'image/png'). |
| 799 * |
| 800 * Data Uri format is as follow `data:[<MIME-type>][;charset=<encoding>][;base
64],<data>` |
| 801 * |
| 802 * Optional parameter [quality] in the range of 0.0 and 1.0 can be used when r
equesting [type] |
| 803 * 'image/jpeg' or 'image/webp'. If [quality] is not passed the default |
| 804 * value is used. Note: the default value varies by browser. |
| 805 * |
| 806 * If the height or width of this canvas element is 0, then 'data:' is returne
d, |
| 807 * representing no data. |
| 808 * |
| 809 * If the type requested is not 'image/png', and the returned value is |
| 810 * 'data:image/png', then the requested type is not supported. |
| 811 * |
| 812 * Example usage: |
| 813 * |
| 814 * CanvasElement canvas = new CanvasElement(); |
| 815 * var ctx = canvas.context2d |
| 816 * ..fillStyle = "rgb(200,0,0)" |
| 817 * ..fillRect(10, 10, 55, 50); |
| 818 * var dataUrl = canvas.toDataURL("image/jpeg", 0.95); |
| 819 * // The Data Uri would look similar to |
| 820 * // 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA |
| 821 * // AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO |
| 822 * // 9TXL0Y4OHwAAAABJRU5ErkJggg==' |
| 823 * //Create a new image element from the data URI. |
| 824 * var img = new ImageElement(); |
| 825 * img.src = dataUrl; |
| 826 * document.body.children.add(img); |
| 827 * |
| 828 * See also: |
| 829 * |
| 830 * * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wiki
pedia. |
| 831 * |
| 832 * * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanv
asElement) from MDN. |
| 833 * |
| 834 * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canv
as-todataurl) from W3C. |
| 835 */ |
794 /// @domName HTMLCanvasElement.toDataURL; @docsEditable true | 836 /// @domName HTMLCanvasElement.toDataURL; @docsEditable true |
795 @JSName('toDataURL') | 837 @JSName('toDataURL') |
796 String toDataUrl(String type, [num quality]) native; | 838 String toDataUrl(String type, [num quality]) native; |
797 | 839 |
798 | 840 |
799 CanvasRenderingContext getContext(String contextId) native; | 841 CanvasRenderingContext getContext(String contextId) native; |
800 CanvasRenderingContext2D get context2d => getContext('2d'); | 842 CanvasRenderingContext2D get context2d => getContext('2d'); |
801 } | 843 } |
802 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 844 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
803 // for details. All rights reserved. Use of this source code is governed by a | 845 // for details. All rights reserved. Use of this source code is governed by a |
804 // BSD-style license that can be found in the LICENSE file. | 846 // BSD-style license that can be found in the LICENSE file. |
805 | 847 |
806 | 848 |
| 849 /** |
| 850 * An opaque canvas object representing a gradient. |
| 851 * |
| 852 * Created by calling [createLinearGradient] or [createRadialGradient] on a |
| 853 * [CanvasRenderingContext2D] object. |
| 854 * |
| 855 * Example usage: |
| 856 * |
| 857 * var canvas = new CanvasElement(width: 600, height: 600); |
| 858 * var ctx = canvas.context2d; |
| 859 * ctx.clearRect(0, 0, 600, 600); |
| 860 * ctx.save(); |
| 861 * // Create radial gradient. |
| 862 * CanvasGradient gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, 600); |
| 863 * gradient.addColorStop(0, '#000'); |
| 864 * gradient.addColorStop(1, 'rgb(255, 255, 255)'); |
| 865 * // Assign gradients to fill. |
| 866 * ctx.fillStyle = gradient; |
| 867 * // Draw a rectangle with a gradient fill. |
| 868 * ctx.fillRect(0, 0, 600, 600); |
| 869 * ctx.save(); |
| 870 * document.body.children.add(canvas); |
| 871 * |
| 872 * See also: |
| 873 * |
| 874 * * [CanvasGradient](https://developer.mozilla.org/en-US/docs/DOM/CanvasGradien
t) from MDN. |
| 875 * * [CanvasGradient](http://www.whatwg.org/specs/web-apps/current-work/multipag
e/the-canvas-element.html#canvasgradient) from whatwg. |
| 876 * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgra
dient) from W3C. |
| 877 */ |
807 /// @domName CanvasGradient; @docsEditable true | 878 /// @domName CanvasGradient; @docsEditable true |
808 class CanvasGradient native "*CanvasGradient" { | 879 class CanvasGradient native "*CanvasGradient" { |
809 | 880 |
| 881 /** |
| 882 * Adds a color stop to this gradient at the offset. |
| 883 * |
| 884 * The [offset] can range between 0.0 and 1.0. |
| 885 * |
| 886 * See also: |
| 887 * |
| 888 * * [Multiple Color Stops](https://developer.mozilla.org/en-US/docs/CSS/linea
r-gradient#Gradient_with_multiple_color_stops) from MDN. |
| 889 */ |
810 /// @domName CanvasGradient.addColorStop; @docsEditable true | 890 /// @domName CanvasGradient.addColorStop; @docsEditable true |
811 void addColorStop(num offset, String color) native; | 891 void addColorStop(num offset, String color) native; |
812 } | 892 } |
813 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 893 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
814 // for details. All rights reserved. Use of this source code is governed by a | 894 // for details. All rights reserved. Use of this source code is governed by a |
815 // BSD-style license that can be found in the LICENSE file. | 895 // BSD-style license that can be found in the LICENSE file. |
816 | 896 |
817 | 897 |
| 898 /** |
| 899 * An opaque object representing a pattern of image, canvas, or video. |
| 900 * |
| 901 * Created by calling [createPattern] on a [CanvasRenderingContext2D] object. |
| 902 * |
| 903 * Example usage: |
| 904 * |
| 905 * var canvas = new CanvasElement(width: 600, height: 600); |
| 906 * var ctx = canvas.context2d; |
| 907 * var img = new ImageElement(); |
| 908 * // Image src needs to be loaded before pattern is applied. |
| 909 * img.on.load.add((event) { |
| 910 * // When the image is loaded, create a pattern |
| 911 * // from the ImageElement. |
| 912 * CanvasPattern pattern = ctx.createPattern(img, 'repeat'); |
| 913 * ctx.rect(0, 0, canvas.width, canvas.height); |
| 914 * ctx.fillStyle = pattern; |
| 915 * ctx.fill(); |
| 916 * }); |
| 917 * img.src = "images/foo.jpg"; |
| 918 * document.body.children.add(canvas); |
| 919 * |
| 920 * See also: |
| 921 * * [CanvasPattern](https://developer.mozilla.org/en-US/docs/DOM/CanvasPattern)
from MDN. |
| 922 * * [CanvasPattern](http://www.whatwg.org/specs/web-apps/current-work/multipage
/the-canvas-element.html#canvaspattern) from whatwg. |
| 923 * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspatt
ern) from W3C. |
| 924 */ |
818 /// @domName CanvasPattern; @docsEditable true | 925 /// @domName CanvasPattern; @docsEditable true |
819 class CanvasPattern native "*CanvasPattern" { | 926 class CanvasPattern native "*CanvasPattern" { |
820 } | 927 } |
821 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 928 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
822 // for details. All rights reserved. Use of this source code is governed by a | 929 // for details. All rights reserved. Use of this source code is governed by a |
823 // BSD-style license that can be found in the LICENSE file. | 930 // BSD-style license that can be found in the LICENSE file. |
824 | 931 |
825 | 932 |
| 933 /** |
| 934 * A rendering context for a canvas element. |
| 935 * |
| 936 * This context is extended by [CanvasRenderingContext2D] and |
| 937 * [WebGLRenderingContext]. |
| 938 */ |
826 /// @domName CanvasRenderingContext; @docsEditable true | 939 /// @domName CanvasRenderingContext; @docsEditable true |
827 class CanvasRenderingContext native "*CanvasRenderingContext" { | 940 class CanvasRenderingContext native "*CanvasRenderingContext" { |
828 | 941 |
| 942 /// Reference to the canvas element to which this context belongs. |
829 /// @domName CanvasRenderingContext.canvas; @docsEditable true | 943 /// @domName CanvasRenderingContext.canvas; @docsEditable true |
830 final CanvasElement canvas; | 944 final CanvasElement canvas; |
831 } | 945 } |
832 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 946 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
833 // for details. All rights reserved. Use of this source code is governed by a | 947 // for details. All rights reserved. Use of this source code is governed by a |
834 // BSD-style license that can be found in the LICENSE file. | 948 // BSD-style license that can be found in the LICENSE file. |
835 | 949 |
836 | 950 |
837 /// @domName CanvasRenderingContext2D | 951 /// @domName CanvasRenderingContext2D |
838 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen
deringContext2D" { | 952 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen
deringContext2D" { |
(...skipping 4739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5578 | 5692 |
5579 /// @domName DirectoryReaderSync.readEntries; @docsEditable true | 5693 /// @domName DirectoryReaderSync.readEntries; @docsEditable true |
5580 @Returns('_EntryArraySync') @Creates('_EntryArraySync') | 5694 @Returns('_EntryArraySync') @Creates('_EntryArraySync') |
5581 List<EntrySync> readEntries() native; | 5695 List<EntrySync> readEntries() native; |
5582 } | 5696 } |
5583 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 5697 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
5584 // for details. All rights reserved. Use of this source code is governed by a | 5698 // for details. All rights reserved. Use of this source code is governed by a |
5585 // BSD-style license that can be found in the LICENSE file. | 5699 // BSD-style license that can be found in the LICENSE file. |
5586 | 5700 |
5587 | 5701 |
| 5702 /** |
| 5703 * Represents an HTML <div> element. |
| 5704 * |
| 5705 * The [DivElement] is a generic container for content and does not have any |
| 5706 * special significance. It is functionally similar to [SpanElement]. |
| 5707 * |
| 5708 * The [DivElement] is a block-level element, as opposed to [SpanElement], |
| 5709 * which is an inline-level element. |
| 5710 * |
| 5711 * Example usage: |
| 5712 * |
| 5713 * DivElement div = new DivElement(); |
| 5714 * div.text = 'Here's my new DivElem |
| 5715 * document.body.elements.add(elem); |
| 5716 * |
| 5717 * See also: |
| 5718 * |
| 5719 * * [HTML <div> element](http://www.w3.org/TR/html-markup/div.html) from W3C. |
| 5720 * * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) f
rom W3C. |
| 5721 * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes)
from W3C. |
| 5722 */ |
5588 /// @domName HTMLDivElement; @docsEditable true | 5723 /// @domName HTMLDivElement; @docsEditable true |
5589 class DivElement extends Element native "*HTMLDivElement" { | 5724 class DivElement extends Element native "*HTMLDivElement" { |
5590 | 5725 |
5591 ///@docsEditable true | 5726 ///@docsEditable true |
5592 factory DivElement() => document.$dom_createElement("div"); | 5727 factory DivElement() => document.$dom_createElement("div"); |
5593 } | 5728 } |
5594 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 5729 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
5595 // for details. All rights reserved. Use of this source code is governed by a | 5730 // for details. All rights reserved. Use of this source code is governed by a |
5596 // BSD-style license that can be found in the LICENSE file. | 5731 // BSD-style license that can be found in the LICENSE file. |
5597 | 5732 |
5598 | 5733 |
5599 /// @domName Document | 5734 /// @domName Document |
5600 /** | 5735 /** |
5601 * The base class for all documents. | 5736 * The base class for all documents. |
5602 * | 5737 * |
5603 * Each web page loaded in the browser has its own [Document] object, which is | 5738 * Each web page loaded in the browser has its own [Document] object, which is |
5604 * typically an [HtmlDocument]. | 5739 * typically an [HtmlDocument]. |
5605 * | 5740 * |
5606 * If you aren't comfortable with DOM concepts, see the Dart tutorial | 5741 * If you aren't comfortable with DOM concepts, see the Dart tutorial |
5607 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec
t-dart-html/). | 5742 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec
t-dart-html/). |
5608 */ | 5743 */ |
5609 class Document extends Node native "*Document" | 5744 class Document extends Node native "*Document" |
5610 { | 5745 { |
5611 | 5746 |
5612 | 5747 |
5613 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | 5748 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
5614 DocumentEvents get on => | 5749 DocumentEvents get on => |
5615 new DocumentEvents(this); | 5750 new DocumentEvents(this); |
5616 | 5751 |
| 5752 /// Moved to [HtmlDocument]. |
5617 /// @domName Document.body; @docsEditable true | 5753 /// @domName Document.body; @docsEditable true |
5618 @JSName('body') | 5754 @JSName('body') |
5619 Element $dom_body; | 5755 Element $dom_body; |
5620 | 5756 |
5621 /// @domName Document.charset; @docsEditable true | 5757 /// @domName Document.charset; @docsEditable true |
5622 String charset; | 5758 String charset; |
5623 | 5759 |
5624 /// @domName Document.cookie; @docsEditable true | 5760 /// @domName Document.cookie; @docsEditable true |
5625 String cookie; | 5761 String cookie; |
5626 | 5762 |
| 5763 /// Returns the [Window] associated with the document. |
5627 /// @domName Document.defaultView; @docsEditable true | 5764 /// @domName Document.defaultView; @docsEditable true |
5628 Window get window => _convertNativeToDart_Window(this._window); | 5765 Window get window => _convertNativeToDart_Window(this._window); |
5629 @JSName('defaultView') | 5766 @JSName('defaultView') |
5630 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 5767 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') |
5631 final dynamic _window; | 5768 final dynamic _window; |
5632 | 5769 |
5633 /// @domName Document.documentElement; @docsEditable true | 5770 /// @domName Document.documentElement; @docsEditable true |
5634 final Element documentElement; | 5771 final Element documentElement; |
5635 | 5772 |
5636 /// @domName Document.domain; @docsEditable true | 5773 /// @domName Document.domain; @docsEditable true |
5637 final String domain; | 5774 final String domain; |
5638 | 5775 |
| 5776 /// Moved to [HtmlDocument]. |
5639 /// @domName Document.head; @docsEditable true | 5777 /// @domName Document.head; @docsEditable true |
5640 @JSName('head') | 5778 @JSName('head') |
5641 final HeadElement $dom_head; | 5779 final HeadElement $dom_head; |
5642 | 5780 |
5643 /// @domName Document.implementation; @docsEditable true | 5781 /// @domName Document.implementation; @docsEditable true |
5644 final DomImplementation implementation; | 5782 final DomImplementation implementation; |
5645 | 5783 |
| 5784 /// Moved to [HtmlDocument]. |
5646 /// @domName Document.lastModified; @docsEditable true | 5785 /// @domName Document.lastModified; @docsEditable true |
5647 @JSName('lastModified') | 5786 @JSName('lastModified') |
5648 final String $dom_lastModified; | 5787 final String $dom_lastModified; |
5649 | 5788 |
5650 /// @domName Document.preferredStylesheetSet; @docsEditable true | 5789 /// @domName Document.preferredStylesheetSet; @docsEditable true |
5651 @JSName('preferredStylesheetSet') | 5790 @JSName('preferredStylesheetSet') |
5652 final String $dom_preferredStylesheetSet; | 5791 final String $dom_preferredStylesheetSet; |
5653 | 5792 |
5654 /// @domName Document.readyState; @docsEditable true | 5793 /// @domName Document.readyState; @docsEditable true |
5655 final String readyState; | 5794 final String readyState; |
5656 | 5795 |
| 5796 /// Moved to [HtmlDocument]. |
5657 /// @domName Document.referrer; @docsEditable true | 5797 /// @domName Document.referrer; @docsEditable true |
5658 @JSName('referrer') | 5798 @JSName('referrer') |
5659 final String $dom_referrer; | 5799 final String $dom_referrer; |
5660 | 5800 |
5661 /// @domName Document.selectedStylesheetSet; @docsEditable true | 5801 /// @domName Document.selectedStylesheetSet; @docsEditable true |
5662 @JSName('selectedStylesheetSet') | 5802 @JSName('selectedStylesheetSet') |
5663 String $dom_selectedStylesheetSet; | 5803 String $dom_selectedStylesheetSet; |
5664 | 5804 |
| 5805 /// Moved to [HtmlDocument]. |
5665 /// @domName Document.styleSheets; @docsEditable true | 5806 /// @domName Document.styleSheets; @docsEditable true |
5666 @JSName('styleSheets') | 5807 @JSName('styleSheets') |
5667 @Returns('_StyleSheetList') @Creates('_StyleSheetList') | 5808 @Returns('_StyleSheetList') @Creates('_StyleSheetList') |
5668 final List<StyleSheet> $dom_styleSheets; | 5809 final List<StyleSheet> $dom_styleSheets; |
5669 | 5810 |
| 5811 /// Moved to [HtmlDocument]. |
5670 /// @domName Document.title; @docsEditable true | 5812 /// @domName Document.title; @docsEditable true |
5671 @JSName('title') | 5813 @JSName('title') |
5672 String $dom_title; | 5814 String $dom_title; |
5673 | 5815 |
| 5816 /// Moved to [HtmlDocument]. |
5674 /// @domName Document.webkitFullscreenElement; @docsEditable true | 5817 /// @domName Document.webkitFullscreenElement; @docsEditable true |
5675 @JSName('webkitFullscreenElement') | 5818 @JSName('webkitFullscreenElement') |
5676 final Element $dom_webkitFullscreenElement; | 5819 final Element $dom_webkitFullscreenElement; |
5677 | 5820 |
| 5821 /// Moved to [HtmlDocument]. |
5678 /// @domName Document.webkitFullscreenEnabled; @docsEditable true | 5822 /// @domName Document.webkitFullscreenEnabled; @docsEditable true |
5679 @JSName('webkitFullscreenEnabled') | 5823 @JSName('webkitFullscreenEnabled') |
5680 final bool $dom_webkitFullscreenEnabled; | 5824 final bool $dom_webkitFullscreenEnabled; |
5681 | 5825 |
| 5826 /// Moved to [HtmlDocument]. |
5682 /// @domName Document.webkitHidden; @docsEditable true | 5827 /// @domName Document.webkitHidden; @docsEditable true |
5683 @JSName('webkitHidden') | 5828 @JSName('webkitHidden') |
5684 final bool $dom_webkitHidden; | 5829 final bool $dom_webkitHidden; |
5685 | 5830 |
| 5831 /// Moved to [HtmlDocument]. |
5686 /// @domName Document.webkitIsFullScreen; @docsEditable true | 5832 /// @domName Document.webkitIsFullScreen; @docsEditable true |
5687 @JSName('webkitIsFullScreen') | 5833 @JSName('webkitIsFullScreen') |
5688 final bool $dom_webkitIsFullScreen; | 5834 final bool $dom_webkitIsFullScreen; |
5689 | 5835 |
| 5836 /// Moved to [HtmlDocument]. |
5690 /// @domName Document.webkitPointerLockElement; @docsEditable true | 5837 /// @domName Document.webkitPointerLockElement; @docsEditable true |
5691 @JSName('webkitPointerLockElement') | 5838 @JSName('webkitPointerLockElement') |
5692 final Element $dom_webkitPointerLockElement; | 5839 final Element $dom_webkitPointerLockElement; |
5693 | 5840 |
| 5841 /// Moved to [HtmlDocument]. |
5694 /// @domName Document.webkitVisibilityState; @docsEditable true | 5842 /// @domName Document.webkitVisibilityState; @docsEditable true |
5695 @JSName('webkitVisibilityState') | 5843 @JSName('webkitVisibilityState') |
5696 final String $dom_webkitVisibilityState; | 5844 final String $dom_webkitVisibilityState; |
5697 | 5845 |
| 5846 /// Use the [Range] constructor instead. |
5698 /// @domName Document.caretRangeFromPoint; @docsEditable true | 5847 /// @domName Document.caretRangeFromPoint; @docsEditable true |
5699 @JSName('caretRangeFromPoint') | 5848 @JSName('caretRangeFromPoint') |
5700 Range $dom_caretRangeFromPoint(int x, int y) native; | 5849 Range $dom_caretRangeFromPoint(int x, int y) native; |
5701 | 5850 |
5702 /// @domName Document.createCDATASection; @docsEditable true | 5851 /// @domName Document.createCDATASection; @docsEditable true |
5703 @JSName('createCDATASection') | 5852 @JSName('createCDATASection') |
5704 CDataSection createCDataSection(String data) native; | 5853 CDataSection createCDataSection(String data) native; |
5705 | 5854 |
5706 /// @domName Document.createDocumentFragment; @docsEditable true | 5855 /// @domName Document.createDocumentFragment; @docsEditable true |
5707 DocumentFragment createDocumentFragment() native; | 5856 DocumentFragment createDocumentFragment() native; |
5708 | 5857 |
| 5858 /// Deprecated: use new Element.tag(tagName) instead. |
5709 /// @domName Document.createElement; @docsEditable true | 5859 /// @domName Document.createElement; @docsEditable true |
5710 @JSName('createElement') | 5860 @JSName('createElement') |
5711 Element $dom_createElement(String tagName) native; | 5861 Element $dom_createElement(String tagName) native; |
5712 | 5862 |
5713 /// @domName Document.createElementNS; @docsEditable true | 5863 /// @domName Document.createElementNS; @docsEditable true |
5714 @JSName('createElementNS') | 5864 @JSName('createElementNS') |
5715 Element $dom_createElementNS(String namespaceURI, String qualifiedName) native
; | 5865 Element $dom_createElementNS(String namespaceURI, String qualifiedName) native
; |
5716 | 5866 |
5717 /// @domName Document.createEvent; @docsEditable true | 5867 /// @domName Document.createEvent; @docsEditable true |
5718 @JSName('createEvent') | 5868 @JSName('createEvent') |
5719 Event $dom_createEvent(String eventType) native; | 5869 Event $dom_createEvent(String eventType) native; |
5720 | 5870 |
5721 /// @domName Document.createRange; @docsEditable true | 5871 /// @domName Document.createRange; @docsEditable true |
5722 @JSName('createRange') | 5872 @JSName('createRange') |
5723 Range $dom_createRange() native; | 5873 Range $dom_createRange() native; |
5724 | 5874 |
5725 /// @domName Document.createTextNode; @docsEditable true | 5875 /// @domName Document.createTextNode; @docsEditable true |
5726 @JSName('createTextNode') | 5876 @JSName('createTextNode') |
5727 Text $dom_createTextNode(String data) native; | 5877 Text $dom_createTextNode(String data) native; |
5728 | 5878 |
5729 /// @domName Document.createTouch; @docsEditable true | 5879 /// @domName Document.createTouch; @docsEditable true |
5730 Touch $dom_createTouch(LocalWindow window, EventTarget target, int identifier,
int pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRa
diusY, num webkitRotationAngle, num webkitForce) { | 5880 Touch $dom_createTouch(LocalWindow window, EventTarget target, int identifier,
int pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRa
diusY, num webkitRotationAngle, num webkitForce) { |
5731 var target_1 = _convertDartToNative_EventTarget(target); | 5881 var target_1 = _convertDartToNative_EventTarget(target); |
5732 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree
nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce); | 5882 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree
nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce); |
5733 } | 5883 } |
5734 @JSName('createTouch') | 5884 @JSName('createTouch') |
5735 Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY
, screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitFor
ce) native; | 5885 Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY
, screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitFor
ce) native; |
5736 | 5886 |
| 5887 /// Use the [TouchList] constructor isntead. |
5737 /// @domName Document.createTouchList; @docsEditable true | 5888 /// @domName Document.createTouchList; @docsEditable true |
5738 @JSName('createTouchList') | 5889 @JSName('createTouchList') |
5739 TouchList $dom_createTouchList() native; | 5890 TouchList $dom_createTouchList() native; |
5740 | 5891 |
| 5892 /// Moved to [HtmlDocument]. |
5741 /// @domName Document.elementFromPoint; @docsEditable true | 5893 /// @domName Document.elementFromPoint; @docsEditable true |
5742 @JSName('elementFromPoint') | 5894 @JSName('elementFromPoint') |
5743 Element $dom_elementFromPoint(int x, int y) native; | 5895 Element $dom_elementFromPoint(int x, int y) native; |
5744 | 5896 |
5745 /// @domName Document.execCommand; @docsEditable true | 5897 /// @domName Document.execCommand; @docsEditable true |
5746 bool execCommand(String command, bool userInterface, String value) native; | 5898 bool execCommand(String command, bool userInterface, String value) native; |
5747 | 5899 |
5748 /// @domName Document.getCSSCanvasContext; @docsEditable true | 5900 /// @domName Document.getCSSCanvasContext; @docsEditable true |
5749 @JSName('getCSSCanvasContext') | 5901 @JSName('getCSSCanvasContext') |
5750 CanvasRenderingContext $dom_getCssCanvasContext(String contextId, String name,
int width, int height) native; | 5902 CanvasRenderingContext $dom_getCssCanvasContext(String contextId, String name,
int width, int height) native; |
5751 | 5903 |
| 5904 /// Deprecated: use query("#$elementId") instead. |
5752 /// @domName Document.getElementById; @docsEditable true | 5905 /// @domName Document.getElementById; @docsEditable true |
5753 @JSName('getElementById') | 5906 @JSName('getElementById') |
5754 Element $dom_getElementById(String elementId) native; | 5907 Element $dom_getElementById(String elementId) native; |
5755 | 5908 |
5756 /// @domName Document.getElementsByClassName; @docsEditable true | 5909 /// @domName Document.getElementsByClassName; @docsEditable true |
5757 @JSName('getElementsByClassName') | 5910 @JSName('getElementsByClassName') |
5758 @Returns('NodeList') @Creates('NodeList') | 5911 @Returns('NodeList') @Creates('NodeList') |
5759 List<Node> $dom_getElementsByClassName(String tagname) native; | 5912 List<Node> $dom_getElementsByClassName(String tagname) native; |
5760 | 5913 |
5761 /// @domName Document.getElementsByName; @docsEditable true | 5914 /// @domName Document.getElementsByName; @docsEditable true |
(...skipping 14 matching lines...) Expand all Loading... |
5776 | 5929 |
5777 /// @domName Document.queryCommandState; @docsEditable true | 5930 /// @domName Document.queryCommandState; @docsEditable true |
5778 bool queryCommandState(String command) native; | 5931 bool queryCommandState(String command) native; |
5779 | 5932 |
5780 /// @domName Document.queryCommandSupported; @docsEditable true | 5933 /// @domName Document.queryCommandSupported; @docsEditable true |
5781 bool queryCommandSupported(String command) native; | 5934 bool queryCommandSupported(String command) native; |
5782 | 5935 |
5783 /// @domName Document.queryCommandValue; @docsEditable true | 5936 /// @domName Document.queryCommandValue; @docsEditable true |
5784 String queryCommandValue(String command) native; | 5937 String queryCommandValue(String command) native; |
5785 | 5938 |
| 5939 /// Deprecated: renamed to the shorter name [query]. |
5786 /// @domName Document.querySelector; @docsEditable true | 5940 /// @domName Document.querySelector; @docsEditable true |
5787 @JSName('querySelector') | 5941 @JSName('querySelector') |
5788 Element $dom_querySelector(String selectors) native; | 5942 Element $dom_querySelector(String selectors) native; |
5789 | 5943 |
| 5944 /// Deprecated: use query("#$elementId") instead. |
5790 /// @domName Document.querySelectorAll; @docsEditable true | 5945 /// @domName Document.querySelectorAll; @docsEditable true |
5791 @JSName('querySelectorAll') | 5946 @JSName('querySelectorAll') |
5792 @Returns('NodeList') @Creates('NodeList') | 5947 @Returns('NodeList') @Creates('NodeList') |
5793 List<Node> $dom_querySelectorAll(String selectors) native; | 5948 List<Node> $dom_querySelectorAll(String selectors) native; |
5794 | 5949 |
| 5950 /// Moved to [HtmlDocument]. |
5795 /// @domName Document.webkitCancelFullScreen; @docsEditable true | 5951 /// @domName Document.webkitCancelFullScreen; @docsEditable true |
5796 @JSName('webkitCancelFullScreen') | 5952 @JSName('webkitCancelFullScreen') |
5797 void $dom_webkitCancelFullScreen() native; | 5953 void $dom_webkitCancelFullScreen() native; |
5798 | 5954 |
| 5955 /// Moved to [HtmlDocument]. |
5799 /// @domName Document.webkitExitFullscreen; @docsEditable true | 5956 /// @domName Document.webkitExitFullscreen; @docsEditable true |
5800 @JSName('webkitExitFullscreen') | 5957 @JSName('webkitExitFullscreen') |
5801 void $dom_webkitExitFullscreen() native; | 5958 void $dom_webkitExitFullscreen() native; |
5802 | 5959 |
| 5960 /// Moved to [HtmlDocument]. |
5803 /// @domName Document.webkitExitPointerLock; @docsEditable true | 5961 /// @domName Document.webkitExitPointerLock; @docsEditable true |
5804 @JSName('webkitExitPointerLock') | 5962 @JSName('webkitExitPointerLock') |
5805 void $dom_webkitExitPointerLock() native; | 5963 void $dom_webkitExitPointerLock() native; |
5806 | 5964 |
5807 | 5965 |
5808 /** | 5966 /** |
5809 * Finds the first descendant element of this document that matches the | 5967 * Finds the first descendant element of this document that matches the |
5810 * specified group of selectors. | 5968 * specified group of selectors. |
5811 * | 5969 * |
5812 * Unless your webpage contains multiple documents, the top-level query | 5970 * Unless your webpage contains multiple documents, the top-level query |
(...skipping 4207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10020 * [onComplete] callback. | 10178 * [onComplete] callback. |
10021 * | 10179 * |
10022 * See also: (authorization headers)[http://en.wikipedia.org/wiki/Basic_access
_authentication]. | 10180 * See also: (authorization headers)[http://en.wikipedia.org/wiki/Basic_access
_authentication]. |
10023 */ | 10181 */ |
10024 factory HttpRequest.getWithCredentials(String url, | 10182 factory HttpRequest.getWithCredentials(String url, |
10025 onComplete(HttpRequest request)) => | 10183 onComplete(HttpRequest request)) => |
10026 _HttpRequestFactoryProvider.createHttpRequest_getWithCredentials(url, | 10184 _HttpRequestFactoryProvider.createHttpRequest_getWithCredentials(url, |
10027 onComplete); | 10185 onComplete); |
10028 | 10186 |
10029 | 10187 |
| 10188 /** |
| 10189 * General constructor for any type of request (GET, POST, etc). |
| 10190 * |
| 10191 * This call is used in conjunction with [open]: |
| 10192 * |
| 10193 * var request = new HttpRequest(); |
| 10194 * request.open('GET', 'http://dartlang.org') |
| 10195 * request.on.load.add((event) => print('Request complete')); |
| 10196 * |
| 10197 * is the (more verbose) equivalent of |
| 10198 * |
| 10199 * var request = new HttpRequest.get('http://dartlang.org', |
| 10200 * (event) => print('Request complete')); |
| 10201 */ |
10030 ///@docsEditable true | 10202 ///@docsEditable true |
10031 factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest(); | 10203 factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest(); |
10032 | 10204 |
| 10205 /** |
| 10206 * Get the set of [HttpRequestEvents] that this request can respond to. |
| 10207 * Usually used when adding an EventListener, such as in |
| 10208 * `document.window.on.keyDown.add((e) => print('keydown happened'))`. |
| 10209 */ |
10033 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | 10210 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
10034 HttpRequestEvents get on => | 10211 HttpRequestEvents get on => |
10035 new HttpRequestEvents(this); | 10212 new HttpRequestEvents(this); |
10036 | 10213 |
10037 static const int DONE = 4; | 10214 static const int DONE = 4; |
10038 | 10215 |
10039 static const int HEADERS_RECEIVED = 2; | 10216 static const int HEADERS_RECEIVED = 2; |
10040 | 10217 |
10041 static const int LOADING = 3; | 10218 static const int LOADING = 3; |
10042 | 10219 |
10043 static const int OPENED = 1; | 10220 static const int OPENED = 1; |
10044 | 10221 |
10045 static const int UNSENT = 0; | 10222 static const int UNSENT = 0; |
10046 | 10223 |
| 10224 /** |
| 10225 * Indicator of the current state of the request: |
| 10226 * |
| 10227 * <table> |
| 10228 * <tr> |
| 10229 * <td>Value</td> |
| 10230 * <td>State</td> |
| 10231 * <td>Meaning</td> |
| 10232 * </tr> |
| 10233 * <tr> |
| 10234 * <td>0</td> |
| 10235 * <td>unsent</td> |
| 10236 * <td><code>open()</code> has not yet been called</td> |
| 10237 * </tr> |
| 10238 * <tr> |
| 10239 * <td>1</td> |
| 10240 * <td>opened</td> |
| 10241 * <td><code>send()</code> has not yet been called</td> |
| 10242 * </tr> |
| 10243 * <tr> |
| 10244 * <td>2</td> |
| 10245 * <td>headers received</td> |
| 10246 * <td><code>sent()</code> has been called; response headers and <code>sta
tus</code> are available</td> |
| 10247 * </tr> |
| 10248 * <tr> |
| 10249 * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some da
ta</td> |
| 10250 * </tr> |
| 10251 * <tr> |
| 10252 * <td>4</td> <td>done</td> <td>request is complete</td> |
| 10253 * </tr> |
| 10254 * </table> |
| 10255 */ |
10047 /// @domName XMLHttpRequest.readyState; @docsEditable true | 10256 /// @domName XMLHttpRequest.readyState; @docsEditable true |
10048 final int readyState; | 10257 final int readyState; |
10049 | 10258 |
| 10259 /** |
| 10260 * The data received as a reponse from the request. |
| 10261 * |
| 10262 * The data could be in the |
| 10263 * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a |
| 10264 * [String]). `null` indicates request failure. |
| 10265 */ |
10050 /// @domName XMLHttpRequest.response; @docsEditable true | 10266 /// @domName XMLHttpRequest.response; @docsEditable true |
10051 @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num') | 10267 @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num') |
10052 final Object response; | 10268 final Object response; |
10053 | 10269 |
| 10270 /** |
| 10271 * The response in string form or null on failure. |
| 10272 */ |
10054 /// @domName XMLHttpRequest.responseText; @docsEditable true | 10273 /// @domName XMLHttpRequest.responseText; @docsEditable true |
10055 final String responseText; | 10274 final String responseText; |
10056 | 10275 |
| 10276 /** |
| 10277 * [String] telling the server the desired response format. |
| 10278 * |
| 10279 * Default is `String`. |
| 10280 * Other options are one of 'arraybuffer', 'blob', 'document', 'json', |
| 10281 * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if |
| 10282 * `responseType` is set while performing a synchronous request. |
| 10283 * |
| 10284 * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/X
MLHttpRequest#responseType) |
| 10285 */ |
10057 /// @domName XMLHttpRequest.responseType; @docsEditable true | 10286 /// @domName XMLHttpRequest.responseType; @docsEditable true |
10058 String responseType; | 10287 String responseType; |
10059 | 10288 |
| 10289 /** |
| 10290 * The request response, or null on failure. |
| 10291 * |
| 10292 * The response is processed as |
| 10293 * `text/xml` stream, unless responseType = 'document' and the request is |
| 10294 * synchronous. |
| 10295 */ |
10060 /// @domName XMLHttpRequest.responseXML; @docsEditable true | 10296 /// @domName XMLHttpRequest.responseXML; @docsEditable true |
10061 @JSName('responseXML') | 10297 @JSName('responseXML') |
10062 final Document responseXml; | 10298 final Document responseXml; |
10063 | 10299 |
| 10300 /** |
| 10301 * The http result code from the request (200, 404, etc). |
| 10302 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta
tus_codes) |
| 10303 */ |
10064 /// @domName XMLHttpRequest.status; @docsEditable true | 10304 /// @domName XMLHttpRequest.status; @docsEditable true |
10065 final int status; | 10305 final int status; |
10066 | 10306 |
| 10307 /** |
| 10308 * The request response string (such as "200 OK"). |
| 10309 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta
tus_codes) |
| 10310 */ |
10067 /// @domName XMLHttpRequest.statusText; @docsEditable true | 10311 /// @domName XMLHttpRequest.statusText; @docsEditable true |
10068 final String statusText; | 10312 final String statusText; |
10069 | 10313 |
| 10314 /** |
| 10315 * [EventTarget] that can hold listeners to track the progress of the request. |
| 10316 * The events fired will be members of [HttpRequestUploadEvents]. |
| 10317 */ |
10070 /// @domName XMLHttpRequest.upload; @docsEditable true | 10318 /// @domName XMLHttpRequest.upload; @docsEditable true |
10071 final HttpRequestUpload upload; | 10319 final HttpRequestUpload upload; |
10072 | 10320 |
| 10321 /** |
| 10322 * True if cross-site requests should use credentials such as cookies |
| 10323 * or authorization headers; false otherwise. |
| 10324 * |
| 10325 * This value is ignored for same-site requests. |
| 10326 */ |
10073 /// @domName XMLHttpRequest.withCredentials; @docsEditable true | 10327 /// @domName XMLHttpRequest.withCredentials; @docsEditable true |
10074 bool withCredentials; | 10328 bool withCredentials; |
10075 | 10329 |
| 10330 /** |
| 10331 * Stop the current request. |
| 10332 * |
| 10333 * The request can only be stopped if readyState is `HEADERS_RECIEVED` or |
| 10334 * `LOADING`. If this method is not in the process of being sent, the method |
| 10335 * has no effect. |
| 10336 */ |
10076 /// @domName XMLHttpRequest.abort; @docsEditable true | 10337 /// @domName XMLHttpRequest.abort; @docsEditable true |
10077 void abort() native; | 10338 void abort() native; |
10078 | 10339 |
10079 /// @domName XMLHttpRequest.addEventListener; @docsEditable true | 10340 /// @domName XMLHttpRequest.addEventListener; @docsEditable true |
10080 @JSName('addEventListener') | 10341 @JSName('addEventListener') |
10081 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 10342 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
10082 | 10343 |
10083 /// @domName XMLHttpRequest.dispatchEvent; @docsEditable true | 10344 /// @domName XMLHttpRequest.dispatchEvent; @docsEditable true |
10084 @JSName('dispatchEvent') | 10345 @JSName('dispatchEvent') |
10085 bool $dom_dispatchEvent(Event evt) native; | 10346 bool $dom_dispatchEvent(Event evt) native; |
10086 | 10347 |
| 10348 /** |
| 10349 * Retrieve all the response headers from a request. |
| 10350 * |
| 10351 * `null` if no headers have been received. For multipart requests, |
| 10352 * `getAllResponseHeaders` will return the response headers for the current |
| 10353 * part of the request. |
| 10354 * |
| 10355 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_
header_fields#Responses) |
| 10356 * for a list of common response headers. |
| 10357 */ |
10087 /// @domName XMLHttpRequest.getAllResponseHeaders; @docsEditable true | 10358 /// @domName XMLHttpRequest.getAllResponseHeaders; @docsEditable true |
10088 String getAllResponseHeaders() native; | 10359 String getAllResponseHeaders() native; |
10089 | 10360 |
| 10361 /** |
| 10362 * Return the response header named `header`, or `null` if not found. |
| 10363 * |
| 10364 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_
header_fields#Responses) |
| 10365 * for a list of common response headers. |
| 10366 */ |
10090 /// @domName XMLHttpRequest.getResponseHeader; @docsEditable true | 10367 /// @domName XMLHttpRequest.getResponseHeader; @docsEditable true |
10091 String getResponseHeader(String header) native; | 10368 String getResponseHeader(String header) native; |
10092 | 10369 |
| 10370 /** |
| 10371 * Specify the desired `url`, and `method` to use in making the request. |
| 10372 * |
| 10373 * By default the request is done asyncronously, with no user or password |
| 10374 * authentication information. If `async` is false, the request will be send |
| 10375 * synchronously. |
| 10376 * |
| 10377 * Calling `open` again on a currently active request is equivalent to |
| 10378 * calling `abort`. |
| 10379 */ |
10093 /// @domName XMLHttpRequest.open; @docsEditable true | 10380 /// @domName XMLHttpRequest.open; @docsEditable true |
10094 void open(String method, String url, [bool async, String user, String password
]) native; | 10381 void open(String method, String url, [bool async, String user, String password
]) native; |
10095 | 10382 |
| 10383 /** |
| 10384 * Specify a particular MIME type (such as `text/xml`) desired for the |
| 10385 * response. |
| 10386 * |
| 10387 * This value must be set before the request has been sent. See also the list |
| 10388 * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#Lis
t_of_common_media_types) |
| 10389 */ |
10096 /// @domName XMLHttpRequest.overrideMimeType; @docsEditable true | 10390 /// @domName XMLHttpRequest.overrideMimeType; @docsEditable true |
10097 void overrideMimeType(String override) native; | 10391 void overrideMimeType(String override) native; |
10098 | 10392 |
10099 /// @domName XMLHttpRequest.removeEventListener; @docsEditable true | 10393 /// @domName XMLHttpRequest.removeEventListener; @docsEditable true |
10100 @JSName('removeEventListener') | 10394 @JSName('removeEventListener') |
10101 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 10395 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
10102 | 10396 |
| 10397 /** |
| 10398 * Send the request with any given `data`. |
| 10399 * |
| 10400 * See also: |
| 10401 * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#s
end()) |
| 10402 * from MDN. |
| 10403 */ |
10103 /// @domName XMLHttpRequest.send; @docsEditable true | 10404 /// @domName XMLHttpRequest.send; @docsEditable true |
10104 void send([data]) native; | 10405 void send([data]) native; |
10105 | 10406 |
| 10407 /** Sets HTTP `header` to `value`. */ |
10106 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true | 10408 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true |
10107 void setRequestHeader(String header, String value) native; | 10409 void setRequestHeader(String header, String value) native; |
10108 | 10410 |
10109 } | 10411 } |
10110 | 10412 |
| 10413 /** |
| 10414 * A class that supports listening for and dispatching events that can fire when |
| 10415 * making an HTTP request. |
| 10416 * |
| 10417 * Here's an example of adding an event handler that executes once an HTTP |
| 10418 * request has fully loaded: |
| 10419 * |
| 10420 * httpRequest.on.loadEnd.add((e) => myCustomLoadEndHandler(e)); |
| 10421 * |
| 10422 * Each property of this class is a read-only pointer to an [EventListenerList]. |
| 10423 * That list holds all of the [EventListener]s that have registered for that |
| 10424 * particular type of event that fires from an HttpRequest. |
| 10425 */ |
10111 /// @docsEditable true | 10426 /// @docsEditable true |
10112 class HttpRequestEvents extends Events { | 10427 class HttpRequestEvents extends Events { |
10113 /// @docsEditable true | 10428 /// @docsEditable true |
10114 HttpRequestEvents(EventTarget _ptr) : super(_ptr); | 10429 HttpRequestEvents(EventTarget _ptr) : super(_ptr); |
10115 | 10430 |
| 10431 /** |
| 10432 * Event listeners to be notified when request has been aborted, |
| 10433 * generally due to calling `httpRequest.abort()`. |
| 10434 */ |
10116 /// @docsEditable true | 10435 /// @docsEditable true |
10117 EventListenerList get abort => this['abort']; | 10436 EventListenerList get abort => this['abort']; |
10118 | 10437 |
| 10438 /** |
| 10439 * Event listeners to be notified when a request has failed, such as when a |
| 10440 * cross-domain error occurred or the file wasn't found on the server. |
| 10441 */ |
10119 /// @docsEditable true | 10442 /// @docsEditable true |
10120 EventListenerList get error => this['error']; | 10443 EventListenerList get error => this['error']; |
10121 | 10444 |
| 10445 /** |
| 10446 * Event listeners to be notified once the request has completed |
| 10447 * *successfully*. |
| 10448 */ |
10122 /// @docsEditable true | 10449 /// @docsEditable true |
10123 EventListenerList get load => this['load']; | 10450 EventListenerList get load => this['load']; |
10124 | 10451 |
| 10452 /** |
| 10453 * Event listeners to be notified once the request has completed (on |
| 10454 * either success or failure). |
| 10455 */ |
10125 /// @docsEditable true | 10456 /// @docsEditable true |
10126 EventListenerList get loadEnd => this['loadend']; | 10457 EventListenerList get loadEnd => this['loadend']; |
10127 | 10458 |
| 10459 /** |
| 10460 * Event listeners to be notified when the request starts, once |
| 10461 * `httpRequest.send()` has been called. |
| 10462 */ |
10128 /// @docsEditable true | 10463 /// @docsEditable true |
10129 EventListenerList get loadStart => this['loadstart']; | 10464 EventListenerList get loadStart => this['loadstart']; |
10130 | 10465 |
| 10466 /** |
| 10467 * Event listeners to be notified when data for the request |
| 10468 * is being sent or loaded. |
| 10469 * |
| 10470 * Progress events are fired every 50ms or for every byte transmitted, |
| 10471 * whichever is less frequent. |
| 10472 */ |
10131 /// @docsEditable true | 10473 /// @docsEditable true |
10132 EventListenerList get progress => this['progress']; | 10474 EventListenerList get progress => this['progress']; |
10133 | 10475 |
| 10476 /** |
| 10477 * Event listeners to be notified every time the [HttpRequest] |
| 10478 * object's `readyState` changes values. |
| 10479 */ |
10134 /// @docsEditable true | 10480 /// @docsEditable true |
10135 EventListenerList get readyStateChange => this['readystatechange']; | 10481 EventListenerList get readyStateChange => this['readystatechange']; |
10136 } | 10482 } |
10137 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 10483 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
10138 // for details. All rights reserved. Use of this source code is governed by a | 10484 // for details. All rights reserved. Use of this source code is governed by a |
10139 // BSD-style license that can be found in the LICENSE file. | 10485 // BSD-style license that can be found in the LICENSE file. |
10140 | 10486 |
10141 | 10487 |
10142 /// @domName XMLHttpRequestException; @docsEditable true | 10488 /// @domName XMLHttpRequestException; @docsEditable true |
10143 class HttpRequestException native "*XMLHttpRequestException" { | 10489 class HttpRequestException native "*XMLHttpRequestException" { |
(...skipping 3056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13200 final int totalJSHeapSize; | 13546 final int totalJSHeapSize; |
13201 | 13547 |
13202 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true | 13548 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true |
13203 final int usedJSHeapSize; | 13549 final int usedJSHeapSize; |
13204 } | 13550 } |
13205 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 13551 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
13206 // for details. All rights reserved. Use of this source code is governed by a | 13552 // for details. All rights reserved. Use of this source code is governed by a |
13207 // BSD-style license that can be found in the LICENSE file. | 13553 // BSD-style license that can be found in the LICENSE file. |
13208 | 13554 |
13209 | 13555 |
| 13556 /** |
| 13557 * An HTML <menu> element. |
| 13558 * |
| 13559 * A <menu> element represents an unordered list of menu commands. |
| 13560 * |
| 13561 * See also: |
| 13562 * |
| 13563 * * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu)
from MDN. |
| 13564 * * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-e
lement) from the W3C. |
| 13565 */ |
13210 /// @domName HTMLMenuElement; @docsEditable true | 13566 /// @domName HTMLMenuElement; @docsEditable true |
13211 class MenuElement extends Element native "*HTMLMenuElement" { | 13567 class MenuElement extends Element native "*HTMLMenuElement" { |
13212 | 13568 |
13213 ///@docsEditable true | 13569 ///@docsEditable true |
13214 factory MenuElement() => document.$dom_createElement("menu"); | 13570 factory MenuElement() => document.$dom_createElement("menu"); |
13215 } | 13571 } |
13216 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 13572 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
13217 // for details. All rights reserved. Use of this source code is governed by a | 13573 // for details. All rights reserved. Use of this source code is governed by a |
13218 // BSD-style license that can be found in the LICENSE file. | 13574 // BSD-style license that can be found in the LICENSE file. |
13219 | 13575 |
(...skipping 12330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
25550 T next() { | 25906 T next() { |
25551 if (!hasNext) { | 25907 if (!hasNext) { |
25552 throw new StateError("No more elements"); | 25908 throw new StateError("No more elements"); |
25553 } | 25909 } |
25554 return _array[_pos++]; | 25910 return _array[_pos++]; |
25555 } | 25911 } |
25556 | 25912 |
25557 final List<T> _array; | 25913 final List<T> _array; |
25558 int _pos; | 25914 int _pos; |
25559 } | 25915 } |
OLD | NEW |