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

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

Issue 11727007: Add min and max to Iterable and Stream. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address review comments. Fix T->E in Iterable. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:indexed_db'; 6 import 'dart:indexed_db';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 import 'dart:json' as json; 8 import 'dart:json' as json;
9 import 'dart:svg' as svg; 9 import 'dart:svg' as svg;
10 import 'dart:web_audio' as web_audio; 10 import 'dart:web_audio' as web_audio;
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 class CanvasElement extends Element native "*HTMLCanvasElement" { 779 class CanvasElement extends Element native "*HTMLCanvasElement" {
780 780
781 ///@docsEditable true 781 ///@docsEditable true
782 factory CanvasElement({int width, int height}) { 782 factory CanvasElement({int width, int height}) {
783 var e = document.$dom_createElement("canvas"); 783 var e = document.$dom_createElement("canvas");
784 if (width != null) e.width = width; 784 if (width != null) e.width = width;
785 if (height != null) e.height = height; 785 if (height != null) e.height = height;
786 return e; 786 return e;
787 } 787 }
788 788
789 /// The height of this canvas element in CSS pixels.
789 /// @domName HTMLCanvasElement.height; @docsEditable true 790 /// @domName HTMLCanvasElement.height; @docsEditable true
790 int height; 791 int height;
791 792
793 /// The width of this canvas element in CSS pixels.
792 /// @domName HTMLCanvasElement.width; @docsEditable true 794 /// @domName HTMLCanvasElement.width; @docsEditable true
793 int width; 795 int width;
794 796
797 /**
798 * Returns a data URI containing a representation of the image in the
799 * format specified by type (defaults to 'image/png').
800 *
801 * Data Uri format is as follow `data:[<MIME-type>][;charset=<encoding>][;base 64],<data>`
802 *
803 * Optional parameter [quality] in the range of 0.0 and 1.0 can be used when r equesting [type]
804 * 'image/jpeg' or 'image/webp'. If [quality] is not passed the default
805 * value is used. Note: the default value varies by browser.
806 *
807 * If the height or width of this canvas element is 0, then 'data:' is returne d,
808 * representing no data.
809 *
810 * If the type requested is not 'image/png', and the returned value is
811 * 'data:image/png', then the requested type is not supported.
812 *
813 * Example usage:
814 *
815 * CanvasElement canvas = new CanvasElement();
816 * var ctx = canvas.context2d
817 * ..fillStyle = "rgb(200,0,0)"
818 * ..fillRect(10, 10, 55, 50);
819 * var dataUrl = canvas.toDataURL("image/jpeg", 0.95);
820 * // The Data Uri would look similar to
821 * // 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
822 * // AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
823 * // 9TXL0Y4OHwAAAABJRU5ErkJggg=='
824 * //Create a new image element from the data URI.
825 * var img = new ImageElement();
826 * img.src = dataUrl;
827 * document.body.children.add(img);
828 *
829 * See also:
830 *
831 * * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wiki pedia.
832 *
833 * * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanv asElement) from MDN.
834 *
835 * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canv as-todataurl) from W3C.
836 */
795 /// @domName HTMLCanvasElement.toDataURL; @docsEditable true 837 /// @domName HTMLCanvasElement.toDataURL; @docsEditable true
796 @JSName('toDataURL') 838 @JSName('toDataURL')
797 String toDataUrl(String type, [num quality]) native; 839 String toDataUrl(String type, [num quality]) native;
798 840
799 841
800 CanvasRenderingContext getContext(String contextId) native; 842 CanvasRenderingContext getContext(String contextId) native;
801 CanvasRenderingContext2D get context2d => getContext('2d'); 843 CanvasRenderingContext2D get context2d => getContext('2d');
802 } 844 }
803 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 845 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
804 // for details. All rights reserved. Use of this source code is governed by a 846 // for details. All rights reserved. Use of this source code is governed by a
805 // BSD-style license that can be found in the LICENSE file. 847 // BSD-style license that can be found in the LICENSE file.
806 848
807 849
850 /**
851 * An opaque canvas object representing a gradient.
852 *
853 * Created by calling [createLinearGradient] or [createRadialGradient] on a
854 * [CanvasRenderingContext2D] object.
855 *
856 * Example usage:
857 *
858 * var canvas = new CanvasElement(width: 600, height: 600);
859 * var ctx = canvas.context2d;
860 * ctx.clearRect(0, 0, 600, 600);
861 * ctx.save();
862 * // Create radial gradient.
863 * CanvasGradient gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, 600);
864 * gradient.addColorStop(0, '#000');
865 * gradient.addColorStop(1, 'rgb(255, 255, 255)');
866 * // Assign gradients to fill.
867 * ctx.fillStyle = gradient;
868 * // Draw a rectangle with a gradient fill.
869 * ctx.fillRect(0, 0, 600, 600);
870 * ctx.save();
871 * document.body.children.add(canvas);
872 *
873 * See also:
874 *
875 * * [CanvasGradient](https://developer.mozilla.org/en-US/docs/DOM/CanvasGradien t) from MDN.
876 * * [CanvasGradient](http://www.whatwg.org/specs/web-apps/current-work/multipag e/the-canvas-element.html#canvasgradient) from whatwg.
877 * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgra dient) from W3C.
878 */
808 /// @domName CanvasGradient; @docsEditable true 879 /// @domName CanvasGradient; @docsEditable true
809 class CanvasGradient native "*CanvasGradient" { 880 class CanvasGradient native "*CanvasGradient" {
810 881
882 /**
883 * Adds a color stop to this gradient at the offset.
884 *
885 * The [offset] can range between 0.0 and 1.0.
886 *
887 * See also:
888 *
889 * * [Multiple Color Stops](https://developer.mozilla.org/en-US/docs/CSS/linea r-gradient#Gradient_with_multiple_color_stops) from MDN.
890 */
811 /// @domName CanvasGradient.addColorStop; @docsEditable true 891 /// @domName CanvasGradient.addColorStop; @docsEditable true
812 void addColorStop(num offset, String color) native; 892 void addColorStop(num offset, String color) native;
813 } 893 }
814 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 894 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
815 // for details. All rights reserved. Use of this source code is governed by a 895 // for details. All rights reserved. Use of this source code is governed by a
816 // BSD-style license that can be found in the LICENSE file. 896 // BSD-style license that can be found in the LICENSE file.
817 897
818 898
899 /**
900 * An opaque object representing a pattern of image, canvas, or video.
901 *
902 * Created by calling [createPattern] on a [CanvasRenderingContext2D] object.
903 *
904 * Example usage:
905 *
906 * var canvas = new CanvasElement(width: 600, height: 600);
907 * var ctx = canvas.context2d;
908 * var img = new ImageElement();
909 * // Image src needs to be loaded before pattern is applied.
910 * img.on.load.add((event) {
911 * // When the image is loaded, create a pattern
912 * // from the ImageElement.
913 * CanvasPattern pattern = ctx.createPattern(img, 'repeat');
914 * ctx.rect(0, 0, canvas.width, canvas.height);
915 * ctx.fillStyle = pattern;
916 * ctx.fill();
917 * });
918 * img.src = "images/foo.jpg";
919 * document.body.children.add(canvas);
920 *
921 * See also:
922 * * [CanvasPattern](https://developer.mozilla.org/en-US/docs/DOM/CanvasPattern) from MDN.
923 * * [CanvasPattern](http://www.whatwg.org/specs/web-apps/current-work/multipage /the-canvas-element.html#canvaspattern) from whatwg.
924 * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspatt ern) from W3C.
925 */
819 /// @domName CanvasPattern; @docsEditable true 926 /// @domName CanvasPattern; @docsEditable true
820 class CanvasPattern native "*CanvasPattern" { 927 class CanvasPattern native "*CanvasPattern" {
821 } 928 }
822 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 929 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
823 // for details. All rights reserved. Use of this source code is governed by a 930 // for details. All rights reserved. Use of this source code is governed by a
824 // BSD-style license that can be found in the LICENSE file. 931 // BSD-style license that can be found in the LICENSE file.
825 932
826 933
934 /**
935 * A rendering context for a canvas element.
936 *
937 * This context is extended by [CanvasRenderingContext2D] and
938 * [WebGLRenderingContext].
939 */
827 /// @domName CanvasRenderingContext; @docsEditable true 940 /// @domName CanvasRenderingContext; @docsEditable true
828 class CanvasRenderingContext native "*CanvasRenderingContext" { 941 class CanvasRenderingContext native "*CanvasRenderingContext" {
829 942
943 /// Reference to the canvas element to which this context belongs.
830 /// @domName CanvasRenderingContext.canvas; @docsEditable true 944 /// @domName CanvasRenderingContext.canvas; @docsEditable true
831 final CanvasElement canvas; 945 final CanvasElement canvas;
832 } 946 }
833 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 947 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
834 // for details. All rights reserved. Use of this source code is governed by a 948 // for details. All rights reserved. Use of this source code is governed by a
835 // BSD-style license that can be found in the LICENSE file. 949 // BSD-style license that can be found in the LICENSE file.
836 950
837 951
838 /// @domName CanvasRenderingContext2D 952 /// @domName CanvasRenderingContext2D
839 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen deringContext2D" { 953 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen deringContext2D" {
(...skipping 4739 matching lines...) Expand 10 before | Expand all | Expand 10 after
5579 5693
5580 /// @domName DirectoryReaderSync.readEntries; @docsEditable true 5694 /// @domName DirectoryReaderSync.readEntries; @docsEditable true
5581 @Returns('_EntryArraySync') @Creates('_EntryArraySync') 5695 @Returns('_EntryArraySync') @Creates('_EntryArraySync')
5582 List<EntrySync> readEntries() native; 5696 List<EntrySync> readEntries() native;
5583 } 5697 }
5584 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5698 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
5585 // for details. All rights reserved. Use of this source code is governed by a 5699 // for details. All rights reserved. Use of this source code is governed by a
5586 // BSD-style license that can be found in the LICENSE file. 5700 // BSD-style license that can be found in the LICENSE file.
5587 5701
5588 5702
5703 /**
5704 * Represents an HTML <div> element.
5705 *
5706 * The [DivElement] is a generic container for content and does not have any
5707 * special significance. It is functionally similar to [SpanElement].
5708 *
5709 * The [DivElement] is a block-level element, as opposed to [SpanElement],
5710 * which is an inline-level element.
5711 *
5712 * Example usage:
5713 *
5714 * DivElement div = new DivElement();
5715 * div.text = 'Here's my new DivElem
5716 * document.body.elements.add(elem);
5717 *
5718 * See also:
5719 *
5720 * * [HTML <div> element](http://www.w3.org/TR/html-markup/div.html) from W3C.
5721 * * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) f rom W3C.
5722 * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
5723 */
5589 /// @domName HTMLDivElement; @docsEditable true 5724 /// @domName HTMLDivElement; @docsEditable true
5590 class DivElement extends Element native "*HTMLDivElement" { 5725 class DivElement extends Element native "*HTMLDivElement" {
5591 5726
5592 ///@docsEditable true 5727 ///@docsEditable true
5593 factory DivElement() => document.$dom_createElement("div"); 5728 factory DivElement() => document.$dom_createElement("div");
5594 } 5729 }
5595 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5730 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
5596 // for details. All rights reserved. Use of this source code is governed by a 5731 // for details. All rights reserved. Use of this source code is governed by a
5597 // BSD-style license that can be found in the LICENSE file. 5732 // BSD-style license that can be found in the LICENSE file.
5598 5733
5599 5734
5600 /// @domName Document 5735 /// @domName Document
5601 /** 5736 /**
5602 * The base class for all documents. 5737 * The base class for all documents.
5603 * 5738 *
5604 * Each web page loaded in the browser has its own [Document] object, which is 5739 * Each web page loaded in the browser has its own [Document] object, which is
5605 * typically an [HtmlDocument]. 5740 * typically an [HtmlDocument].
5606 * 5741 *
5607 * If you aren't comfortable with DOM concepts, see the Dart tutorial 5742 * If you aren't comfortable with DOM concepts, see the Dart tutorial
5608 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec t-dart-html/). 5743 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec t-dart-html/).
5609 */ 5744 */
5610 class Document extends Node native "*Document" 5745 class Document extends Node native "*Document"
5611 { 5746 {
5612 5747
5613 5748
5614 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 5749 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
5615 DocumentEvents get on => 5750 DocumentEvents get on =>
5616 new DocumentEvents(this); 5751 new DocumentEvents(this);
5617 5752
5753 /// Moved to [HtmlDocument].
5618 /// @domName Document.body; @docsEditable true 5754 /// @domName Document.body; @docsEditable true
5619 @JSName('body') 5755 @JSName('body')
5620 Element $dom_body; 5756 Element $dom_body;
5621 5757
5622 /// @domName Document.charset; @docsEditable true 5758 /// @domName Document.charset; @docsEditable true
5623 String charset; 5759 String charset;
5624 5760
5625 /// @domName Document.cookie; @docsEditable true 5761 /// @domName Document.cookie; @docsEditable true
5626 String cookie; 5762 String cookie;
5627 5763
5764 /// Returns the [Window] associated with the document.
5628 /// @domName Document.defaultView; @docsEditable true 5765 /// @domName Document.defaultView; @docsEditable true
5629 Window get window => _convertNativeToDart_Window(this._window); 5766 Window get window => _convertNativeToDart_Window(this._window);
5630 @JSName('defaultView') 5767 @JSName('defaultView')
5631 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') 5768 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object')
5632 final dynamic _window; 5769 final dynamic _window;
5633 5770
5634 /// @domName Document.documentElement; @docsEditable true 5771 /// @domName Document.documentElement; @docsEditable true
5635 final Element documentElement; 5772 final Element documentElement;
5636 5773
5637 /// @domName Document.domain; @docsEditable true 5774 /// @domName Document.domain; @docsEditable true
5638 final String domain; 5775 final String domain;
5639 5776
5777 /// Moved to [HtmlDocument].
5640 /// @domName Document.head; @docsEditable true 5778 /// @domName Document.head; @docsEditable true
5641 @JSName('head') 5779 @JSName('head')
5642 final HeadElement $dom_head; 5780 final HeadElement $dom_head;
5643 5781
5644 /// @domName Document.implementation; @docsEditable true 5782 /// @domName Document.implementation; @docsEditable true
5645 final DomImplementation implementation; 5783 final DomImplementation implementation;
5646 5784
5785 /// Moved to [HtmlDocument].
5647 /// @domName Document.lastModified; @docsEditable true 5786 /// @domName Document.lastModified; @docsEditable true
5648 @JSName('lastModified') 5787 @JSName('lastModified')
5649 final String $dom_lastModified; 5788 final String $dom_lastModified;
5650 5789
5651 /// @domName Document.preferredStylesheetSet; @docsEditable true 5790 /// @domName Document.preferredStylesheetSet; @docsEditable true
5652 @JSName('preferredStylesheetSet') 5791 @JSName('preferredStylesheetSet')
5653 final String $dom_preferredStylesheetSet; 5792 final String $dom_preferredStylesheetSet;
5654 5793
5655 /// @domName Document.readyState; @docsEditable true 5794 /// @domName Document.readyState; @docsEditable true
5656 final String readyState; 5795 final String readyState;
5657 5796
5797 /// Moved to [HtmlDocument].
5658 /// @domName Document.referrer; @docsEditable true 5798 /// @domName Document.referrer; @docsEditable true
5659 @JSName('referrer') 5799 @JSName('referrer')
5660 final String $dom_referrer; 5800 final String $dom_referrer;
5661 5801
5662 /// @domName Document.selectedStylesheetSet; @docsEditable true 5802 /// @domName Document.selectedStylesheetSet; @docsEditable true
5663 @JSName('selectedStylesheetSet') 5803 @JSName('selectedStylesheetSet')
5664 String $dom_selectedStylesheetSet; 5804 String $dom_selectedStylesheetSet;
5665 5805
5806 /// Moved to [HtmlDocument].
5666 /// @domName Document.styleSheets; @docsEditable true 5807 /// @domName Document.styleSheets; @docsEditable true
5667 @JSName('styleSheets') 5808 @JSName('styleSheets')
5668 @Returns('_StyleSheetList') @Creates('_StyleSheetList') 5809 @Returns('_StyleSheetList') @Creates('_StyleSheetList')
5669 final List<StyleSheet> $dom_styleSheets; 5810 final List<StyleSheet> $dom_styleSheets;
5670 5811
5812 /// Moved to [HtmlDocument].
5671 /// @domName Document.title; @docsEditable true 5813 /// @domName Document.title; @docsEditable true
5672 @JSName('title') 5814 @JSName('title')
5673 String $dom_title; 5815 String $dom_title;
5674 5816
5817 /// Moved to [HtmlDocument].
5675 /// @domName Document.webkitFullscreenElement; @docsEditable true 5818 /// @domName Document.webkitFullscreenElement; @docsEditable true
5676 @JSName('webkitFullscreenElement') 5819 @JSName('webkitFullscreenElement')
5677 final Element $dom_webkitFullscreenElement; 5820 final Element $dom_webkitFullscreenElement;
5678 5821
5822 /// Moved to [HtmlDocument].
5679 /// @domName Document.webkitFullscreenEnabled; @docsEditable true 5823 /// @domName Document.webkitFullscreenEnabled; @docsEditable true
5680 @JSName('webkitFullscreenEnabled') 5824 @JSName('webkitFullscreenEnabled')
5681 final bool $dom_webkitFullscreenEnabled; 5825 final bool $dom_webkitFullscreenEnabled;
5682 5826
5827 /// Moved to [HtmlDocument].
5683 /// @domName Document.webkitHidden; @docsEditable true 5828 /// @domName Document.webkitHidden; @docsEditable true
5684 @JSName('webkitHidden') 5829 @JSName('webkitHidden')
5685 final bool $dom_webkitHidden; 5830 final bool $dom_webkitHidden;
5686 5831
5832 /// Moved to [HtmlDocument].
5687 /// @domName Document.webkitIsFullScreen; @docsEditable true 5833 /// @domName Document.webkitIsFullScreen; @docsEditable true
5688 @JSName('webkitIsFullScreen') 5834 @JSName('webkitIsFullScreen')
5689 final bool $dom_webkitIsFullScreen; 5835 final bool $dom_webkitIsFullScreen;
5690 5836
5837 /// Moved to [HtmlDocument].
5691 /// @domName Document.webkitPointerLockElement; @docsEditable true 5838 /// @domName Document.webkitPointerLockElement; @docsEditable true
5692 @JSName('webkitPointerLockElement') 5839 @JSName('webkitPointerLockElement')
5693 final Element $dom_webkitPointerLockElement; 5840 final Element $dom_webkitPointerLockElement;
5694 5841
5842 /// Moved to [HtmlDocument].
5695 /// @domName Document.webkitVisibilityState; @docsEditable true 5843 /// @domName Document.webkitVisibilityState; @docsEditable true
5696 @JSName('webkitVisibilityState') 5844 @JSName('webkitVisibilityState')
5697 final String $dom_webkitVisibilityState; 5845 final String $dom_webkitVisibilityState;
5698 5846
5847 /// Use the [Range] constructor instead.
5699 /// @domName Document.caretRangeFromPoint; @docsEditable true 5848 /// @domName Document.caretRangeFromPoint; @docsEditable true
5700 @JSName('caretRangeFromPoint') 5849 @JSName('caretRangeFromPoint')
5701 Range $dom_caretRangeFromPoint(int x, int y) native; 5850 Range $dom_caretRangeFromPoint(int x, int y) native;
5702 5851
5703 /// @domName Document.createCDATASection; @docsEditable true 5852 /// @domName Document.createCDATASection; @docsEditable true
5704 @JSName('createCDATASection') 5853 @JSName('createCDATASection')
5705 CDataSection createCDataSection(String data) native; 5854 CDataSection createCDataSection(String data) native;
5706 5855
5707 /// @domName Document.createDocumentFragment; @docsEditable true 5856 /// @domName Document.createDocumentFragment; @docsEditable true
5708 DocumentFragment createDocumentFragment() native; 5857 DocumentFragment createDocumentFragment() native;
5709 5858
5859 /// Deprecated: use new Element.tag(tagName) instead.
5710 /// @domName Document.createElement; @docsEditable true 5860 /// @domName Document.createElement; @docsEditable true
5711 @JSName('createElement') 5861 @JSName('createElement')
5712 Element $dom_createElement(String tagName) native; 5862 Element $dom_createElement(String tagName) native;
5713 5863
5714 /// @domName Document.createElementNS; @docsEditable true 5864 /// @domName Document.createElementNS; @docsEditable true
5715 @JSName('createElementNS') 5865 @JSName('createElementNS')
5716 Element $dom_createElementNS(String namespaceURI, String qualifiedName) native ; 5866 Element $dom_createElementNS(String namespaceURI, String qualifiedName) native ;
5717 5867
5718 /// @domName Document.createEvent; @docsEditable true 5868 /// @domName Document.createEvent; @docsEditable true
5719 @JSName('createEvent') 5869 @JSName('createEvent')
5720 Event $dom_createEvent(String eventType) native; 5870 Event $dom_createEvent(String eventType) native;
5721 5871
5722 /// @domName Document.createRange; @docsEditable true 5872 /// @domName Document.createRange; @docsEditable true
5723 @JSName('createRange') 5873 @JSName('createRange')
5724 Range $dom_createRange() native; 5874 Range $dom_createRange() native;
5725 5875
5726 /// @domName Document.createTextNode; @docsEditable true 5876 /// @domName Document.createTextNode; @docsEditable true
5727 @JSName('createTextNode') 5877 @JSName('createTextNode')
5728 Text $dom_createTextNode(String data) native; 5878 Text $dom_createTextNode(String data) native;
5729 5879
5730 /// @domName Document.createTouch; @docsEditable true 5880 /// @domName Document.createTouch; @docsEditable true
5731 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) { 5881 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) {
5732 var target_1 = _convertDartToNative_EventTarget(target); 5882 var target_1 = _convertDartToNative_EventTarget(target);
5733 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce); 5883 return _$dom_createTouch_1(window, target_1, identifier, pageX, pageY, scree nX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce);
5734 } 5884 }
5735 @JSName('createTouch') 5885 @JSName('createTouch')
5736 Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY , screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitFor ce) native; 5886 Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY , screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitFor ce) native;
5737 5887
5888 /// Use the [TouchList] constructor isntead.
5738 /// @domName Document.createTouchList; @docsEditable true 5889 /// @domName Document.createTouchList; @docsEditable true
5739 @JSName('createTouchList') 5890 @JSName('createTouchList')
5740 TouchList $dom_createTouchList() native; 5891 TouchList $dom_createTouchList() native;
5741 5892
5893 /// Moved to [HtmlDocument].
5742 /// @domName Document.elementFromPoint; @docsEditable true 5894 /// @domName Document.elementFromPoint; @docsEditable true
5743 @JSName('elementFromPoint') 5895 @JSName('elementFromPoint')
5744 Element $dom_elementFromPoint(int x, int y) native; 5896 Element $dom_elementFromPoint(int x, int y) native;
5745 5897
5746 /// @domName Document.execCommand; @docsEditable true 5898 /// @domName Document.execCommand; @docsEditable true
5747 bool execCommand(String command, bool userInterface, String value) native; 5899 bool execCommand(String command, bool userInterface, String value) native;
5748 5900
5749 /// @domName Document.getCSSCanvasContext; @docsEditable true 5901 /// @domName Document.getCSSCanvasContext; @docsEditable true
5750 @JSName('getCSSCanvasContext') 5902 @JSName('getCSSCanvasContext')
5751 CanvasRenderingContext $dom_getCssCanvasContext(String contextId, String name, int width, int height) native; 5903 CanvasRenderingContext $dom_getCssCanvasContext(String contextId, String name, int width, int height) native;
5752 5904
5905 /// Deprecated: use query("#$elementId") instead.
5753 /// @domName Document.getElementById; @docsEditable true 5906 /// @domName Document.getElementById; @docsEditable true
5754 @JSName('getElementById') 5907 @JSName('getElementById')
5755 Element $dom_getElementById(String elementId) native; 5908 Element $dom_getElementById(String elementId) native;
5756 5909
5757 /// @domName Document.getElementsByClassName; @docsEditable true 5910 /// @domName Document.getElementsByClassName; @docsEditable true
5758 @JSName('getElementsByClassName') 5911 @JSName('getElementsByClassName')
5759 @Returns('NodeList') @Creates('NodeList') 5912 @Returns('NodeList') @Creates('NodeList')
5760 List<Node> $dom_getElementsByClassName(String tagname) native; 5913 List<Node> $dom_getElementsByClassName(String tagname) native;
5761 5914
5762 /// @domName Document.getElementsByName; @docsEditable true 5915 /// @domName Document.getElementsByName; @docsEditable true
(...skipping 14 matching lines...) Expand all
5777 5930
5778 /// @domName Document.queryCommandState; @docsEditable true 5931 /// @domName Document.queryCommandState; @docsEditable true
5779 bool queryCommandState(String command) native; 5932 bool queryCommandState(String command) native;
5780 5933
5781 /// @domName Document.queryCommandSupported; @docsEditable true 5934 /// @domName Document.queryCommandSupported; @docsEditable true
5782 bool queryCommandSupported(String command) native; 5935 bool queryCommandSupported(String command) native;
5783 5936
5784 /// @domName Document.queryCommandValue; @docsEditable true 5937 /// @domName Document.queryCommandValue; @docsEditable true
5785 String queryCommandValue(String command) native; 5938 String queryCommandValue(String command) native;
5786 5939
5940 /// Deprecated: renamed to the shorter name [query].
5787 /// @domName Document.querySelector; @docsEditable true 5941 /// @domName Document.querySelector; @docsEditable true
5788 @JSName('querySelector') 5942 @JSName('querySelector')
5789 Element $dom_querySelector(String selectors) native; 5943 Element $dom_querySelector(String selectors) native;
5790 5944
5945 /// Deprecated: use query("#$elementId") instead.
5791 /// @domName Document.querySelectorAll; @docsEditable true 5946 /// @domName Document.querySelectorAll; @docsEditable true
5792 @JSName('querySelectorAll') 5947 @JSName('querySelectorAll')
5793 @Returns('NodeList') @Creates('NodeList') 5948 @Returns('NodeList') @Creates('NodeList')
5794 List<Node> $dom_querySelectorAll(String selectors) native; 5949 List<Node> $dom_querySelectorAll(String selectors) native;
5795 5950
5951 /// Moved to [HtmlDocument].
5796 /// @domName Document.webkitCancelFullScreen; @docsEditable true 5952 /// @domName Document.webkitCancelFullScreen; @docsEditable true
5797 @JSName('webkitCancelFullScreen') 5953 @JSName('webkitCancelFullScreen')
5798 void $dom_webkitCancelFullScreen() native; 5954 void $dom_webkitCancelFullScreen() native;
5799 5955
5956 /// Moved to [HtmlDocument].
5800 /// @domName Document.webkitExitFullscreen; @docsEditable true 5957 /// @domName Document.webkitExitFullscreen; @docsEditable true
5801 @JSName('webkitExitFullscreen') 5958 @JSName('webkitExitFullscreen')
5802 void $dom_webkitExitFullscreen() native; 5959 void $dom_webkitExitFullscreen() native;
5803 5960
5961 /// Moved to [HtmlDocument].
5804 /// @domName Document.webkitExitPointerLock; @docsEditable true 5962 /// @domName Document.webkitExitPointerLock; @docsEditable true
5805 @JSName('webkitExitPointerLock') 5963 @JSName('webkitExitPointerLock')
5806 void $dom_webkitExitPointerLock() native; 5964 void $dom_webkitExitPointerLock() native;
5807 5965
5808 5966
5809 /** 5967 /**
5810 * Finds the first descendant element of this document that matches the 5968 * Finds the first descendant element of this document that matches the
5811 * specified group of selectors. 5969 * specified group of selectors.
5812 * 5970 *
5813 * Unless your webpage contains multiple documents, the top-level query 5971 * Unless your webpage contains multiple documents, the top-level query
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
6437 DomMimeType get first { 6595 DomMimeType get first {
6438 if (this.length > 0) return this[0]; 6596 if (this.length > 0) return this[0];
6439 throw new StateError("No elements"); 6597 throw new StateError("No elements");
6440 } 6598 }
6441 6599
6442 DomMimeType get last { 6600 DomMimeType get last {
6443 if (this.length > 0) return this[this.length - 1]; 6601 if (this.length > 0) return this[this.length - 1];
6444 throw new StateError("No elements"); 6602 throw new StateError("No elements");
6445 } 6603 }
6446 6604
6605 DomMimeType get single {
6606 if (length == 1) return this[0];
6607 if (length == 0) throw new StateError("No elements");
6608 throw new StateError("More than one element");
6609 }
6610
6611 DomMimeType min([int compare(DomMimeType a, DomMimeType b)]) => _Collections.m inInList(this, compare);
6612
6613 DomMimeType max([int compare(DomMimeType a, DomMimeType b)]) => _Collections.m axInList(this, compare);
6614
6447 DomMimeType removeAt(int pos) { 6615 DomMimeType removeAt(int pos) {
6448 throw new UnsupportedError("Cannot removeAt on immutable List."); 6616 throw new UnsupportedError("Cannot removeAt on immutable List.");
6449 } 6617 }
6450 6618
6451 DomMimeType removeLast() { 6619 DomMimeType removeLast() {
6452 throw new UnsupportedError("Cannot removeLast on immutable List."); 6620 throw new UnsupportedError("Cannot removeLast on immutable List.");
6453 } 6621 }
6454 6622
6455 void setRange(int start, int rangeLength, List<DomMimeType> from, [int startFr om]) { 6623 void setRange(int start, int rangeLength, List<DomMimeType> from, [int startFr om]) {
6456 throw new UnsupportedError("Cannot setRange on immutable List."); 6624 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
6629 DomPlugin get first { 6797 DomPlugin get first {
6630 if (this.length > 0) return this[0]; 6798 if (this.length > 0) return this[0];
6631 throw new StateError("No elements"); 6799 throw new StateError("No elements");
6632 } 6800 }
6633 6801
6634 DomPlugin get last { 6802 DomPlugin get last {
6635 if (this.length > 0) return this[this.length - 1]; 6803 if (this.length > 0) return this[this.length - 1];
6636 throw new StateError("No elements"); 6804 throw new StateError("No elements");
6637 } 6805 }
6638 6806
6807 DomPlugin get single {
6808 if (length == 1) return this[0];
6809 if (length == 0) throw new StateError("No elements");
6810 throw new StateError("More than one element");
6811 }
6812
6813 DomPlugin min([int compare(DomPlugin a, DomPlugin b)]) => _Collections.minInLi st(this, compare);
6814
6815 DomPlugin max([int compare(DomPlugin a, DomPlugin b)]) => _Collections.maxInLi st(this, compare);
6816
6639 DomPlugin removeAt(int pos) { 6817 DomPlugin removeAt(int pos) {
6640 throw new UnsupportedError("Cannot removeAt on immutable List."); 6818 throw new UnsupportedError("Cannot removeAt on immutable List.");
6641 } 6819 }
6642 6820
6643 DomPlugin removeLast() { 6821 DomPlugin removeLast() {
6644 throw new UnsupportedError("Cannot removeLast on immutable List."); 6822 throw new UnsupportedError("Cannot removeLast on immutable List.");
6645 } 6823 }
6646 6824
6647 void setRange(int start, int rangeLength, List<DomPlugin> from, [int startFrom ]) { 6825 void setRange(int start, int rangeLength, List<DomPlugin> from, [int startFrom ]) {
6648 throw new UnsupportedError("Cannot setRange on immutable List."); 6826 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
6881 String get first { 7059 String get first {
6882 if (this.length > 0) return this[0]; 7060 if (this.length > 0) return this[0];
6883 throw new StateError("No elements"); 7061 throw new StateError("No elements");
6884 } 7062 }
6885 7063
6886 String get last { 7064 String get last {
6887 if (this.length > 0) return this[this.length - 1]; 7065 if (this.length > 0) return this[this.length - 1];
6888 throw new StateError("No elements"); 7066 throw new StateError("No elements");
6889 } 7067 }
6890 7068
7069 String get single {
7070 if (length == 1) return this[0];
7071 if (length == 0) throw new StateError("No elements");
7072 throw new StateError("More than one element");
7073 }
7074
7075 String min([int compare(String a, String b)]) => _Collections.minInList(this, compare);
7076
7077 String max([int compare(String a, String b)]) => _Collections.maxInList(this, compare);
7078
6891 String removeAt(int pos) { 7079 String removeAt(int pos) {
6892 throw new UnsupportedError("Cannot removeAt on immutable List."); 7080 throw new UnsupportedError("Cannot removeAt on immutable List.");
6893 } 7081 }
6894 7082
6895 String removeLast() { 7083 String removeLast() {
6896 throw new UnsupportedError("Cannot removeLast on immutable List."); 7084 throw new UnsupportedError("Cannot removeLast on immutable List.");
6897 } 7085 }
6898 7086
6899 void setRange(int start, int rangeLength, List<String> from, [int startFrom]) { 7087 void setRange(int start, int rangeLength, List<String> from, [int startFrom]) {
6900 throw new UnsupportedError("Cannot setRange on immutable List."); 7088 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
7147 if (result == null) throw new StateError("No elements"); 7335 if (result == null) throw new StateError("No elements");
7148 return result; 7336 return result;
7149 } 7337 }
7150 7338
7151 7339
7152 Element get last { 7340 Element get last {
7153 Element result = _element.$dom_lastElementChild; 7341 Element result = _element.$dom_lastElementChild;
7154 if (result == null) throw new StateError("No elements"); 7342 if (result == null) throw new StateError("No elements");
7155 return result; 7343 return result;
7156 } 7344 }
7345
7346 Element get single {
7347 if (length > 1) throw new StateError("More than one element");
7348 return first;
7349 }
7350
7351 Element min([int compare(Element a, Element b)]) {
7352 return _Collections.minInList(this, compare);
7353 }
7354
7355 Element max([int compare(Element a, Element b)]) {
7356 return _Collections.maxInList(this, compare);
7357 }
7157 } 7358 }
7158 7359
7159 // TODO(jacobr): this is an inefficient implementation but it is hard to see 7360 // TODO(jacobr): this is an inefficient implementation but it is hard to see
7160 // a better option given that we cannot quite force NodeList to be an 7361 // a better option given that we cannot quite force NodeList to be an
7161 // ElementList as there are valid cases where a NodeList JavaScript object 7362 // ElementList as there are valid cases where a NodeList JavaScript object
7162 // contains Node objects that are not Elements. 7363 // contains Node objects that are not Elements.
7163 class _FrozenElementList implements List { 7364 class _FrozenElementList implements List {
7164 final List<Node> _nodeList; 7365 final List<Node> _nodeList;
7165 7366
7166 _FrozenElementList._wrap(this._nodeList); 7367 _FrozenElementList._wrap(this._nodeList);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
7305 throw new UnsupportedError(''); 7506 throw new UnsupportedError('');
7306 } 7507 }
7307 7508
7308 Element removeLast() { 7509 Element removeLast() {
7309 throw new UnsupportedError(''); 7510 throw new UnsupportedError('');
7310 } 7511 }
7311 7512
7312 Element get first => _nodeList.first; 7513 Element get first => _nodeList.first;
7313 7514
7314 Element get last => _nodeList.last; 7515 Element get last => _nodeList.last;
7516
7517 Element get single => _nodeList.single;
7518
7519 Element min([int compare(Element a, Element b)]) {
7520 return _Collections.minInList(this, compare);
7521 }
7522
7523 Element max([int compare(Element a, Element b)]) {
7524 return _Collections.maxInList(this, compare);
7525 }
7315 } 7526 }
7316 7527
7317 class _FrozenElementListIterator implements Iterator<Element> { 7528 class _FrozenElementListIterator implements Iterator<Element> {
7318 final _FrozenElementList _list; 7529 final _FrozenElementList _list;
7319 int _index = 0; 7530 int _index = 0;
7320 7531
7321 _FrozenElementListIterator(this._list); 7532 _FrozenElementListIterator(this._list);
7322 7533
7323 /** 7534 /**
7324 * Moves to the next element. Returns true if the iterator is positioned 7535 * Moves to the next element. Returns true if the iterator is positioned
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
8936 File get first { 9147 File get first {
8937 if (this.length > 0) return this[0]; 9148 if (this.length > 0) return this[0];
8938 throw new StateError("No elements"); 9149 throw new StateError("No elements");
8939 } 9150 }
8940 9151
8941 File get last { 9152 File get last {
8942 if (this.length > 0) return this[this.length - 1]; 9153 if (this.length > 0) return this[this.length - 1];
8943 throw new StateError("No elements"); 9154 throw new StateError("No elements");
8944 } 9155 }
8945 9156
9157 File get single {
9158 if (length == 1) return this[0];
9159 if (length == 0) throw new StateError("No elements");
9160 throw new StateError("More than one element");
9161 }
9162
9163 File min([int compare(File a, File b)]) => _Collections.minInList(this, compar e);
9164
9165 File max([int compare(File a, File b)]) => _Collections.maxInList(this, compar e);
9166
8946 File removeAt(int pos) { 9167 File removeAt(int pos) {
8947 throw new UnsupportedError("Cannot removeAt on immutable List."); 9168 throw new UnsupportedError("Cannot removeAt on immutable List.");
8948 } 9169 }
8949 9170
8950 File removeLast() { 9171 File removeLast() {
8951 throw new UnsupportedError("Cannot removeLast on immutable List."); 9172 throw new UnsupportedError("Cannot removeLast on immutable List.");
8952 } 9173 }
8953 9174
8954 void setRange(int start, int rangeLength, List<File> from, [int startFrom]) { 9175 void setRange(int start, int rangeLength, List<File> from, [int startFrom]) {
8955 throw new UnsupportedError("Cannot setRange on immutable List."); 9176 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
9345 num get first { 9566 num get first {
9346 if (this.length > 0) return this[0]; 9567 if (this.length > 0) return this[0];
9347 throw new StateError("No elements"); 9568 throw new StateError("No elements");
9348 } 9569 }
9349 9570
9350 num get last { 9571 num get last {
9351 if (this.length > 0) return this[this.length - 1]; 9572 if (this.length > 0) return this[this.length - 1];
9352 throw new StateError("No elements"); 9573 throw new StateError("No elements");
9353 } 9574 }
9354 9575
9576 num get single {
9577 if (length == 1) return this[0];
9578 if (length == 0) throw new StateError("No elements");
9579 throw new StateError("More than one element");
9580 }
9581
9582 num min([int compare(num a, num b)]) => _Collections.minInList(this, compare);
9583
9584 num max([int compare(num a, num b)]) => _Collections.maxInList(this, compare);
9585
9355 num removeAt(int pos) { 9586 num removeAt(int pos) {
9356 throw new UnsupportedError("Cannot removeAt on immutable List."); 9587 throw new UnsupportedError("Cannot removeAt on immutable List.");
9357 } 9588 }
9358 9589
9359 num removeLast() { 9590 num removeLast() {
9360 throw new UnsupportedError("Cannot removeLast on immutable List."); 9591 throw new UnsupportedError("Cannot removeLast on immutable List.");
9361 } 9592 }
9362 9593
9363 void setRange(int start, int rangeLength, List<num> from, [int startFrom]) { 9594 void setRange(int start, int rangeLength, List<num> from, [int startFrom]) {
9364 throw new UnsupportedError("Cannot setRange on immutable List."); 9595 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
9506 num get first { 9737 num get first {
9507 if (this.length > 0) return this[0]; 9738 if (this.length > 0) return this[0];
9508 throw new StateError("No elements"); 9739 throw new StateError("No elements");
9509 } 9740 }
9510 9741
9511 num get last { 9742 num get last {
9512 if (this.length > 0) return this[this.length - 1]; 9743 if (this.length > 0) return this[this.length - 1];
9513 throw new StateError("No elements"); 9744 throw new StateError("No elements");
9514 } 9745 }
9515 9746
9747 num get single {
9748 if (length == 1) return this[0];
9749 if (length == 0) throw new StateError("No elements");
9750 throw new StateError("More than one element");
9751 }
9752
9753 num min([int compare(num a, num b)]) => _Collections.minInList(this, compare);
9754
9755 num max([int compare(num a, num b)]) => _Collections.maxInList(this, compare);
9756
9516 num removeAt(int pos) { 9757 num removeAt(int pos) {
9517 throw new UnsupportedError("Cannot removeAt on immutable List."); 9758 throw new UnsupportedError("Cannot removeAt on immutable List.");
9518 } 9759 }
9519 9760
9520 num removeLast() { 9761 num removeLast() {
9521 throw new UnsupportedError("Cannot removeLast on immutable List."); 9762 throw new UnsupportedError("Cannot removeLast on immutable List.");
9522 } 9763 }
9523 9764
9524 void setRange(int start, int rangeLength, List<num> from, [int startFrom]) { 9765 void setRange(int start, int rangeLength, List<num> from, [int startFrom]) {
9525 throw new UnsupportedError("Cannot setRange on immutable List."); 9766 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
9994 Node get first { 10235 Node get first {
9995 if (this.length > 0) return this[0]; 10236 if (this.length > 0) return this[0];
9996 throw new StateError("No elements"); 10237 throw new StateError("No elements");
9997 } 10238 }
9998 10239
9999 Node get last { 10240 Node get last {
10000 if (this.length > 0) return this[this.length - 1]; 10241 if (this.length > 0) return this[this.length - 1];
10001 throw new StateError("No elements"); 10242 throw new StateError("No elements");
10002 } 10243 }
10003 10244
10245 Node get single {
10246 if (length == 1) return this[0];
10247 if (length == 0) throw new StateError("No elements");
10248 throw new StateError("More than one element");
10249 }
10250
10251 Node min([int compare(Node a, Node b)]) => _Collections.minInList(this, compar e);
10252
10253 Node max([int compare(Node a, Node b)]) => _Collections.maxInList(this, compar e);
10254
10004 Node removeAt(int pos) { 10255 Node removeAt(int pos) {
10005 throw new UnsupportedError("Cannot removeAt on immutable List."); 10256 throw new UnsupportedError("Cannot removeAt on immutable List.");
10006 } 10257 }
10007 10258
10008 Node removeLast() { 10259 Node removeLast() {
10009 throw new UnsupportedError("Cannot removeLast on immutable List."); 10260 throw new UnsupportedError("Cannot removeLast on immutable List.");
10010 } 10261 }
10011 10262
10012 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { 10263 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
10013 throw new UnsupportedError("Cannot setRange on immutable List."); 10264 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
10150 Node get first { 10401 Node get first {
10151 if (this.length > 0) return this[0]; 10402 if (this.length > 0) return this[0];
10152 throw new StateError("No elements"); 10403 throw new StateError("No elements");
10153 } 10404 }
10154 10405
10155 Node get last { 10406 Node get last {
10156 if (this.length > 0) return this[this.length - 1]; 10407 if (this.length > 0) return this[this.length - 1];
10157 throw new StateError("No elements"); 10408 throw new StateError("No elements");
10158 } 10409 }
10159 10410
10411 Node get single {
10412 if (length == 1) return this[0];
10413 if (length == 0) throw new StateError("No elements");
10414 throw new StateError("More than one element");
10415 }
10416
10417 Node min([int compare(Node a, Node b)]) => _Collections.minInList(this, compar e);
10418
10419 Node max([int compare(Node a, Node b)]) => _Collections.maxInList(this, compar e);
10420
10160 Node removeAt(int pos) { 10421 Node removeAt(int pos) {
10161 throw new UnsupportedError("Cannot removeAt on immutable List."); 10422 throw new UnsupportedError("Cannot removeAt on immutable List.");
10162 } 10423 }
10163 10424
10164 Node removeLast() { 10425 Node removeLast() {
10165 throw new UnsupportedError("Cannot removeLast on immutable List."); 10426 throw new UnsupportedError("Cannot removeLast on immutable List.");
10166 } 10427 }
10167 10428
10168 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { 10429 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
10169 throw new UnsupportedError("Cannot setRange on immutable List."); 10430 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
10372 * [onComplete] callback. 10633 * [onComplete] callback.
10373 * 10634 *
10374 * See also: (authorization headers)[http://en.wikipedia.org/wiki/Basic_access _authentication]. 10635 * See also: (authorization headers)[http://en.wikipedia.org/wiki/Basic_access _authentication].
10375 */ 10636 */
10376 factory HttpRequest.getWithCredentials(String url, 10637 factory HttpRequest.getWithCredentials(String url,
10377 onComplete(HttpRequest request)) => 10638 onComplete(HttpRequest request)) =>
10378 _HttpRequestFactoryProvider.createHttpRequest_getWithCredentials(url, 10639 _HttpRequestFactoryProvider.createHttpRequest_getWithCredentials(url,
10379 onComplete); 10640 onComplete);
10380 10641
10381 10642
10643 /**
10644 * General constructor for any type of request (GET, POST, etc).
10645 *
10646 * This call is used in conjunction with [open]:
10647 *
10648 * var request = new HttpRequest();
10649 * request.open('GET', 'http://dartlang.org')
10650 * request.on.load.add((event) => print('Request complete'));
10651 *
10652 * is the (more verbose) equivalent of
10653 *
10654 * var request = new HttpRequest.get('http://dartlang.org',
10655 * (event) => print('Request complete'));
10656 */
10382 ///@docsEditable true 10657 ///@docsEditable true
10383 factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest(); 10658 factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest();
10384 10659
10660 /**
10661 * Get the set of [HttpRequestEvents] that this request can respond to.
10662 * Usually used when adding an EventListener, such as in
10663 * `document.window.on.keyDown.add((e) => print('keydown happened'))`.
10664 */
10385 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 10665 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10386 HttpRequestEvents get on => 10666 HttpRequestEvents get on =>
10387 new HttpRequestEvents(this); 10667 new HttpRequestEvents(this);
10388 10668
10389 static const int DONE = 4; 10669 static const int DONE = 4;
10390 10670
10391 static const int HEADERS_RECEIVED = 2; 10671 static const int HEADERS_RECEIVED = 2;
10392 10672
10393 static const int LOADING = 3; 10673 static const int LOADING = 3;
10394 10674
10395 static const int OPENED = 1; 10675 static const int OPENED = 1;
10396 10676
10397 static const int UNSENT = 0; 10677 static const int UNSENT = 0;
10398 10678
10679 /**
10680 * Indicator of the current state of the request:
10681 *
10682 * <table>
10683 * <tr>
10684 * <td>Value</td>
10685 * <td>State</td>
10686 * <td>Meaning</td>
10687 * </tr>
10688 * <tr>
10689 * <td>0</td>
10690 * <td>unsent</td>
10691 * <td><code>open()</code> has not yet been called</td>
10692 * </tr>
10693 * <tr>
10694 * <td>1</td>
10695 * <td>opened</td>
10696 * <td><code>send()</code> has not yet been called</td>
10697 * </tr>
10698 * <tr>
10699 * <td>2</td>
10700 * <td>headers received</td>
10701 * <td><code>sent()</code> has been called; response headers and <code>sta tus</code> are available</td>
10702 * </tr>
10703 * <tr>
10704 * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some da ta</td>
10705 * </tr>
10706 * <tr>
10707 * <td>4</td> <td>done</td> <td>request is complete</td>
10708 * </tr>
10709 * </table>
10710 */
10399 /// @domName XMLHttpRequest.readyState; @docsEditable true 10711 /// @domName XMLHttpRequest.readyState; @docsEditable true
10400 final int readyState; 10712 final int readyState;
10401 10713
10714 /**
10715 * The data received as a reponse from the request.
10716 *
10717 * The data could be in the
10718 * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
10719 * [String]). `null` indicates request failure.
10720 */
10402 /// @domName XMLHttpRequest.response; @docsEditable true 10721 /// @domName XMLHttpRequest.response; @docsEditable true
10403 @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num') 10722 @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')
10404 final Object response; 10723 final Object response;
10405 10724
10725 /**
10726 * The response in string form or null on failure.
10727 */
10406 /// @domName XMLHttpRequest.responseText; @docsEditable true 10728 /// @domName XMLHttpRequest.responseText; @docsEditable true
10407 final String responseText; 10729 final String responseText;
10408 10730
10731 /**
10732 * [String] telling the server the desired response format.
10733 *
10734 * Default is `String`.
10735 * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
10736 * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
10737 * `responseType` is set while performing a synchronous request.
10738 *
10739 * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/X MLHttpRequest#responseType)
10740 */
10409 /// @domName XMLHttpRequest.responseType; @docsEditable true 10741 /// @domName XMLHttpRequest.responseType; @docsEditable true
10410 String responseType; 10742 String responseType;
10411 10743
10744 /**
10745 * The request response, or null on failure.
10746 *
10747 * The response is processed as
10748 * `text/xml` stream, unless responseType = 'document' and the request is
10749 * synchronous.
10750 */
10412 /// @domName XMLHttpRequest.responseXML; @docsEditable true 10751 /// @domName XMLHttpRequest.responseXML; @docsEditable true
10413 @JSName('responseXML') 10752 @JSName('responseXML')
10414 final Document responseXml; 10753 final Document responseXml;
10415 10754
10755 /**
10756 * The http result code from the request (200, 404, etc).
10757 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
10758 */
10416 /// @domName XMLHttpRequest.status; @docsEditable true 10759 /// @domName XMLHttpRequest.status; @docsEditable true
10417 final int status; 10760 final int status;
10418 10761
10762 /**
10763 * The request response string (such as "200 OK").
10764 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
10765 */
10419 /// @domName XMLHttpRequest.statusText; @docsEditable true 10766 /// @domName XMLHttpRequest.statusText; @docsEditable true
10420 final String statusText; 10767 final String statusText;
10421 10768
10769 /**
10770 * [EventTarget] that can hold listeners to track the progress of the request.
10771 * The events fired will be members of [HttpRequestUploadEvents].
10772 */
10422 /// @domName XMLHttpRequest.upload; @docsEditable true 10773 /// @domName XMLHttpRequest.upload; @docsEditable true
10423 final HttpRequestUpload upload; 10774 final HttpRequestUpload upload;
10424 10775
10776 /**
10777 * True if cross-site requests should use credentials such as cookies
10778 * or authorization headers; false otherwise.
10779 *
10780 * This value is ignored for same-site requests.
10781 */
10425 /// @domName XMLHttpRequest.withCredentials; @docsEditable true 10782 /// @domName XMLHttpRequest.withCredentials; @docsEditable true
10426 bool withCredentials; 10783 bool withCredentials;
10427 10784
10785 /**
10786 * Stop the current request.
10787 *
10788 * The request can only be stopped if readyState is `HEADERS_RECIEVED` or
10789 * `LOADING`. If this method is not in the process of being sent, the method
10790 * has no effect.
10791 */
10428 /// @domName XMLHttpRequest.abort; @docsEditable true 10792 /// @domName XMLHttpRequest.abort; @docsEditable true
10429 void abort() native; 10793 void abort() native;
10430 10794
10431 /// @domName XMLHttpRequest.addEventListener; @docsEditable true 10795 /// @domName XMLHttpRequest.addEventListener; @docsEditable true
10432 @JSName('addEventListener') 10796 @JSName('addEventListener')
10433 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 10797 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
10434 10798
10435 /// @domName XMLHttpRequest.dispatchEvent; @docsEditable true 10799 /// @domName XMLHttpRequest.dispatchEvent; @docsEditable true
10436 @JSName('dispatchEvent') 10800 @JSName('dispatchEvent')
10437 bool $dom_dispatchEvent(Event evt) native; 10801 bool $dom_dispatchEvent(Event evt) native;
10438 10802
10803 /**
10804 * Retrieve all the response headers from a request.
10805 *
10806 * `null` if no headers have been received. For multipart requests,
10807 * `getAllResponseHeaders` will return the response headers for the current
10808 * part of the request.
10809 *
10810 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
10811 * for a list of common response headers.
10812 */
10439 /// @domName XMLHttpRequest.getAllResponseHeaders; @docsEditable true 10813 /// @domName XMLHttpRequest.getAllResponseHeaders; @docsEditable true
10440 String getAllResponseHeaders() native; 10814 String getAllResponseHeaders() native;
10441 10815
10816 /**
10817 * Return the response header named `header`, or `null` if not found.
10818 *
10819 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
10820 * for a list of common response headers.
10821 */
10442 /// @domName XMLHttpRequest.getResponseHeader; @docsEditable true 10822 /// @domName XMLHttpRequest.getResponseHeader; @docsEditable true
10443 String getResponseHeader(String header) native; 10823 String getResponseHeader(String header) native;
10444 10824
10825 /**
10826 * Specify the desired `url`, and `method` to use in making the request.
10827 *
10828 * By default the request is done asyncronously, with no user or password
10829 * authentication information. If `async` is false, the request will be send
10830 * synchronously.
10831 *
10832 * Calling `open` again on a currently active request is equivalent to
10833 * calling `abort`.
10834 */
10445 /// @domName XMLHttpRequest.open; @docsEditable true 10835 /// @domName XMLHttpRequest.open; @docsEditable true
10446 void open(String method, String url, [bool async, String user, String password ]) native; 10836 void open(String method, String url, [bool async, String user, String password ]) native;
10447 10837
10838 /**
10839 * Specify a particular MIME type (such as `text/xml`) desired for the
10840 * response.
10841 *
10842 * This value must be set before the request has been sent. See also the list
10843 * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#Lis t_of_common_media_types)
10844 */
10448 /// @domName XMLHttpRequest.overrideMimeType; @docsEditable true 10845 /// @domName XMLHttpRequest.overrideMimeType; @docsEditable true
10449 void overrideMimeType(String override) native; 10846 void overrideMimeType(String override) native;
10450 10847
10451 /// @domName XMLHttpRequest.removeEventListener; @docsEditable true 10848 /// @domName XMLHttpRequest.removeEventListener; @docsEditable true
10452 @JSName('removeEventListener') 10849 @JSName('removeEventListener')
10453 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 10850 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
10454 10851
10852 /**
10853 * Send the request with any given `data`.
10854 *
10855 * See also:
10856 * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#s end())
10857 * from MDN.
10858 */
10455 /// @domName XMLHttpRequest.send; @docsEditable true 10859 /// @domName XMLHttpRequest.send; @docsEditable true
10456 void send([data]) native; 10860 void send([data]) native;
10457 10861
10862 /** Sets HTTP `header` to `value`. */
10458 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true 10863 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true
10459 void setRequestHeader(String header, String value) native; 10864 void setRequestHeader(String header, String value) native;
10460 10865
10461 } 10866 }
10462 10867
10868 /**
10869 * A class that supports listening for and dispatching events that can fire when
10870 * making an HTTP request.
10871 *
10872 * Here's an example of adding an event handler that executes once an HTTP
10873 * request has fully loaded:
10874 *
10875 * httpRequest.on.loadEnd.add((e) => myCustomLoadEndHandler(e));
10876 *
10877 * Each property of this class is a read-only pointer to an [EventListenerList].
10878 * That list holds all of the [EventListener]s that have registered for that
10879 * particular type of event that fires from an HttpRequest.
10880 */
10463 /// @docsEditable true 10881 /// @docsEditable true
10464 class HttpRequestEvents extends Events { 10882 class HttpRequestEvents extends Events {
10465 /// @docsEditable true 10883 /// @docsEditable true
10466 HttpRequestEvents(EventTarget _ptr) : super(_ptr); 10884 HttpRequestEvents(EventTarget _ptr) : super(_ptr);
10467 10885
10886 /**
10887 * Event listeners to be notified when request has been aborted,
10888 * generally due to calling `httpRequest.abort()`.
10889 */
10468 /// @docsEditable true 10890 /// @docsEditable true
10469 EventListenerList get abort => this['abort']; 10891 EventListenerList get abort => this['abort'];
10470 10892
10893 /**
10894 * Event listeners to be notified when a request has failed, such as when a
10895 * cross-domain error occurred or the file wasn't found on the server.
10896 */
10471 /// @docsEditable true 10897 /// @docsEditable true
10472 EventListenerList get error => this['error']; 10898 EventListenerList get error => this['error'];
10473 10899
10900 /**
10901 * Event listeners to be notified once the request has completed
10902 * *successfully*.
10903 */
10474 /// @docsEditable true 10904 /// @docsEditable true
10475 EventListenerList get load => this['load']; 10905 EventListenerList get load => this['load'];
10476 10906
10907 /**
10908 * Event listeners to be notified once the request has completed (on
10909 * either success or failure).
10910 */
10477 /// @docsEditable true 10911 /// @docsEditable true
10478 EventListenerList get loadEnd => this['loadend']; 10912 EventListenerList get loadEnd => this['loadend'];
10479 10913
10914 /**
10915 * Event listeners to be notified when the request starts, once
10916 * `httpRequest.send()` has been called.
10917 */
10480 /// @docsEditable true 10918 /// @docsEditable true
10481 EventListenerList get loadStart => this['loadstart']; 10919 EventListenerList get loadStart => this['loadstart'];
10482 10920
10921 /**
10922 * Event listeners to be notified when data for the request
10923 * is being sent or loaded.
10924 *
10925 * Progress events are fired every 50ms or for every byte transmitted,
10926 * whichever is less frequent.
10927 */
10483 /// @docsEditable true 10928 /// @docsEditable true
10484 EventListenerList get progress => this['progress']; 10929 EventListenerList get progress => this['progress'];
10485 10930
10931 /**
10932 * Event listeners to be notified every time the [HttpRequest]
10933 * object's `readyState` changes values.
10934 */
10486 /// @docsEditable true 10935 /// @docsEditable true
10487 EventListenerList get readyStateChange => this['readystatechange']; 10936 EventListenerList get readyStateChange => this['readystatechange'];
10488 } 10937 }
10489 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10938 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10490 // for details. All rights reserved. Use of this source code is governed by a 10939 // for details. All rights reserved. Use of this source code is governed by a
10491 // BSD-style license that can be found in the LICENSE file. 10940 // BSD-style license that can be found in the LICENSE file.
10492 10941
10493 10942
10494 /// @domName XMLHttpRequestException; @docsEditable true 10943 /// @domName XMLHttpRequestException; @docsEditable true
10495 class HttpRequestException native "*XMLHttpRequestException" { 10944 class HttpRequestException native "*XMLHttpRequestException" {
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
11554 int get first { 12003 int get first {
11555 if (this.length > 0) return this[0]; 12004 if (this.length > 0) return this[0];
11556 throw new StateError("No elements"); 12005 throw new StateError("No elements");
11557 } 12006 }
11558 12007
11559 int get last { 12008 int get last {
11560 if (this.length > 0) return this[this.length - 1]; 12009 if (this.length > 0) return this[this.length - 1];
11561 throw new StateError("No elements"); 12010 throw new StateError("No elements");
11562 } 12011 }
11563 12012
12013 int get single {
12014 if (length == 1) return this[0];
12015 if (length == 0) throw new StateError("No elements");
12016 throw new StateError("More than one element");
12017 }
12018
12019 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
12020
12021 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
12022
11564 int removeAt(int pos) { 12023 int removeAt(int pos) {
11565 throw new UnsupportedError("Cannot removeAt on immutable List."); 12024 throw new UnsupportedError("Cannot removeAt on immutable List.");
11566 } 12025 }
11567 12026
11568 int removeLast() { 12027 int removeLast() {
11569 throw new UnsupportedError("Cannot removeLast on immutable List."); 12028 throw new UnsupportedError("Cannot removeLast on immutable List.");
11570 } 12029 }
11571 12030
11572 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 12031 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
11573 throw new UnsupportedError("Cannot setRange on immutable List."); 12032 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
11715 int get first { 12174 int get first {
11716 if (this.length > 0) return this[0]; 12175 if (this.length > 0) return this[0];
11717 throw new StateError("No elements"); 12176 throw new StateError("No elements");
11718 } 12177 }
11719 12178
11720 int get last { 12179 int get last {
11721 if (this.length > 0) return this[this.length - 1]; 12180 if (this.length > 0) return this[this.length - 1];
11722 throw new StateError("No elements"); 12181 throw new StateError("No elements");
11723 } 12182 }
11724 12183
12184 int get single {
12185 if (length == 1) return this[0];
12186 if (length == 0) throw new StateError("No elements");
12187 throw new StateError("More than one element");
12188 }
12189
12190 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
12191
12192 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
12193
11725 int removeAt(int pos) { 12194 int removeAt(int pos) {
11726 throw new UnsupportedError("Cannot removeAt on immutable List."); 12195 throw new UnsupportedError("Cannot removeAt on immutable List.");
11727 } 12196 }
11728 12197
11729 int removeLast() { 12198 int removeLast() {
11730 throw new UnsupportedError("Cannot removeLast on immutable List."); 12199 throw new UnsupportedError("Cannot removeLast on immutable List.");
11731 } 12200 }
11732 12201
11733 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 12202 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
11734 throw new UnsupportedError("Cannot setRange on immutable List."); 12203 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
11876 int get first { 12345 int get first {
11877 if (this.length > 0) return this[0]; 12346 if (this.length > 0) return this[0];
11878 throw new StateError("No elements"); 12347 throw new StateError("No elements");
11879 } 12348 }
11880 12349
11881 int get last { 12350 int get last {
11882 if (this.length > 0) return this[this.length - 1]; 12351 if (this.length > 0) return this[this.length - 1];
11883 throw new StateError("No elements"); 12352 throw new StateError("No elements");
11884 } 12353 }
11885 12354
12355 int get single {
12356 if (length == 1) return this[0];
12357 if (length == 0) throw new StateError("No elements");
12358 throw new StateError("More than one element");
12359 }
12360
12361 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
12362
12363 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
12364
11886 int removeAt(int pos) { 12365 int removeAt(int pos) {
11887 throw new UnsupportedError("Cannot removeAt on immutable List."); 12366 throw new UnsupportedError("Cannot removeAt on immutable List.");
11888 } 12367 }
11889 12368
11890 int removeLast() { 12369 int removeLast() {
11891 throw new UnsupportedError("Cannot removeLast on immutable List."); 12370 throw new UnsupportedError("Cannot removeLast on immutable List.");
11892 } 12371 }
11893 12372
11894 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 12373 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
11895 throw new UnsupportedError("Cannot setRange on immutable List."); 12374 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
13657 final int totalJSHeapSize; 14136 final int totalJSHeapSize;
13658 14137
13659 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true 14138 /// @domName MemoryInfo.usedJSHeapSize; @docsEditable true
13660 final int usedJSHeapSize; 14139 final int usedJSHeapSize;
13661 } 14140 }
13662 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14141 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13663 // for details. All rights reserved. Use of this source code is governed by a 14142 // for details. All rights reserved. Use of this source code is governed by a
13664 // BSD-style license that can be found in the LICENSE file. 14143 // BSD-style license that can be found in the LICENSE file.
13665 14144
13666 14145
14146 /**
14147 * An HTML <menu> element.
14148 *
14149 * A <menu> element represents an unordered list of menu commands.
14150 *
14151 * See also:
14152 *
14153 * * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
14154 * * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-e lement) from the W3C.
14155 */
13667 /// @domName HTMLMenuElement; @docsEditable true 14156 /// @domName HTMLMenuElement; @docsEditable true
13668 class MenuElement extends Element native "*HTMLMenuElement" { 14157 class MenuElement extends Element native "*HTMLMenuElement" {
13669 14158
13670 ///@docsEditable true 14159 ///@docsEditable true
13671 factory MenuElement() => document.$dom_createElement("menu"); 14160 factory MenuElement() => document.$dom_createElement("menu");
13672 } 14161 }
13673 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14162 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13674 // for details. All rights reserved. Use of this source code is governed by a 14163 // for details. All rights reserved. Use of this source code is governed by a
13675 // BSD-style license that can be found in the LICENSE file. 14164 // BSD-style license that can be found in the LICENSE file.
13676 14165
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
14256 Node get first { 14745 Node get first {
14257 if (this.length > 0) return this[0]; 14746 if (this.length > 0) return this[0];
14258 throw new StateError("No elements"); 14747 throw new StateError("No elements");
14259 } 14748 }
14260 14749
14261 Node get last { 14750 Node get last {
14262 if (this.length > 0) return this[this.length - 1]; 14751 if (this.length > 0) return this[this.length - 1];
14263 throw new StateError("No elements"); 14752 throw new StateError("No elements");
14264 } 14753 }
14265 14754
14755 Node get single {
14756 if (length == 1) return this[0];
14757 if (length == 0) throw new StateError("No elements");
14758 throw new StateError("More than one element");
14759 }
14760
14761 Node min([int compare(Node a, Node b)]) => _Collections.minInList(this, compar e);
14762
14763 Node max([int compare(Node a, Node b)]) => _Collections.maxInList(this, compar e);
14764
14266 Node removeAt(int pos) { 14765 Node removeAt(int pos) {
14267 throw new UnsupportedError("Cannot removeAt on immutable List."); 14766 throw new UnsupportedError("Cannot removeAt on immutable List.");
14268 } 14767 }
14269 14768
14270 Node removeLast() { 14769 Node removeLast() {
14271 throw new UnsupportedError("Cannot removeLast on immutable List."); 14770 throw new UnsupportedError("Cannot removeLast on immutable List.");
14272 } 14771 }
14273 14772
14274 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { 14773 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
14275 throw new UnsupportedError("Cannot setRange on immutable List."); 14774 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
14441 Node get first { 14940 Node get first {
14442 Node result = JS('Node', '#.firstChild', _this); 14941 Node result = JS('Node', '#.firstChild', _this);
14443 if (result == null) throw new StateError("No elements"); 14942 if (result == null) throw new StateError("No elements");
14444 return result; 14943 return result;
14445 } 14944 }
14446 Node get last { 14945 Node get last {
14447 Node result = JS('Node', '#.lastChild', _this); 14946 Node result = JS('Node', '#.lastChild', _this);
14448 if (result == null) throw new StateError("No elements"); 14947 if (result == null) throw new StateError("No elements");
14449 return result; 14948 return result;
14450 } 14949 }
14950 Node get single {
14951 int l = this.length;
14952 if (l == 0) throw new StateError("No elements");
14953 if (l > 1) throw new StateError("More than one element");
14954 return JS('Node', '#.firstChild', _this);
14955 }
14956
14957 Node min([int compare(Node a, Node b)]) {
14958 return _Collections.minInList(this, compare);
14959 }
14960
14961 Node max([int compare(Node a, Node b)]) {
14962 return _Collections.maxInList(this, compare);
14963 }
14451 14964
14452 void add(Node value) { 14965 void add(Node value) {
14453 _this.$dom_appendChild(value); 14966 _this.$dom_appendChild(value);
14454 } 14967 }
14455 14968
14456 void addLast(Node value) { 14969 void addLast(Node value) {
14457 _this.$dom_appendChild(value); 14970 _this.$dom_appendChild(value);
14458 } 14971 }
14459 14972
14460 14973
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
14954 Node get first { 15467 Node get first {
14955 if (this.length > 0) return this[0]; 15468 if (this.length > 0) return this[0];
14956 throw new StateError("No elements"); 15469 throw new StateError("No elements");
14957 } 15470 }
14958 15471
14959 Node get last { 15472 Node get last {
14960 if (this.length > 0) return this[this.length - 1]; 15473 if (this.length > 0) return this[this.length - 1];
14961 throw new StateError("No elements"); 15474 throw new StateError("No elements");
14962 } 15475 }
14963 15476
15477 Node get single {
15478 if (length == 1) return this[0];
15479 if (length == 0) throw new StateError("No elements");
15480 throw new StateError("More than one element");
15481 }
15482
15483 Node min([int compare(Node a, Node b)]) => _Collections.minInList(this, compar e);
15484
15485 Node max([int compare(Node a, Node b)]) => _Collections.maxInList(this, compar e);
15486
14964 Node removeAt(int pos) { 15487 Node removeAt(int pos) {
14965 throw new UnsupportedError("Cannot removeAt on immutable List."); 15488 throw new UnsupportedError("Cannot removeAt on immutable List.");
14966 } 15489 }
14967 15490
14968 Node removeLast() { 15491 Node removeLast() {
14969 throw new UnsupportedError("Cannot removeLast on immutable List."); 15492 throw new UnsupportedError("Cannot removeLast on immutable List.");
14970 } 15493 }
14971 15494
14972 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) { 15495 void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
14973 throw new UnsupportedError("Cannot setRange on immutable List."); 15496 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
16958 SourceBuffer get first { 17481 SourceBuffer get first {
16959 if (this.length > 0) return this[0]; 17482 if (this.length > 0) return this[0];
16960 throw new StateError("No elements"); 17483 throw new StateError("No elements");
16961 } 17484 }
16962 17485
16963 SourceBuffer get last { 17486 SourceBuffer get last {
16964 if (this.length > 0) return this[this.length - 1]; 17487 if (this.length > 0) return this[this.length - 1];
16965 throw new StateError("No elements"); 17488 throw new StateError("No elements");
16966 } 17489 }
16967 17490
17491 SourceBuffer get single {
17492 if (length == 1) return this[0];
17493 if (length == 0) throw new StateError("No elements");
17494 throw new StateError("More than one element");
17495 }
17496
17497 SourceBuffer min([int compare(SourceBuffer a, SourceBuffer b)]) => _Collection s.minInList(this, compare);
17498
17499 SourceBuffer max([int compare(SourceBuffer a, SourceBuffer b)]) => _Collection s.maxInList(this, compare);
17500
16968 SourceBuffer removeAt(int pos) { 17501 SourceBuffer removeAt(int pos) {
16969 throw new UnsupportedError("Cannot removeAt on immutable List."); 17502 throw new UnsupportedError("Cannot removeAt on immutable List.");
16970 } 17503 }
16971 17504
16972 SourceBuffer removeLast() { 17505 SourceBuffer removeLast() {
16973 throw new UnsupportedError("Cannot removeLast on immutable List."); 17506 throw new UnsupportedError("Cannot removeLast on immutable List.");
16974 } 17507 }
16975 17508
16976 void setRange(int start, int rangeLength, List<SourceBuffer> from, [int startF rom]) { 17509 void setRange(int start, int rangeLength, List<SourceBuffer> from, [int startF rom]) {
16977 throw new UnsupportedError("Cannot setRange on immutable List."); 17510 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
17170 SpeechGrammar get first { 17703 SpeechGrammar get first {
17171 if (this.length > 0) return this[0]; 17704 if (this.length > 0) return this[0];
17172 throw new StateError("No elements"); 17705 throw new StateError("No elements");
17173 } 17706 }
17174 17707
17175 SpeechGrammar get last { 17708 SpeechGrammar get last {
17176 if (this.length > 0) return this[this.length - 1]; 17709 if (this.length > 0) return this[this.length - 1];
17177 throw new StateError("No elements"); 17710 throw new StateError("No elements");
17178 } 17711 }
17179 17712
17713 SpeechGrammar get single {
17714 if (length == 1) return this[0];
17715 if (length == 0) throw new StateError("No elements");
17716 throw new StateError("More than one element");
17717 }
17718
17719 SpeechGrammar min([int compare(SpeechGrammar a, SpeechGrammar b)]) => _Collect ions.minInList(this, compare);
17720
17721 SpeechGrammar max([int compare(SpeechGrammar a, SpeechGrammar b)]) => _Collect ions.maxInList(this, compare);
17722
17180 SpeechGrammar removeAt(int pos) { 17723 SpeechGrammar removeAt(int pos) {
17181 throw new UnsupportedError("Cannot removeAt on immutable List."); 17724 throw new UnsupportedError("Cannot removeAt on immutable List.");
17182 } 17725 }
17183 17726
17184 SpeechGrammar removeLast() { 17727 SpeechGrammar removeLast() {
17185 throw new UnsupportedError("Cannot removeLast on immutable List."); 17728 throw new UnsupportedError("Cannot removeLast on immutable List.");
17186 } 17729 }
17187 17730
17188 void setRange(int start, int rangeLength, List<SpeechGrammar> from, [int start From]) { 17731 void setRange(int start, int rangeLength, List<SpeechGrammar> from, [int start From]) {
17189 throw new UnsupportedError("Cannot setRange on immutable List."); 17732 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
17603 Map get first { 18146 Map get first {
17604 if (this.length > 0) return this[0]; 18147 if (this.length > 0) return this[0];
17605 throw new StateError("No elements"); 18148 throw new StateError("No elements");
17606 } 18149 }
17607 18150
17608 Map get last { 18151 Map get last {
17609 if (this.length > 0) return this[this.length - 1]; 18152 if (this.length > 0) return this[this.length - 1];
17610 throw new StateError("No elements"); 18153 throw new StateError("No elements");
17611 } 18154 }
17612 18155
18156 Map get single {
18157 if (length == 1) return this[0];
18158 if (length == 0) throw new StateError("No elements");
18159 throw new StateError("More than one element");
18160 }
18161
18162 Map min([int compare(Map a, Map b)]) => _Collections.minInList(this, compare);
18163
18164 Map max([int compare(Map a, Map b)]) => _Collections.maxInList(this, compare);
18165
17613 Map removeAt(int pos) { 18166 Map removeAt(int pos) {
17614 throw new UnsupportedError("Cannot removeAt on immutable List."); 18167 throw new UnsupportedError("Cannot removeAt on immutable List.");
17615 } 18168 }
17616 18169
17617 Map removeLast() { 18170 Map removeLast() {
17618 throw new UnsupportedError("Cannot removeLast on immutable List."); 18171 throw new UnsupportedError("Cannot removeLast on immutable List.");
17619 } 18172 }
17620 18173
17621 void setRange(int start, int rangeLength, List<Map> from, [int startFrom]) { 18174 void setRange(int start, int rangeLength, List<Map> from, [int startFrom]) {
17622 throw new UnsupportedError("Cannot setRange on immutable List."); 18175 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
18541 TextTrackCue get first { 19094 TextTrackCue get first {
18542 if (this.length > 0) return this[0]; 19095 if (this.length > 0) return this[0];
18543 throw new StateError("No elements"); 19096 throw new StateError("No elements");
18544 } 19097 }
18545 19098
18546 TextTrackCue get last { 19099 TextTrackCue get last {
18547 if (this.length > 0) return this[this.length - 1]; 19100 if (this.length > 0) return this[this.length - 1];
18548 throw new StateError("No elements"); 19101 throw new StateError("No elements");
18549 } 19102 }
18550 19103
19104 TextTrackCue get single {
19105 if (length == 1) return this[0];
19106 if (length == 0) throw new StateError("No elements");
19107 throw new StateError("More than one element");
19108 }
19109
19110 TextTrackCue min([int compare(TextTrackCue a, TextTrackCue b)]) => _Collection s.minInList(this, compare);
19111
19112 TextTrackCue max([int compare(TextTrackCue a, TextTrackCue b)]) => _Collection s.maxInList(this, compare);
19113
18551 TextTrackCue removeAt(int pos) { 19114 TextTrackCue removeAt(int pos) {
18552 throw new UnsupportedError("Cannot removeAt on immutable List."); 19115 throw new UnsupportedError("Cannot removeAt on immutable List.");
18553 } 19116 }
18554 19117
18555 TextTrackCue removeLast() { 19118 TextTrackCue removeLast() {
18556 throw new UnsupportedError("Cannot removeLast on immutable List."); 19119 throw new UnsupportedError("Cannot removeLast on immutable List.");
18557 } 19120 }
18558 19121
18559 void setRange(int start, int rangeLength, List<TextTrackCue> from, [int startF rom]) { 19122 void setRange(int start, int rangeLength, List<TextTrackCue> from, [int startF rom]) {
18560 throw new UnsupportedError("Cannot setRange on immutable List."); 19123 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
18697 TextTrack get first { 19260 TextTrack get first {
18698 if (this.length > 0) return this[0]; 19261 if (this.length > 0) return this[0];
18699 throw new StateError("No elements"); 19262 throw new StateError("No elements");
18700 } 19263 }
18701 19264
18702 TextTrack get last { 19265 TextTrack get last {
18703 if (this.length > 0) return this[this.length - 1]; 19266 if (this.length > 0) return this[this.length - 1];
18704 throw new StateError("No elements"); 19267 throw new StateError("No elements");
18705 } 19268 }
18706 19269
19270 TextTrack get single {
19271 if (length == 1) return this[0];
19272 if (length == 0) throw new StateError("No elements");
19273 throw new StateError("More than one element");
19274 }
19275
19276 TextTrack min([int compare(TextTrack a, TextTrack b)]) => _Collections.minInLi st(this, compare);
19277
19278 TextTrack max([int compare(TextTrack a, TextTrack b)]) => _Collections.maxInLi st(this, compare);
19279
18707 TextTrack removeAt(int pos) { 19280 TextTrack removeAt(int pos) {
18708 throw new UnsupportedError("Cannot removeAt on immutable List."); 19281 throw new UnsupportedError("Cannot removeAt on immutable List.");
18709 } 19282 }
18710 19283
18711 TextTrack removeLast() { 19284 TextTrack removeLast() {
18712 throw new UnsupportedError("Cannot removeLast on immutable List."); 19285 throw new UnsupportedError("Cannot removeLast on immutable List.");
18713 } 19286 }
18714 19287
18715 void setRange(int start, int rangeLength, List<TextTrack> from, [int startFrom ]) { 19288 void setRange(int start, int rangeLength, List<TextTrack> from, [int startFrom ]) {
18716 throw new UnsupportedError("Cannot setRange on immutable List."); 19289 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
18982 Touch get first { 19555 Touch get first {
18983 if (this.length > 0) return this[0]; 19556 if (this.length > 0) return this[0];
18984 throw new StateError("No elements"); 19557 throw new StateError("No elements");
18985 } 19558 }
18986 19559
18987 Touch get last { 19560 Touch get last {
18988 if (this.length > 0) return this[this.length - 1]; 19561 if (this.length > 0) return this[this.length - 1];
18989 throw new StateError("No elements"); 19562 throw new StateError("No elements");
18990 } 19563 }
18991 19564
19565 Touch get single {
19566 if (length == 1) return this[0];
19567 if (length == 0) throw new StateError("No elements");
19568 throw new StateError("More than one element");
19569 }
19570
19571 Touch min([int compare(Touch a, Touch b)]) => _Collections.minInList(this, com pare);
19572
19573 Touch max([int compare(Touch a, Touch b)]) => _Collections.maxInList(this, com pare);
19574
18992 Touch removeAt(int pos) { 19575 Touch removeAt(int pos) {
18993 throw new UnsupportedError("Cannot removeAt on immutable List."); 19576 throw new UnsupportedError("Cannot removeAt on immutable List.");
18994 } 19577 }
18995 19578
18996 Touch removeLast() { 19579 Touch removeLast() {
18997 throw new UnsupportedError("Cannot removeLast on immutable List."); 19580 throw new UnsupportedError("Cannot removeLast on immutable List.");
18998 } 19581 }
18999 19582
19000 void setRange(int start, int rangeLength, List<Touch> from, [int startFrom]) { 19583 void setRange(int start, int rangeLength, List<Touch> from, [int startFrom]) {
19001 throw new UnsupportedError("Cannot setRange on immutable List."); 19584 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
19325 int get first { 19908 int get first {
19326 if (this.length > 0) return this[0]; 19909 if (this.length > 0) return this[0];
19327 throw new StateError("No elements"); 19910 throw new StateError("No elements");
19328 } 19911 }
19329 19912
19330 int get last { 19913 int get last {
19331 if (this.length > 0) return this[this.length - 1]; 19914 if (this.length > 0) return this[this.length - 1];
19332 throw new StateError("No elements"); 19915 throw new StateError("No elements");
19333 } 19916 }
19334 19917
19918 int get single {
19919 if (length == 1) return this[0];
19920 if (length == 0) throw new StateError("No elements");
19921 throw new StateError("More than one element");
19922 }
19923
19924 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
19925
19926 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
19927
19335 int removeAt(int pos) { 19928 int removeAt(int pos) {
19336 throw new UnsupportedError("Cannot removeAt on immutable List."); 19929 throw new UnsupportedError("Cannot removeAt on immutable List.");
19337 } 19930 }
19338 19931
19339 int removeLast() { 19932 int removeLast() {
19340 throw new UnsupportedError("Cannot removeLast on immutable List."); 19933 throw new UnsupportedError("Cannot removeLast on immutable List.");
19341 } 19934 }
19342 19935
19343 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 19936 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
19344 throw new UnsupportedError("Cannot setRange on immutable List."); 19937 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
19486 int get first { 20079 int get first {
19487 if (this.length > 0) return this[0]; 20080 if (this.length > 0) return this[0];
19488 throw new StateError("No elements"); 20081 throw new StateError("No elements");
19489 } 20082 }
19490 20083
19491 int get last { 20084 int get last {
19492 if (this.length > 0) return this[this.length - 1]; 20085 if (this.length > 0) return this[this.length - 1];
19493 throw new StateError("No elements"); 20086 throw new StateError("No elements");
19494 } 20087 }
19495 20088
20089 int get single {
20090 if (length == 1) return this[0];
20091 if (length == 0) throw new StateError("No elements");
20092 throw new StateError("More than one element");
20093 }
20094
20095 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
20096
20097 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
20098
19496 int removeAt(int pos) { 20099 int removeAt(int pos) {
19497 throw new UnsupportedError("Cannot removeAt on immutable List."); 20100 throw new UnsupportedError("Cannot removeAt on immutable List.");
19498 } 20101 }
19499 20102
19500 int removeLast() { 20103 int removeLast() {
19501 throw new UnsupportedError("Cannot removeLast on immutable List."); 20104 throw new UnsupportedError("Cannot removeLast on immutable List.");
19502 } 20105 }
19503 20106
19504 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 20107 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
19505 throw new UnsupportedError("Cannot setRange on immutable List."); 20108 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
19647 int get first { 20250 int get first {
19648 if (this.length > 0) return this[0]; 20251 if (this.length > 0) return this[0];
19649 throw new StateError("No elements"); 20252 throw new StateError("No elements");
19650 } 20253 }
19651 20254
19652 int get last { 20255 int get last {
19653 if (this.length > 0) return this[this.length - 1]; 20256 if (this.length > 0) return this[this.length - 1];
19654 throw new StateError("No elements"); 20257 throw new StateError("No elements");
19655 } 20258 }
19656 20259
20260 int get single {
20261 if (length == 1) return this[0];
20262 if (length == 0) throw new StateError("No elements");
20263 throw new StateError("More than one element");
20264 }
20265
20266 int min([int compare(int a, int b)]) => _Collections.minInList(this, compare);
20267
20268 int max([int compare(int a, int b)]) => _Collections.maxInList(this, compare);
20269
19657 int removeAt(int pos) { 20270 int removeAt(int pos) {
19658 throw new UnsupportedError("Cannot removeAt on immutable List."); 20271 throw new UnsupportedError("Cannot removeAt on immutable List.");
19659 } 20272 }
19660 20273
19661 int removeLast() { 20274 int removeLast() {
19662 throw new UnsupportedError("Cannot removeLast on immutable List."); 20275 throw new UnsupportedError("Cannot removeLast on immutable List.");
19663 } 20276 }
19664 20277
19665 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { 20278 void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
19666 throw new UnsupportedError("Cannot setRange on immutable List."); 20279 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after
21901 ClientRect get first { 22514 ClientRect get first {
21902 if (this.length > 0) return this[0]; 22515 if (this.length > 0) return this[0];
21903 throw new StateError("No elements"); 22516 throw new StateError("No elements");
21904 } 22517 }
21905 22518
21906 ClientRect get last { 22519 ClientRect get last {
21907 if (this.length > 0) return this[this.length - 1]; 22520 if (this.length > 0) return this[this.length - 1];
21908 throw new StateError("No elements"); 22521 throw new StateError("No elements");
21909 } 22522 }
21910 22523
22524 ClientRect get single {
22525 if (length == 1) return this[0];
22526 if (length == 0) throw new StateError("No elements");
22527 throw new StateError("More than one element");
22528 }
22529
22530 ClientRect min([int compare(ClientRect a, ClientRect b)]) => _Collections.minI nList(this, compare);
22531
22532 ClientRect max([int compare(ClientRect a, ClientRect b)]) => _Collections.maxI nList(this, compare);
22533
21911 ClientRect removeAt(int pos) { 22534 ClientRect removeAt(int pos) {
21912 throw new UnsupportedError("Cannot removeAt on immutable List."); 22535 throw new UnsupportedError("Cannot removeAt on immutable List.");
21913 } 22536 }
21914 22537
21915 ClientRect removeLast() { 22538 ClientRect removeLast() {
21916 throw new UnsupportedError("Cannot removeLast on immutable List."); 22539 throw new UnsupportedError("Cannot removeLast on immutable List.");
21917 } 22540 }
21918 22541
21919 void setRange(int start, int rangeLength, List<ClientRect> from, [int startFro m]) { 22542 void setRange(int start, int rangeLength, List<ClientRect> from, [int startFro m]) {
21920 throw new UnsupportedError("Cannot setRange on immutable List."); 22543 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
22059 CssRule get first { 22682 CssRule get first {
22060 if (this.length > 0) return this[0]; 22683 if (this.length > 0) return this[0];
22061 throw new StateError("No elements"); 22684 throw new StateError("No elements");
22062 } 22685 }
22063 22686
22064 CssRule get last { 22687 CssRule get last {
22065 if (this.length > 0) return this[this.length - 1]; 22688 if (this.length > 0) return this[this.length - 1];
22066 throw new StateError("No elements"); 22689 throw new StateError("No elements");
22067 } 22690 }
22068 22691
22692 CssRule get single {
22693 if (length == 1) return this[0];
22694 if (length == 0) throw new StateError("No elements");
22695 throw new StateError("More than one element");
22696 }
22697
22698 CssRule min([int compare(CssRule a, CssRule b)]) => _Collections.minInList(thi s, compare);
22699
22700 CssRule max([int compare(CssRule a, CssRule b)]) => _Collections.maxInList(thi s, compare);
22701
22069 CssRule removeAt(int pos) { 22702 CssRule removeAt(int pos) {
22070 throw new UnsupportedError("Cannot removeAt on immutable List."); 22703 throw new UnsupportedError("Cannot removeAt on immutable List.");
22071 } 22704 }
22072 22705
22073 CssRule removeLast() { 22706 CssRule removeLast() {
22074 throw new UnsupportedError("Cannot removeLast on immutable List."); 22707 throw new UnsupportedError("Cannot removeLast on immutable List.");
22075 } 22708 }
22076 22709
22077 void setRange(int start, int rangeLength, List<CssRule> from, [int startFrom]) { 22710 void setRange(int start, int rangeLength, List<CssRule> from, [int startFrom]) {
22078 throw new UnsupportedError("Cannot setRange on immutable List."); 22711 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
22208 CssValue get first { 22841 CssValue get first {
22209 if (this.length > 0) return this[0]; 22842 if (this.length > 0) return this[0];
22210 throw new StateError("No elements"); 22843 throw new StateError("No elements");
22211 } 22844 }
22212 22845
22213 CssValue get last { 22846 CssValue get last {
22214 if (this.length > 0) return this[this.length - 1]; 22847 if (this.length > 0) return this[this.length - 1];
22215 throw new StateError("No elements"); 22848 throw new StateError("No elements");
22216 } 22849 }
22217 22850
22851 CssValue get single {
22852 if (length == 1) return this[0];
22853 if (length == 0) throw new StateError("No elements");
22854 throw new StateError("More than one element");
22855 }
22856
22857 CssValue min([int compare(CssValue a, CssValue b)]) => _Collections.minInList( this, compare);
22858
22859 CssValue max([int compare(CssValue a, CssValue b)]) => _Collections.maxInList( this, compare);
22860
22218 CssValue removeAt(int pos) { 22861 CssValue removeAt(int pos) {
22219 throw new UnsupportedError("Cannot removeAt on immutable List."); 22862 throw new UnsupportedError("Cannot removeAt on immutable List.");
22220 } 22863 }
22221 22864
22222 CssValue removeLast() { 22865 CssValue removeLast() {
22223 throw new UnsupportedError("Cannot removeLast on immutable List."); 22866 throw new UnsupportedError("Cannot removeLast on immutable List.");
22224 } 22867 }
22225 22868
22226 void setRange(int start, int rangeLength, List<CssValue> from, [int startFrom] ) { 22869 void setRange(int start, int rangeLength, List<CssValue> from, [int startFrom] ) {
22227 throw new UnsupportedError("Cannot setRange on immutable List."); 22870 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
22383 Entry get first { 23026 Entry get first {
22384 if (this.length > 0) return this[0]; 23027 if (this.length > 0) return this[0];
22385 throw new StateError("No elements"); 23028 throw new StateError("No elements");
22386 } 23029 }
22387 23030
22388 Entry get last { 23031 Entry get last {
22389 if (this.length > 0) return this[this.length - 1]; 23032 if (this.length > 0) return this[this.length - 1];
22390 throw new StateError("No elements"); 23033 throw new StateError("No elements");
22391 } 23034 }
22392 23035
23036 Entry get single {
23037 if (length == 1) return this[0];
23038 if (length == 0) throw new StateError("No elements");
23039 throw new StateError("More than one element");
23040 }
23041
23042 Entry min([int compare(Entry a, Entry b)]) => _Collections.minInList(this, com pare);
23043
23044 Entry max([int compare(Entry a, Entry b)]) => _Collections.maxInList(this, com pare);
23045
22393 Entry removeAt(int pos) { 23046 Entry removeAt(int pos) {
22394 throw new UnsupportedError("Cannot removeAt on immutable List."); 23047 throw new UnsupportedError("Cannot removeAt on immutable List.");
22395 } 23048 }
22396 23049
22397 Entry removeLast() { 23050 Entry removeLast() {
22398 throw new UnsupportedError("Cannot removeLast on immutable List."); 23051 throw new UnsupportedError("Cannot removeLast on immutable List.");
22399 } 23052 }
22400 23053
22401 void setRange(int start, int rangeLength, List<Entry> from, [int startFrom]) { 23054 void setRange(int start, int rangeLength, List<Entry> from, [int startFrom]) {
22402 throw new UnsupportedError("Cannot setRange on immutable List."); 23055 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
22532 EntrySync get first { 23185 EntrySync get first {
22533 if (this.length > 0) return this[0]; 23186 if (this.length > 0) return this[0];
22534 throw new StateError("No elements"); 23187 throw new StateError("No elements");
22535 } 23188 }
22536 23189
22537 EntrySync get last { 23190 EntrySync get last {
22538 if (this.length > 0) return this[this.length - 1]; 23191 if (this.length > 0) return this[this.length - 1];
22539 throw new StateError("No elements"); 23192 throw new StateError("No elements");
22540 } 23193 }
22541 23194
23195 EntrySync get single {
23196 if (length == 1) return this[0];
23197 if (length == 0) throw new StateError("No elements");
23198 throw new StateError("More than one element");
23199 }
23200
23201 EntrySync min([int compare(EntrySync a, EntrySync b)]) => _Collections.minInLi st(this, compare);
23202
23203 EntrySync max([int compare(EntrySync a, EntrySync b)]) => _Collections.maxInLi st(this, compare);
23204
22542 EntrySync removeAt(int pos) { 23205 EntrySync removeAt(int pos) {
22543 throw new UnsupportedError("Cannot removeAt on immutable List."); 23206 throw new UnsupportedError("Cannot removeAt on immutable List.");
22544 } 23207 }
22545 23208
22546 EntrySync removeLast() { 23209 EntrySync removeLast() {
22547 throw new UnsupportedError("Cannot removeLast on immutable List."); 23210 throw new UnsupportedError("Cannot removeLast on immutable List.");
22548 } 23211 }
22549 23212
22550 void setRange(int start, int rangeLength, List<EntrySync> from, [int startFrom ]) { 23213 void setRange(int start, int rangeLength, List<EntrySync> from, [int startFrom ]) {
22551 throw new UnsupportedError("Cannot setRange on immutable List."); 23214 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
22719 Gamepad get first { 23382 Gamepad get first {
22720 if (this.length > 0) return this[0]; 23383 if (this.length > 0) return this[0];
22721 throw new StateError("No elements"); 23384 throw new StateError("No elements");
22722 } 23385 }
22723 23386
22724 Gamepad get last { 23387 Gamepad get last {
22725 if (this.length > 0) return this[this.length - 1]; 23388 if (this.length > 0) return this[this.length - 1];
22726 throw new StateError("No elements"); 23389 throw new StateError("No elements");
22727 } 23390 }
22728 23391
23392 Gamepad get single {
23393 if (length == 1) return this[0];
23394 if (length == 0) throw new StateError("No elements");
23395 throw new StateError("More than one element");
23396 }
23397
23398 Gamepad min([int compare(Gamepad a, Gamepad b)]) => _Collections.minInList(thi s, compare);
23399
23400 Gamepad max([int compare(Gamepad a, Gamepad b)]) => _Collections.maxInList(thi s, compare);
23401
22729 Gamepad removeAt(int pos) { 23402 Gamepad removeAt(int pos) {
22730 throw new UnsupportedError("Cannot removeAt on immutable List."); 23403 throw new UnsupportedError("Cannot removeAt on immutable List.");
22731 } 23404 }
22732 23405
22733 Gamepad removeLast() { 23406 Gamepad removeLast() {
22734 throw new UnsupportedError("Cannot removeLast on immutable List."); 23407 throw new UnsupportedError("Cannot removeLast on immutable List.");
22735 } 23408 }
22736 23409
22737 void setRange(int start, int rangeLength, List<Gamepad> from, [int startFrom]) { 23410 void setRange(int start, int rangeLength, List<Gamepad> from, [int startFrom]) {
22738 throw new UnsupportedError("Cannot setRange on immutable List."); 23411 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
22921 MediaStream get first { 23594 MediaStream get first {
22922 if (this.length > 0) return this[0]; 23595 if (this.length > 0) return this[0];
22923 throw new StateError("No elements"); 23596 throw new StateError("No elements");
22924 } 23597 }
22925 23598
22926 MediaStream get last { 23599 MediaStream get last {
22927 if (this.length > 0) return this[this.length - 1]; 23600 if (this.length > 0) return this[this.length - 1];
22928 throw new StateError("No elements"); 23601 throw new StateError("No elements");
22929 } 23602 }
22930 23603
23604 MediaStream get single {
23605 if (length == 1) return this[0];
23606 if (length == 0) throw new StateError("No elements");
23607 throw new StateError("More than one element");
23608 }
23609
23610 MediaStream min([int compare(MediaStream a, MediaStream b)]) => _Collections.m inInList(this, compare);
23611
23612 MediaStream max([int compare(MediaStream a, MediaStream b)]) => _Collections.m axInList(this, compare);
23613
22931 MediaStream removeAt(int pos) { 23614 MediaStream removeAt(int pos) {
22932 throw new UnsupportedError("Cannot removeAt on immutable List."); 23615 throw new UnsupportedError("Cannot removeAt on immutable List.");
22933 } 23616 }
22934 23617
22935 MediaStream removeLast() { 23618 MediaStream removeLast() {
22936 throw new UnsupportedError("Cannot removeLast on immutable List."); 23619 throw new UnsupportedError("Cannot removeLast on immutable List.");
22937 } 23620 }
22938 23621
22939 void setRange(int start, int rangeLength, List<MediaStream> from, [int startFr om]) { 23622 void setRange(int start, int rangeLength, List<MediaStream> from, [int startFr om]) {
22940 throw new UnsupportedError("Cannot setRange on immutable List."); 23623 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
23223 SpeechInputResult get first { 23906 SpeechInputResult get first {
23224 if (this.length > 0) return this[0]; 23907 if (this.length > 0) return this[0];
23225 throw new StateError("No elements"); 23908 throw new StateError("No elements");
23226 } 23909 }
23227 23910
23228 SpeechInputResult get last { 23911 SpeechInputResult get last {
23229 if (this.length > 0) return this[this.length - 1]; 23912 if (this.length > 0) return this[this.length - 1];
23230 throw new StateError("No elements"); 23913 throw new StateError("No elements");
23231 } 23914 }
23232 23915
23916 SpeechInputResult get single {
23917 if (length == 1) return this[0];
23918 if (length == 0) throw new StateError("No elements");
23919 throw new StateError("More than one element");
23920 }
23921
23922 SpeechInputResult min([int compare(SpeechInputResult a, SpeechInputResult b)]) => _Collections.minInList(this, compare);
23923
23924 SpeechInputResult max([int compare(SpeechInputResult a, SpeechInputResult b)]) => _Collections.maxInList(this, compare);
23925
23233 SpeechInputResult removeAt(int pos) { 23926 SpeechInputResult removeAt(int pos) {
23234 throw new UnsupportedError("Cannot removeAt on immutable List."); 23927 throw new UnsupportedError("Cannot removeAt on immutable List.");
23235 } 23928 }
23236 23929
23237 SpeechInputResult removeLast() { 23930 SpeechInputResult removeLast() {
23238 throw new UnsupportedError("Cannot removeLast on immutable List."); 23931 throw new UnsupportedError("Cannot removeLast on immutable List.");
23239 } 23932 }
23240 23933
23241 void setRange(int start, int rangeLength, List<SpeechInputResult> from, [int s tartFrom]) { 23934 void setRange(int start, int rangeLength, List<SpeechInputResult> from, [int s tartFrom]) {
23242 throw new UnsupportedError("Cannot setRange on immutable List."); 23935 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
23381 SpeechRecognitionResult get first { 24074 SpeechRecognitionResult get first {
23382 if (this.length > 0) return this[0]; 24075 if (this.length > 0) return this[0];
23383 throw new StateError("No elements"); 24076 throw new StateError("No elements");
23384 } 24077 }
23385 24078
23386 SpeechRecognitionResult get last { 24079 SpeechRecognitionResult get last {
23387 if (this.length > 0) return this[this.length - 1]; 24080 if (this.length > 0) return this[this.length - 1];
23388 throw new StateError("No elements"); 24081 throw new StateError("No elements");
23389 } 24082 }
23390 24083
24084 SpeechRecognitionResult get single {
24085 if (length == 1) return this[0];
24086 if (length == 0) throw new StateError("No elements");
24087 throw new StateError("More than one element");
24088 }
24089
24090 SpeechRecognitionResult min([int compare(SpeechRecognitionResult a, SpeechReco gnitionResult b)]) => _Collections.minInList(this, compare);
24091
24092 SpeechRecognitionResult max([int compare(SpeechRecognitionResult a, SpeechReco gnitionResult b)]) => _Collections.maxInList(this, compare);
24093
23391 SpeechRecognitionResult removeAt(int pos) { 24094 SpeechRecognitionResult removeAt(int pos) {
23392 throw new UnsupportedError("Cannot removeAt on immutable List."); 24095 throw new UnsupportedError("Cannot removeAt on immutable List.");
23393 } 24096 }
23394 24097
23395 SpeechRecognitionResult removeLast() { 24098 SpeechRecognitionResult removeLast() {
23396 throw new UnsupportedError("Cannot removeLast on immutable List."); 24099 throw new UnsupportedError("Cannot removeLast on immutable List.");
23397 } 24100 }
23398 24101
23399 void setRange(int start, int rangeLength, List<SpeechRecognitionResult> from, [int startFrom]) { 24102 void setRange(int start, int rangeLength, List<SpeechRecognitionResult> from, [int startFrom]) {
23400 throw new UnsupportedError("Cannot setRange on immutable List."); 24103 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
23530 StyleSheet get first { 24233 StyleSheet get first {
23531 if (this.length > 0) return this[0]; 24234 if (this.length > 0) return this[0];
23532 throw new StateError("No elements"); 24235 throw new StateError("No elements");
23533 } 24236 }
23534 24237
23535 StyleSheet get last { 24238 StyleSheet get last {
23536 if (this.length > 0) return this[this.length - 1]; 24239 if (this.length > 0) return this[this.length - 1];
23537 throw new StateError("No elements"); 24240 throw new StateError("No elements");
23538 } 24241 }
23539 24242
24243 StyleSheet get single {
24244 if (length == 1) return this[0];
24245 if (length == 0) throw new StateError("No elements");
24246 throw new StateError("More than one element");
24247 }
24248
24249 StyleSheet min([int compare(StyleSheet a, StyleSheet b)]) => _Collections.minI nList(this, compare);
24250
24251 StyleSheet max([int compare(StyleSheet a, StyleSheet b)]) => _Collections.maxI nList(this, compare);
24252
23540 StyleSheet removeAt(int pos) { 24253 StyleSheet removeAt(int pos) {
23541 throw new UnsupportedError("Cannot removeAt on immutable List."); 24254 throw new UnsupportedError("Cannot removeAt on immutable List.");
23542 } 24255 }
23543 24256
23544 StyleSheet removeLast() { 24257 StyleSheet removeLast() {
23545 throw new UnsupportedError("Cannot removeLast on immutable List."); 24258 throw new UnsupportedError("Cannot removeLast on immutable List.");
23546 } 24259 }
23547 24260
23548 void setRange(int start, int rangeLength, List<StyleSheet> from, [int startFro m]) { 24261 void setRange(int start, int rangeLength, List<StyleSheet> from, [int startFro m]) {
23549 throw new UnsupportedError("Cannot setRange on immutable List."); 24262 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
23703 Animation get first { 24416 Animation get first {
23704 if (this.length > 0) return this[0]; 24417 if (this.length > 0) return this[0];
23705 throw new StateError("No elements"); 24418 throw new StateError("No elements");
23706 } 24419 }
23707 24420
23708 Animation get last { 24421 Animation get last {
23709 if (this.length > 0) return this[this.length - 1]; 24422 if (this.length > 0) return this[this.length - 1];
23710 throw new StateError("No elements"); 24423 throw new StateError("No elements");
23711 } 24424 }
23712 24425
24426 Animation get single {
24427 if (length == 1) return this[0];
24428 if (length == 0) throw new StateError("No elements");
24429 throw new StateError("More than one element");
24430 }
24431
24432 Animation min([int compare(Animation a, Animation b)]) => _Collections.minInLi st(this, compare);
24433
24434 Animation max([int compare(Animation a, Animation b)]) => _Collections.maxInLi st(this, compare);
24435
23713 Animation removeAt(int pos) { 24436 Animation removeAt(int pos) {
23714 throw new UnsupportedError("Cannot removeAt on immutable List."); 24437 throw new UnsupportedError("Cannot removeAt on immutable List.");
23715 } 24438 }
23716 24439
23717 Animation removeLast() { 24440 Animation removeLast() {
23718 throw new UnsupportedError("Cannot removeLast on immutable List."); 24441 throw new UnsupportedError("Cannot removeLast on immutable List.");
23719 } 24442 }
23720 24443
23721 void setRange(int start, int rangeLength, List<Animation> from, [int startFrom ]) { 24444 void setRange(int start, int rangeLength, List<Animation> from, [int startFrom ]) {
23722 throw new UnsupportedError("Cannot setRange on immutable List."); 24445 throw new UnsupportedError("Cannot setRange on immutable List.");
(...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after
26847 _position = nextPosition; 27570 _position = nextPosition;
26848 return true; 27571 return true;
26849 } 27572 }
26850 _current = null; 27573 _current = null;
26851 _position = _array.length; 27574 _position = _array.length;
26852 return false; 27575 return false;
26853 } 27576 }
26854 27577
26855 T get current => _current; 27578 T get current => _current;
26856 } 27579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698