Version 0.8.10.9
svn merge -c 30055 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30056 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30059 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30061 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30064 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30067 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30069 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30071 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30074 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30082 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30083 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30084 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30085 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 30095 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
Review URL: https://codereview.chromium.org//66253002
git-svn-id: http://dart.googlecode.com/svn/trunk@30099 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 32db241..5735697 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -1332,6 +1332,15 @@
// To suppress missing implicit constructor warnings.
factory CanvasRenderingContext2D._() { throw new UnsupportedError("Not supported"); }
+ /**
+ * The current default path of this canvas context, if there is one.
+ *
+ * ## Other resources
+ *
+ * * [Current default path]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#current-default-path)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.currentPath')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@@ -1356,6 +1365,16 @@
@DocsEditable()
String globalCompositeOperation;
+ /**
+ * Whether images and patterns on this canvas will be smoothed when this
+ * canvas is scaled.
+ *
+ * ## Other resources
+ *
+ * * [Image smoothing]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#image-smoothing)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
@DocsEditable()
@Experimental() // untriaged
@@ -1408,6 +1427,15 @@
String textBaseline;
@JSName('webkitBackingStorePixelRatio')
+ /**
+ * The ratio between this canvas' backing store dimensions and the canvas'
+ * logical dimensions.
+ *
+ * ## Other resources
+ *
+ * * [High DPI Canvas tutorial]
+ * (http://www.html5rocks.com/en/tutorials/canvas/hidpi/) from HTML5Rocks.
+ */
@DomName('CanvasRenderingContext2D.webkitBackingStorePixelRatio')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@@ -7313,6 +7341,7 @@
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
+ *
* var element1 = document.querySelector('.className');
* var element2 = document.querySelector('#id');
*
@@ -7671,6 +7700,7 @@
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
+ *
* var items = document.querySelectorAll('.itemClassName');
*
* For details about CSS selector syntax, see the
@@ -7752,6 +7782,17 @@
children.addAll(copy);
}
+ /**
+ * Finds all descendant elements of this document fragment that match the
+ * specified group of selectors.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
ElementList querySelectorAll(String selectors) =>
new _FrozenElementList._wrap(_querySelectorAll(selectors));
@@ -7816,6 +7857,18 @@
// To suppress missing implicit constructor warnings.
factory DocumentFragment._() { throw new UnsupportedError("Not supported"); }
+ /**
+ * Finds the first descendant element of this document fragment that matches
+ * the specified group of selectors.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var element1 = fragment.querySelector('.className');
+ * var element2 = fragment.querySelector('#id');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
@DomName('DocumentFragment.querySelector')
@DocsEditable()
Element querySelector(String selectors) native;
@@ -9456,6 +9509,9 @@
* [selectors] should be a string using CSS selector syntax.
*
* var items = element.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Element.querySelectorAll')
ElementList querySelectorAll(String selectors) =>
@@ -11092,9 +11148,8 @@
* // Gets the first descendant [ImageElement]
* var img = element.querySelector('img');
*
- * See also:
- *
- * * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors)
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Element.querySelector')
@DocsEditable()
@@ -34143,8 +34198,42 @@
@Experimental()
ElementList queryAll(String relativeSelectors) => document.queryAll(relativeSelectors);
-Element querySelector(String selector) => document.querySelector(selector);
-ElementList querySelectorAll(String selector) => document.querySelectorAll(selector);
+/**
+ * Finds the first descendant element of this document that matches the
+ * specified group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelector]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var element1 = document.querySelector('.className');
+ * var element2 = document.querySelector('#id');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+Element querySelector(String selectors) => document.querySelector(selectors);
+
+/**
+ * Finds all descendant elements of this document that match the specified
+ * group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelectorAll]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+ElementList querySelectorAll(String selectors) => document.querySelectorAll(selectors);
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 9c76577..c71a035 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -1519,12 +1519,30 @@
// To suppress missing implicit constructor warnings.
factory CanvasRenderingContext2D._() { throw new UnsupportedError("Not supported"); }
+ /**
+ * The current default path of this canvas context, if there is one.
+ *
+ * ## Other resources
+ *
+ * * [Current default path]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#current-default-path)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.currentPath')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@Experimental()
Path get currentPath native "CanvasRenderingContext2D_currentPath_Getter";
+ /**
+ * The current default path of this canvas context, if there is one.
+ *
+ * ## Other resources
+ *
+ * * [Current default path]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#current-default-path)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.currentPath')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@@ -1563,11 +1581,31 @@
@DocsEditable()
void set globalCompositeOperation(String value) native "CanvasRenderingContext2D_globalCompositeOperation_Setter";
+ /**
+ * Whether images and patterns on this canvas will be smoothed when this
+ * canvas is scaled.
+ *
+ * ## Other resources
+ *
+ * * [Image smoothing]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#image-smoothing)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
@DocsEditable()
@Experimental() // untriaged
bool get imageSmoothingEnabled native "CanvasRenderingContext2D_imageSmoothingEnabled_Getter";
+ /**
+ * Whether images and patterns on this canvas will be smoothed when this
+ * canvas is scaled.
+ *
+ * ## Other resources
+ *
+ * * [Image smoothing]
+ * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#image-smoothing)
+ * from WHATWG.
+ */
@DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
@DocsEditable()
@Experimental() // untriaged
@@ -1669,6 +1707,15 @@
@DocsEditable()
void set textBaseline(String value) native "CanvasRenderingContext2D_textBaseline_Setter";
+ /**
+ * The ratio between this canvas' backing store dimensions and the canvas'
+ * logical dimensions.
+ *
+ * ## Other resources
+ *
+ * * [High DPI Canvas tutorial]
+ * (http://www.html5rocks.com/en/tutorials/canvas/hidpi/) from HTML5Rocks.
+ */
@DomName('CanvasRenderingContext2D.webkitBackingStorePixelRatio')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@@ -7688,6 +7735,7 @@
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
+ *
* var element1 = document.querySelector('.className');
* var element2 = document.querySelector('#id');
*
@@ -8034,6 +8082,7 @@
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
+ *
* var items = document.querySelectorAll('.itemClassName');
*
* For details about CSS selector syntax, see the
@@ -8117,6 +8166,17 @@
children.addAll(copy);
}
+ /**
+ * Finds all descendant elements of this document fragment that match the
+ * specified group of selectors.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
ElementList querySelectorAll(String selectors) =>
new _FrozenElementList._wrap(_querySelectorAll(selectors));
@@ -8181,6 +8241,18 @@
// To suppress missing implicit constructor warnings.
factory DocumentFragment._() { throw new UnsupportedError("Not supported"); }
+ /**
+ * Finds the first descendant element of this document fragment that matches
+ * the specified group of selectors.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var element1 = fragment.querySelector('.className');
+ * var element2 = fragment.querySelector('#id');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
@DomName('DocumentFragment.querySelector')
@DocsEditable()
Element querySelector(String selectors) native "DocumentFragment_querySelector_Callback";
@@ -9847,6 +9919,9 @@
* [selectors] should be a string using CSS selector syntax.
*
* var items = element.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Element.querySelectorAll')
ElementList querySelectorAll(String selectors) =>
@@ -11243,9 +11318,8 @@
* // Gets the first descendant [ImageElement]
* var img = element.querySelector('img');
*
- * See also:
- *
- * * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors)
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Element.querySelector')
@DocsEditable()
@@ -35780,8 +35854,42 @@
@Experimental()
ElementList queryAll(String relativeSelectors) => document.queryAll(relativeSelectors);
-Element querySelector(String selector) => document.querySelector(selector);
-ElementList querySelectorAll(String selector) => document.querySelectorAll(selector);
+/**
+ * Finds the first descendant element of this document that matches the
+ * specified group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelector]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var element1 = document.querySelector('.className');
+ * var element2 = document.querySelector('#id');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+Element querySelector(String selectors) => document.querySelector(selectors);
+
+/**
+ * Finds all descendant elements of this document that match the specified
+ * group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelectorAll]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+ElementList querySelectorAll(String selectors) => document.querySelectorAll(selectors);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/math/point.dart b/sdk/lib/math/point.dart
index 37411b7..6c731c1 100644
--- a/sdk/lib/math/point.dart
+++ b/sdk/lib/math/point.dart
@@ -10,7 +10,7 @@
final T x;
final T y;
- const Point([T x = 0, T y = 0]): this.x = x, this.y = y;
+ const Point(T x, T y): this.x = x, this.y = y;
String toString() => 'Point($x, $y)';
diff --git a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
index 2d0241b..b52d22b 100644
--- a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -30,6 +30,11 @@
}
+/**
+ * A sequence of bytes underlying a typed data object.
+ * Used to process large quantities of binary or numerical data
+ * more efficiently using a typed view.
+ */
class ByteBuffer native "ArrayBuffer" {
@JSName('byteLength')
final int lengthInBytes;
@@ -47,17 +52,33 @@
: function(x) { return x.length; };
''');
+/**
+ * A typed view of a sequence of bytes.
+ */
class TypedData native "ArrayBufferView" {
+ /**
+ * Returns the byte buffer associated with this object.
+ */
@Creates('ByteBuffer')
@Returns('ByteBuffer|Null')
final ByteBuffer buffer;
+ /**
+ * Returns the length of this view, in bytes.
+ */
@JSName('byteLength')
final int lengthInBytes;
+ /**
+ * Returns the offset in bytes into the underlying byte buffer of this view.
+ */
@JSName('byteOffset')
final int offsetInBytes;
+ /**
+ * Returns the number of bytes in the representation of each element in this
+ * list.
+ */
@JSName('BYTES_PER_ELEMENT')
final int elementSizeInBytes;
@@ -102,15 +123,58 @@
}
+/**
+ * A fixed-length, random-access sequence of bytes that also provides random
+ * and unaligned access to the fixed-width integers and floating point
+ * numbers represented by those bytes.
+ * ByteData may be used to pack and unpack data from external sources
+ * (such as networks or files systems), and to process large quantities
+ * of numerical data more efficiently than would be possible
+ * with ordinary [List] implementations. ByteData can save space, by
+ * eliminating the need for object headers, and time, by eliminating the
+ * need for data copies. Finally, ByteData may be used to intentionally
+ * reinterpret the bytes representing one arithmetic type as another.
+ * For example this code fragment determine what 32-bit signed integer
+ * is represented by the bytes of a 32-bit floating point number:
+ *
+ * var buffer = new Uint8List(8).buffer;
+ * var bdata = new ByteData.view(buffer);
+ * bdata.setFloat32(0, 3.04);
+ * int huh = bdata.getInt32(0);
+ */
class ByteData extends TypedData native "DataView" {
+ /**
+ * Creates a [ByteData] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory ByteData(int length) => _create1(length);
+ /**
+ * Creates an [ByteData] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [ByteData] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ */
factory ByteData.view(ByteBuffer buffer,
[int byteOffset = 0, int byteLength]) =>
byteLength == null
? _create2(buffer, byteOffset)
: _create3(buffer, byteOffset, byteLength);
+ /**
+ * Returns the floating point number represented by the four bytes at
+ * the specified [byteOffset] in this object, in IEEE 754
+ * single-precision binary floating-point format (binary32).
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 4` is greater than the length of this object.
+ */
num getFloat32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getFloat32(byteOffset, endian._littleEndian);
@@ -118,6 +182,14 @@
@Returns('num')
num _getFloat32(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the floating point number represented by the eight bytes at
+ * the specified [byteOffset] in this object, in IEEE 754
+ * double-precision binary floating-point format (binary64).
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
num getFloat64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getFloat64(byteOffset, endian._littleEndian);
@@ -125,6 +197,16 @@
@Returns('num')
num _getFloat64(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the (possibly negative) integer represented by the two bytes at
+ * the specified [byteOffset] in this object, in two's complement binary
+ * form.
+ * The return value will be between 2<sup>15</sup> and 2<sup>15</sup> - 1,
+ * inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 2` is greater than the length of this object.
+ */
int getInt16(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getInt16(byteOffset, endian._littleEndian);
@@ -132,6 +214,16 @@
@Returns('int')
int _getInt16(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the (possibly negative) integer represented by the four bytes at
+ * the specified [byteOffset] in this object, in two's complement binary
+ * form.
+ * The return value will be between 2<sup>31</sup> and 2<sup>31</sup> - 1,
+ * inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 4` is greater than the length of this object.
+ */
int getInt32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getInt32(byteOffset, endian._littleEndian);
@@ -139,12 +231,39 @@
@Returns('int')
int _getInt32(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the (possibly negative) integer represented by the eight bytes at
+ * the specified [byteOffset] in this object, in two's complement binary
+ * form.
+ * The return value will be between 2<sup>63</sup> and 2<sup>63</sup> - 1,
+ * inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
int getInt64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) {
throw new UnsupportedError("Int64 accessor not supported by dart2js.");
}
+ /**
+ * Returns the (possibly negative) integer represented by the byte at the
+ * specified [byteOffset] in this object, in two's complement binary
+ * representation. The return value will be between -128 and 127, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * greater than or equal to the length of this object.
+ */
int getInt8(int byteOffset) native;
+ /**
+ * Returns the positive integer represented by the two bytes starting
+ * at the specified [byteOffset] in this object, in unsigned binary
+ * form.
+ * The return value will be between 0 and 2<sup>16</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 2` is greater than the length of this object.
+ */
int getUint16(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getUint16(byteOffset, endian._littleEndian);
@@ -152,6 +271,13 @@
@Returns('int')
int _getUint16(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the positive integer represented by the four bytes starting
+ * at the specified [byteOffset] in this object, in unsigned binary
+ * form.
+ * The return value will be between 0 and 2<sup>32</sup> - 1, inclusive.
+ *
+ */
int getUint32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_getUint32(byteOffset, endian._littleEndian);
@@ -159,58 +285,172 @@
@Returns('int')
int _getUint32(int byteOffset, [bool littleEndian]) native;
+ /**
+ * Returns the positive integer represented by the eight bytes starting
+ * at the specified [byteOffset] in this object, in unsigned binary
+ * form.
+ * The return value will be between 0 and 2<sup>64</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
int getUint64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) {
throw new UnsupportedError("Uint64 accessor not supported by dart2js.");
}
+ /**
+ * Returns the positive integer represented by the byte at the specified
+ * [byteOffset] in this object, in unsigned binary form. The
+ * return value will be between 0 and 255, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * greater than or equal to the length of this object.
+ */
int getUint8(int byteOffset) native;
+ /**
+ * Sets the four bytes starting at the specified [byteOffset] in this
+ * object to the IEEE 754 single-precision binary floating-point
+ * (binary32) representation of the specified [value].
+ *
+ * **Note that this method can lose precision.** The input [value] is
+ * a 64-bit floating point value, which will be converted to 32-bit
+ * floating point value by IEEE 754 rounding rules before it is stored.
+ * If [value] cannot be represented exactly as a binary32, it will be
+ * converted to the nearest binary32 value. If two binary32 values are
+ * equally close, the one whose least significant bit is zero will be used.
+ * Note that finite (but large) values can be converted to infinity, and
+ * small non-zero values can be converted to zero.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 4` is greater than the length of this object.
+ */
void setFloat32(int byteOffset, num value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setFloat32(byteOffset, value, endian._littleEndian);
@JSName('setFloat32')
void _setFloat32(int byteOffset, num value, [bool littleEndian]) native;
+ /**
+ * Sets the eight bytes starting at the specified [byteOffset] in this
+ * object to the IEEE 754 double-precision binary floating-point
+ * (binary64) representation of the specified [value].
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
void setFloat64(int byteOffset, num value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setFloat64(byteOffset, value, endian._littleEndian);
@JSName('setFloat64')
void _setFloat64(int byteOffset, num value, [bool littleEndian]) native;
+ /**
+ * Sets the two bytes starting at the specified [byteOffset] in this
+ * object to the two's complement binary representation of the specified
+ * [value], which must fit in two bytes. In other words, [value] must lie
+ * between 2<sup>15</sup> and 2<sup>15</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 2` is greater than the length of this object.
+ */
void setInt16(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setInt16(byteOffset, value, endian._littleEndian);
@JSName('setInt16')
void _setInt16(int byteOffset, int value, [bool littleEndian]) native;
+ /**
+ * Sets the four bytes starting at the specified [byteOffset] in this
+ * object to the two's complement binary representation of the specified
+ * [value], which must fit in four bytes. In other words, [value] must lie
+ * between 2<sup>31</sup> and 2<sup>31</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 4` is greater than the length of this object.
+ */
void setInt32(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setInt32(byteOffset, value, endian._littleEndian);
@JSName('setInt32')
void _setInt32(int byteOffset, int value, [bool littleEndian]) native;
+ /**
+ * Sets the eight bytes starting at the specified [byteOffset] in this
+ * object to the two's complement binary representation of the specified
+ * [value], which must fit in eight bytes. In other words, [value] must lie
+ * between 2<sup>63</sup> and 2<sup>63</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
void setInt64(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) {
throw new UnsupportedError("Int64 accessor not supported by dart2js.");
}
+ /**
+ * Sets the byte at the specified [byteOffset] in this object to the
+ * two's complement binary representation of the specified [value], which
+ * must fit in a single byte. In other words, [value] must be between
+ * -128 and 127, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * greater than or equal to the length of this object.
+ */
void setInt8(int byteOffset, int value) native;
+ /**
+ * Sets the two bytes starting at the specified [byteOffset] in this object
+ * to the unsigned binary representation of the specified [value],
+ * which must fit in two bytes. in other words, [value] must be between
+ * 0 and 2<sup>16</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 2` is greater than the length of this object.
+ */
void setUint16(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setUint16(byteOffset, value, endian._littleEndian);
@JSName('setUint16')
void _setUint16(int byteOffset, int value, [bool littleEndian]) native;
+ /**
+ * Sets the four bytes starting at the specified [byteOffset] in this object
+ * to the unsigned binary representation of the specified [value],
+ * which must fit in four bytes. in other words, [value] must be between
+ * 0 and 2<sup>32</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 4` is greater than the length of this object.
+ */
void setUint32(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
_setUint32(byteOffset, value, endian._littleEndian);
@JSName('setUint32')
void _setUint32(int byteOffset, int value, [bool littleEndian]) native;
+ /**
+ * Sets the eight bytes starting at the specified [byteOffset] in this object
+ * to the unsigned binary representation of the specified [value],
+ * which must fit in eight bytes. in other words, [value] must be between
+ * 0 and 2<sup>64</sup> - 1, inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative, or
+ * `byteOffset + 8` is greater than the length of this object.
+ */
void setUint64(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) {
throw new UnsupportedError("Uint64 accessor not supported by dart2js.");
}
+ /**
+ * Sets the byte at the specified [byteOffset] in this object to the
+ * unsigned binary representation of the specified [value], which must fit
+ * in a single byte. in other words, [value] must be between 0 and 255,
+ * inclusive.
+ *
+ * Throws [RangeError] if [byteOffset] is negative,
+ * or greater than or equal to the length of this object.
+ */
void setUint8(int byteOffset, int value) native;
static ByteData _create1(arg) =>
@@ -224,16 +464,44 @@
.._setCachedLength();
}
-
+/**
+ * A fixed-length list of IEEE 754 single-precision binary floating-point
+ * numbers that is viewable as a [TypedData]. For long lists, this
+ * implementation can be considerably more space- and time-efficient than
+ * the default [List] implementation.
+ */
class Float32List
extends TypedData with ListMixin<double>, FixedLengthListMixin<double>
implements JavaScriptIndexingBehavior, List<double>
native "Float32Array" {
+ /**
+ * Creates a [Float32List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Float32List(int length) => _create1(length);
+ /**
+ * Creates a [Float32List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Float32List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Float32List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Float32List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Float32List.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -274,15 +542,44 @@
}
+/**
+ * A fixed-length list of IEEE 754 double-precision binary floating-point
+ * numbers that is viewable as a [TypedData]. For long lists, this
+ * implementation can be considerably more space- and time-efficient than
+ * the default [List] implementation.
+ */
class Float64List
extends TypedData with ListMixin<double>, FixedLengthListMixin<double>
implements JavaScriptIndexingBehavior, List<double>
native "Float64Array" {
+ /**
+ * Creates a [Float64List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Float64List(int length) => _create1(length);
+ /**
+ * Creates a [Float64List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Float64List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Float64List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Float64List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Float64List.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -326,15 +623,43 @@
}
+/**
+ * A fixed-length list of 16-bit signed integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Int16List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
native "Int16Array" {
+ /**
+ * Creates an [Int16List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Int16List(int length) => _create1(length);
+ /**
+ * Creates a [Int16List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Int16List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates an [Int16List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Int16List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Int16List.view(ByteBuffer buffer, [int byteOffset = 0, int length]) =>
length == null
? _create2(buffer, byteOffset)
@@ -373,15 +698,43 @@
}
+/**
+ * A fixed-length list of 32-bit signed integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Int32List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
native "Int32Array" {
+ /**
+ * Creates an [Int32List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Int32List(int length) => _create1(length);
+ /**
+ * Creates a [Int32List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Int32List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates an [Int32List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Int32List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Int32List.view(ByteBuffer buffer, [int byteOffset = 0, int length]) =>
length == null
? _create2(buffer, byteOffset)
@@ -420,15 +773,40 @@
}
+/**
+ * A fixed-length list of 8-bit signed integers.
+ * For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Int8List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
native "Int8Array" {
+ /**
+ * Creates an [Int8List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Int8List(int length) => _create1(length);
+ /**
+ * Creates a [Int8List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Int8List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates an [Int8List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Int8List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ */
factory Int8List.view(ByteBuffer buffer, [int byteOffset = 0, int length]) =>
length == null
? _create2(buffer, byteOffset)
@@ -467,15 +845,43 @@
}
+/**
+ * A fixed-length list of 16-bit unsigned integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Uint16List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
native "Uint16Array" {
+ /**
+ * Creates a [Uint16List] of the specified length (in elements), all
+ * of whose elements are initially zero.
+ */
factory Uint16List(int length) => _create1(length);
+ /**
+ * Creates a [Uint16List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Uint16List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Uint16List] _view_ of the specified region in
+ * the specified byte buffer. Changes in the [Uint16List] will be
+ * visible in the byte buffer and vice versa. If the [offsetInBytes] index
+ * of the region is not specified, it defaults to zero (the first byte in
+ * the byte buffer). If the length is not specified, it defaults to null,
+ * which indicates that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Uint16List.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -515,15 +921,43 @@
}
+/**
+ * A fixed-length list of 32-bit unsigned integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Uint32List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
native "Uint32Array" {
+ /**
+ * Creates a [Uint32List] of the specified length (in elements), all
+ * of whose elements are initially zero.
+ */
factory Uint32List(int length) => _create1(length);
+ /**
+ * Creates a [Uint32List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Uint32List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Uint32List] _view_ of the specified region in
+ * the specified byte buffer. Changes in the [Uint32] will be
+ * visible in the byte buffer and vice versa. If the [offsetInBytes] index
+ * of the region is not specified, it defaults to zero (the first byte in
+ * the byte buffer). If the length is not specified, it defaults to null,
+ * which indicates that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Uint32List.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -563,14 +997,40 @@
}
+/**
+ * A fixed-length list of 8-bit unsigned integers.
+ * For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ * Indexed store clamps the value to range 0..0xFF.
+ */
class Uint8ClampedList extends TypedData with ListMixin<int>,
FixedLengthListMixin<int> implements JavaScriptIndexingBehavior, List<int>
native "Uint8ClampedArray,CanvasPixelArray" {
+ /**
+ * Creates a [Uint8ClampedList] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Uint8ClampedList(int length) => _create1(length);
+ /**
+ * Creates a [Uint8ClampedList] of the same size as the [elements]
+ * list and copies over the values clamping when needed.
+ */
factory Uint8ClampedList.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Uint8ClampedList] _view_ of the specified region in the
+ * specified byte [buffer]. Changes in the [Uint8List] will be visible in the
+ * byte buffer and vice versa. If the [offsetInBytes] index of the region is
+ * not specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates that
+ * the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ */
factory Uint8ClampedList.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -612,6 +1072,11 @@
}
+/**
+ * A fixed-length list of 8-bit unsigned integers.
+ * For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Uint8List
extends TypedData with ListMixin<int>, FixedLengthListMixin<int>
implements JavaScriptIndexingBehavior, List<int>
@@ -620,11 +1085,31 @@
// the potential for Uint8ClampedArray to 'accidentally' pick up the
// dispatch record for Uint8List.
native "Uint8Array,!nonleaf" {
+ /**
+ * Creates a [Uint8List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Uint8List(int length) => _create1(length);
+ /**
+ * Creates a [Uint8List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Uint8List.fromList(List<num> list) =>
_create1(_ensureNativeList(list));
+ /**
+ * Creates a [Uint8List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Uint8List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ */
factory Uint8List.view(ByteBuffer buffer,
[int byteOffset = 0, int length]) =>
length == null
@@ -664,15 +1149,43 @@
}
+/**
+ * A fixed-length list of 64-bit signed integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Int64List extends TypedData implements JavaScriptIndexingBehavior, List<int> {
+ /**
+ * Creates an [Int64List] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
factory Int64List(int length) {
throw new UnsupportedError("Int64List not supported by dart2js.");
}
+ /**
+ * Creates a [Int64List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Int64List.fromList(List<int> list) {
throw new UnsupportedError("Int64List not supported by dart2js.");
}
+ /**
+ * Creates an [Int64List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Int64List] will be visible in the byte buffer
+ * and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates that
+ * the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Int64List.view(ByteBuffer buffer, [int byteOffset, int length]) {
throw new UnsupportedError("Int64List not supported by dart2js.");
}
@@ -681,15 +1194,44 @@
}
+/**
+ * A fixed-length list of 64-bit unsigned integers that is viewable as a
+ * [TypedData]. For long lists, this implementation can be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ */
class Uint64List extends TypedData implements JavaScriptIndexingBehavior, List<int> {
+ /**
+ * Creates a [Uint64List] of the specified length (in elements), all
+ * of whose elements are initially zero.
+ */
factory Uint64List(int length) {
throw new UnsupportedError("Uint64List not supported by dart2js.");
}
+ /**
+ * Creates a [Uint64List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Uint64List.fromList(List<int> list) {
throw new UnsupportedError("Uint64List not supported by dart2js.");
}
+ /**
+ * Creates an [Uint64List] _view_ of the specified region in
+ * the specified byte buffer. Changes in the [Uint64List] will be
+ * visible in the byte buffer and vice versa. If the [offsetInBytes]
+ * index of the region is not specified, it defaults to zero (the first
+ * byte in the byte buffer). If the length is not specified, it defaults
+ * to null, which indicates that the view extends to the end of the byte
+ * buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
factory Uint64List.view(ByteBuffer buffer, [int byteOffset, int length]) {
throw new UnsupportedError("Uint64List not supported by dart2js.");
}
@@ -698,6 +1240,11 @@
}
+/**
+ * A fixed-length list of Float32x4 numbers that is viewable as a
+ * [TypedData]. For long lists, this implementation will be considerably more
+ * space- and time-efficient than the default [List] implementation.
+ */
class Float32x4List
extends Object with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
implements List<Float32x4>, TypedData {
@@ -738,6 +1285,10 @@
return end;
}
+ /**
+ * Creates a [Float32x4List] of the specified length (in elements),
+ * all of whose elements are initially zero.
+ */
Float32x4List(int length) : _storage = new Float32List(length*4);
Float32x4List._externalStorage(Float32List storage) : _storage = storage;
@@ -753,6 +1304,10 @@
}
}
+ /**
+ * Creates a [Float32x4List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Float32x4List.fromList(List<Float32x4> list) {
if (list is Float32x4List) {
Float32x4List nativeList = list as Float32x4List;
@@ -763,6 +1318,21 @@
}
}
+ /**
+ * Creates a [Float32x4List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Float32x4List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
Float32x4List.view(ByteBuffer buffer,
[int byteOffset = 0, int length])
: _storage = new Float32List.view(buffer, byteOffset, length);
@@ -795,6 +1365,11 @@
}
+/**
+ * A fixed-length list of Int32x4 numbers that is viewable as a
+ * [TypedData]. For long lists, this implementation will be considerably more
+ * space- and time-efficient than the default [List] implementation.
+ */
class Int32x4List
extends Object with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
implements List<Int32x4>, TypedData {
@@ -835,6 +1410,10 @@
return end;
}
+ /**
+ * Creates a [Int32x4List] of the specified length (in elements),
+ * all of whose elements are initially zero.
+ */
Int32x4List(int length) : _storage = new Uint32List(length*4);
Int32x4List._externalStorage(Uint32List storage) : _storage = storage;
@@ -850,6 +1429,10 @@
}
}
+ /**
+ * Creates a [Int32x4List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
factory Int32x4List.fromList(List<Int32x4> list) {
if (list is Int32x4List) {
Int32x4List nativeList = list as Int32x4List;
@@ -860,6 +1443,21 @@
}
}
+ /**
+ * Creates a [Int32x4List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Int32x4List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
Int32x4List.view(ByteBuffer buffer,
[int byteOffset = 0, int length])
: _storage = new Uint32List.view(buffer, byteOffset, length);
@@ -892,6 +1490,11 @@
}
+/**
+ * Interface of Dart Float32x4 immutable value type and operations.
+ * Float32x4 stores 4 32-bit floating point values in "lanes".
+ * The lanes are "x", "y", "z", and "w" respectively.
+ */
class Float32x4 {
final _storage = new Float32List(4);
@@ -1472,6 +2075,11 @@
}
+/**
+ * Interface of Dart Int32x4 and operations.
+ * Int32x4 stores 4 32-bit bit-masks in "lanes".
+ * The lanes are "x", "y", "z", and "w" respectively.
+ */
class Int32x4 {
final _storage = new Int32List(4);
diff --git a/tests/co19/co19-analyzer.status b/tests/co19/co19-analyzer.status
index d45b668..a2bfdea 100644
--- a/tests/co19/co19-analyzer.status
+++ b/tests/co19/co19-analyzer.status
@@ -289,7 +289,6 @@
Language/05_Variables/05_Variables_A06_t01: MissingCompileTimeError # co19-roll r651: Please triage this failure
Language/05_Variables/05_Variables_A06_t02: MissingCompileTimeError # co19-roll r651: Please triage this failure
Language/05_Variables/05_Variables_A06_t03: MissingCompileTimeError # co19-roll r651: Please triage this failure
-Language/12_Expressions/01_Constants_A20_t04: CompileTimeError # co19-roll r651: Please triage this failure
Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A01_t03: MissingStaticWarning # co19-roll r651: Please triage this failure
Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t13: CompileTimeError # co19-roll r651: Please triage this failure
Language/12_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t17: MissingCompileTimeError # co19-roll r651: Please triage this failure
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index 2ce056c..ccf8527 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -16,7 +16,6 @@
function_type_alias9_test/00: crash # Issue 11987
# TBF: we should check conflicts not only for methods, but for accessors too
-override_field_test/02: fail
override_field_test/03: fail
method_override7_test/03: Fail # Issue 11496
method_override8_test/03: Fail # Issue 11496
@@ -72,9 +71,6 @@
# test issue 11590, runtime only negative test
field_method4_negative_test: fail
-# test issue 11592, Function type alias (typedef) is not a constant
-first_class_types_constants_test: fail
-
# test issue 11594, Reference to a not resolve identifier is static warning
import_combinators_negative_test: fail
interface_static_non_final_fields_negative_test: fail
diff --git a/tests/lib/math/point_test.dart b/tests/lib/math/point_test.dart
index f15c635..8d9ab72 100644
--- a/tests/lib/math/point_test.dart
+++ b/tests/lib/math/point_test.dart
@@ -9,14 +9,14 @@
main() {
test('constructor', () {
- var point = new Point();
+ var point = new Point(0, 0);
expect(point.x, 0);
expect(point.y, 0);
expect('$point', 'Point(0, 0)');
});
test('constructor X', () {
- var point = new Point<int>(10);
+ var point = new Point<int>(10, 0);
expect(point.x, 10);
expect(point.y, 0);
expect('$point', 'Point(10, 0)');
diff --git a/tools/VERSION b/tools/VERSION
index 0f1a9ac..e046834 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
MINOR 8
BUILD 10
-PATCH 8
+PATCH 9
diff --git a/tools/dom/docs/docs.json b/tools/dom/docs/docs.json
index ba4e5fc..b218268 100644
--- a/tools/dom/docs/docs.json
+++ b/tools/dom/docs/docs.json
@@ -199,6 +199,44 @@
]
}
},
+ "CanvasRenderingContext2D": {
+ "members": {
+ "currentPath": [
+ "/**",
+ " * The current default path of this canvas context, if there is one.",
+ " *",
+ " * ## Other resources",
+ " *",
+ " * * [Current default path]",
+ " * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#current-default-path)",
+ " * from WHATWG.",
+ " */"
+ ],
+ "imageSmoothingEnabled": [
+ "/**",
+ " * Whether images and patterns on this canvas will be smoothed when this",
+ " * canvas is scaled.",
+ " *",
+ " * ## Other resources",
+ " *",
+ " * * [Image smoothing]",
+ " * (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#image-smoothing)",
+ " * from WHATWG.",
+ " */"
+ ],
+ "webkitBackingStorePixelRatio": [
+ "/**",
+ " * The ratio between this canvas' backing store dimensions and the canvas'",
+ " * logical dimensions.",
+ " *",
+ " * ## Other resources",
+ " *",
+ " * * [High DPI Canvas tutorial]",
+ " * (http://www.html5rocks.com/en/tutorials/canvas/hidpi/) from HTML5Rocks.",
+ " */"
+ ]
+ }
+ },
"Clipboard": {
"members": {
"getData": [
@@ -416,6 +454,7 @@
" * save typing a few characters.",
" *",
" * [selectors] should be a string using CSS selector syntax.",
+ " *",
" * var element1 = document.querySelector('.className');",
" * var element2 = document.querySelector('#id');",
" *",
@@ -465,6 +504,24 @@
]
}
},
+ "DocumentFragment": {
+ "members": {
+ "querySelector": [
+ "/**",
+ " * Finds the first descendant element of this document fragment that matches",
+ " * the specified group of selectors.",
+ " *",
+ " * [selectors] should be a string using CSS selector syntax.",
+ " *",
+ " * var element1 = fragment.querySelector('.className');",
+ " * var element2 = fragment.querySelector('#id');",
+ " *",
+ " * For details about CSS selector syntax, see the",
+ " * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).",
+ " */"
+ ]
+ }
+ },
"Element": {
"comment": [
"/**",
@@ -1166,9 +1223,8 @@
" * // Gets the first descendant [ImageElement]",
" * var img = element.querySelector('img');",
" *",
- " * See also:",
- " *",
- " * * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors)",
+ " * For details about CSS selector syntax, see the",
+ " * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).",
" */"
],
"resetEvent": [
diff --git a/tools/dom/src/shared_html.dart b/tools/dom/src/shared_html.dart
index b0b3c47..c44effc 100644
--- a/tools/dom/src/shared_html.dart
+++ b/tools/dom/src/shared_html.dart
@@ -30,5 +30,39 @@
@Experimental()
ElementList queryAll(String relativeSelectors) => document.queryAll(relativeSelectors);
-Element querySelector(String selector) => document.querySelector(selector);
-ElementList querySelectorAll(String selector) => document.querySelectorAll(selector);
+/**
+ * Finds the first descendant element of this document that matches the
+ * specified group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelector]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var element1 = document.querySelector('.className');
+ * var element2 = document.querySelector('#id');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+Element querySelector(String selectors) => document.querySelector(selectors);
+
+/**
+ * Finds all descendant elements of this document that match the specified
+ * group of selectors.
+ *
+ * Unless your webpage contains multiple documents, the top-level
+ * [querySelectorAll]
+ * method behaves the same as this method, so you should use it instead to
+ * save typing a few characters.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
+ElementList querySelectorAll(String selectors) => document.querySelectorAll(selectors);
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate
index 32ec467..4b6c0d1 100644
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate
@@ -19,6 +19,7 @@
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
+ *
* var items = document.querySelectorAll('.itemClassName');
*
* For details about CSS selector syntax, see the
diff --git a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
index c57cf1e..e57d98f 100644
--- a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -43,6 +43,17 @@
children.addAll(copy);
}
+ /**
+ * Finds all descendant elements of this document fragment that match the
+ * specified group of selectors.
+ *
+ * [selectors] should be a string using CSS selector syntax.
+ *
+ * var items = document.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
+ */
ElementList querySelectorAll(String selectors) =>
new _FrozenElementList._wrap(_querySelectorAll(selectors));
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index ded2ef0..b742efd 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -586,6 +586,9 @@
* [selectors] should be a string using CSS selector syntax.
*
* var items = element.querySelectorAll('.itemClassName');
+ *
+ * For details about CSS selector syntax, see the
+ * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Element.querySelectorAll')
ElementList querySelectorAll(String selectors) =>