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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 12493003: Exposing Point & Rect types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to ToT Created 7 years, 9 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:
Download patch
« no previous file with comments | « samples/swipe/web/swipe.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 9af468e7e6a9b6d33cfd694956bd83e94711bade..761af0c5237c7addffd2a8ad7fdc6d41668c36c0 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -1525,39 +1525,6 @@ class CharacterData extends Node native "*CharacterData" {
@DocsEditable
-@DomName('ClientRect')
-class ClientRect native "*ClientRect" {
-
- @DomName('ClientRect.bottom')
- @DocsEditable
- final num bottom;
-
- @DomName('ClientRect.height')
- @DocsEditable
- final num height;
-
- @DomName('ClientRect.left')
- @DocsEditable
- final num left;
-
- @DomName('ClientRect.right')
- @DocsEditable
- final num right;
-
- @DomName('ClientRect.top')
- @DocsEditable
- final num top;
-
- @DomName('ClientRect.width')
- @DocsEditable
- final num width;
-}
-// 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.
-
-
-@DocsEditable
@DomName('CloseEvent')
class CloseEvent extends Event native "*CloseEvent" {
@@ -9375,13 +9342,13 @@ abstract class Element extends Node implements ElementTraversal native "*Element
@DomName('Element.getBoundingClientRect')
@DocsEditable
- ClientRect getBoundingClientRect() native;
+ Rect getBoundingClientRect() native;
@DomName('Element.getClientRects')
@DocsEditable
@Returns('_ClientRectList')
@Creates('_ClientRectList')
- List<ClientRect> getClientRects() native;
+ List<Rect> getClientRects() native;
@JSName('getElementsByClassName')
@DomName('Element.getElementsByClassName')
@@ -16612,13 +16579,15 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
@DocsEditable
final int button;
+ @JSName('clientX')
@DomName('MouseEvent.clientX')
@DocsEditable
- final int clientX;
+ final int $dom_clientX;
+ @JSName('clientY')
@DomName('MouseEvent.clientY')
@DocsEditable
- final int clientY;
+ final int $dom_clientY;
@DomName('MouseEvent.ctrlKey')
@DocsEditable
@@ -16644,13 +16613,15 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
@Returns('EventTarget|=Object')
final dynamic _get_relatedTarget;
+ @JSName('screenX')
@DomName('MouseEvent.screenX')
@DocsEditable
- final int screenX;
+ final int $dom_screenX;
+ @JSName('screenY')
@DomName('MouseEvent.screenY')
@DocsEditable
- final int screenY;
+ final int $dom_screenY;
@DomName('MouseEvent.shiftKey')
@DocsEditable
@@ -16666,7 +16637,7 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- final int movementX;
+ final int $dom_webkitMovementX;
@JSName('webkitMovementY')
@DomName('MouseEvent.webkitMovementY')
@@ -16674,7 +16645,7 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- final int movementY;
+ final int $dom_webkitMovementY;
@DomName('MouseEvent.initMouseEvent')
@DocsEditable
@@ -16689,18 +16660,46 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
void _$dom_initMouseEvent_1(type, canBubble, cancelable, Window view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) native;
- // TODO(amouravski): Move this documentation out of thise template files and
- // put it into docs.json. Remember to add @DomName here.
+ @deprecated
+ int get clientX => client.x;
+ @deprecated
+ int get clientY => client.y;
+ @deprecated
+ int get offsetX => offset.x;
+ @deprecated
+ int get offsetY => offset.y;
+ @deprecated
+ int get movementX => movement.x;
+ @deprecated
+ int get movementY => movement.y;
+ @deprecated
+ int get screenX => screen.x;
+ @deprecated
+ int get screenY => screen.y;
+
+ @DomName('MouseEvent.clientX')
+ @DomName('MouseEvent.clientY')
+ Point get client => new Point($dom_clientX, $dom_clientY);
+
+ @DomName('MouseEvent.movementX')
+ @DomName('MouseEvent.movementY')
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ Point get movement => new Point($dom_webkitMovementX, $dom_webkitMovementY);
+
/**
- * The X coordinate of the mouse pointer in target node coordinates.
+ * The coordinates of the mouse pointer in target node coordinates.
*
* This value may vary between platforms if the target node moves
* after the event has fired or if the element has CSS transforms affecting
* it.
*/
- int get offsetX {
- if (JS('bool', '!!#.offsetX', this)) {
- return JS('int', '#.offsetX', this);
+ Point get offset {
+ if (JS('bool', '!!#.offsetX', this)) {
+ var x = JS('int', '#.offsetX', this);
+ var y = JS('int', '#.offsetX', this);
+ return new Point(x, y);
} else {
// Firefox does not support offsetX.
var target = this.target;
@@ -16708,30 +16707,14 @@ class MouseEvent extends UIEvent native "*MouseEvent" {
throw new UnsupportedError(
'offsetX is only supported on elements');
}
- return this.clientX - this.target.getBoundingClientRect().left;
+ return (this.client -
+ this.target.getBoundingClientRect().topLeft).toInt();
}
}
- /**
- * The Y coordinate of the mouse pointer in target node coordinates.
- *
- * This value may vary between platforms if the target node moves
- * after the event has fired or if the element has CSS transforms affecting
- * it.
- */
- int get offsetY {
- if (JS('bool', '!!#.offsetY', this)) {
- return JS('int', '#.offsetY', this);
- } else {
- // Firefox does not support offsetY.
- var target = this.target;
- if (!(target is Element)) {
- throw new UnsupportedError(
- 'offsetY is only supported on elements');
- }
- return this.clientY - this.target.getBoundingClientRect().top;
- }
- }
+ @DomName('MouseEvent.screenX')
+ @DomName('MouseEvent.screenY')
+ Point get screen => new Point($dom_screenX, $dom_screenY);
}
// 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
@@ -18841,13 +18824,13 @@ class Range native "*Range" {
@DomName('Range.getBoundingClientRect')
@DocsEditable
- ClientRect getBoundingClientRect() native;
+ Rect getBoundingClientRect() native;
@DomName('Range.getClientRects')
@DocsEditable
@Returns('_ClientRectList')
@Creates('_ClientRectList')
- List<ClientRect> getClientRects() native;
+ List<Rect> getClientRects() native;
@DomName('Range.insertNode')
@DocsEditable
@@ -22071,33 +22054,39 @@ class TitleElement extends Element native "*HTMLTitleElement" {
@DomName('Touch')
class Touch native "*Touch" {
+ @JSName('clientX')
@DomName('Touch.clientX')
@DocsEditable
- final int clientX;
+ final int $dom_clientX;
+ @JSName('clientY')
@DomName('Touch.clientY')
@DocsEditable
- final int clientY;
+ final int $dom_clientY;
@DomName('Touch.identifier')
@DocsEditable
final int identifier;
+ @JSName('pageX')
@DomName('Touch.pageX')
@DocsEditable
- final int pageX;
+ final int $dom_pageX;
+ @JSName('pageY')
@DomName('Touch.pageY')
@DocsEditable
- final int pageY;
+ final int $dom_pageY;
+ @JSName('screenX')
@DomName('Touch.screenX')
@DocsEditable
- final int screenX;
+ final int $dom_screenX;
+ @JSName('screenY')
@DomName('Touch.screenY')
@DocsEditable
- final int screenY;
+ final int $dom_screenY;
EventTarget get target => _convertNativeToDart_EventTarget(this._get_target);
@JSName('target')
@@ -22138,6 +22127,19 @@ class Touch native "*Touch" {
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
final num rotationAngle;
+
+
+ @DomName('Touch.clientX')
+ @DomName('Touch.clientY')
+ Point get client => new Point($dom_clientX, $dom_clientY);
+
+ @DomName('Touch.pageX')
+ @DomName('Touch.pageY')
+ Point get page => new Point($dom_pageX, $dom_pageY);
+
+ @DomName('Touch.screenX')
+ @DomName('Touch.screenY')
+ Point get screen => new Point($dom_screenX, $dom_screenY);
}
// 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
@@ -22607,21 +22609,25 @@ class UIEvent extends Event native "*UIEvent" {
@DocsEditable
final int $dom_keyCode;
+ @JSName('layerX')
@DomName('UIEvent.layerX')
@DocsEditable
- final int layerX;
+ final int $dom_layerX;
+ @JSName('layerY')
@DomName('UIEvent.layerY')
@DocsEditable
- final int layerY;
+ final int $dom_layerY;
+ @JSName('pageX')
@DomName('UIEvent.pageX')
@DocsEditable
- final int pageX;
+ final int $dom_pageX;
+ @JSName('pageY')
@DomName('UIEvent.pageY')
@DocsEditable
- final int pageY;
+ final int $dom_pageY;
WindowBase get view => _convertNativeToDart_Window(this._get_view);
@JSName('view')
@@ -22640,6 +22646,24 @@ class UIEvent extends Event native "*UIEvent" {
@DocsEditable
void $dom_initUIEvent(String type, bool canBubble, bool cancelable, Window view, int detail) native;
+
+ @deprecated
+ int get layerX => layer.x;
+ @deprecated
+ int get layerY => layer.y;
+
+ @deprecated
+ int get pageX => page.x;
+ @deprecated
+ int get pageY => page.y;
+
+ @DomName('UIEvent.layerX')
+ @DomName('UIEvent.layerY')
+ Point get layer => new Point($dom_layerX, $dom_layerY);
+
+ @DomName('UIEvent.pageX')
+ @DomName('UIEvent.pageY')
+ Point get page => new Point($dom_pageX, $dom_pageY);
}
// 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
@@ -27057,6 +27081,131 @@ class XsltProcessor native "*XSLTProcessor" {
@DocsEditable
DocumentFragment transformToFragment(Node source, Document docVal) native;
}
+// 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.
+
+
+@DocsEditable
+@DomName('ClientRect')
+class _ClientRect implements Rect native "*ClientRect" {
+
+ // NOTE! All code below should be common with Rect.
+ // TODO(blois): implement with mixins when available.
+
+ String toString() {
+ return '($left, $top, $width, $height)';
+ }
+
+ bool operator ==(other) {
+ if (other is !Rect) return false;
+ return left == other.left && top == other.top && width == other.width &&
+ height == other.height;
+ }
+
+ /**
+ * Computes the intersection of this rectangle and the rectangle parameter.
+ * Returns null if there is no intersection.
+ */
+ Rect intersection(Rect rect) {
+ var x0 = max(left, rect.left);
+ var x1 = min(left + width, rect.left + rect.width);
+
+ if (x0 <= x1) {
+ var y0 = max(top, rect.top);
+ var y1 = min(top + height, rect.top + rect.height);
+
+ if (y0 <= y1) {
+ return new Rect(x0, y0, x1 - x0, y1 - y0);
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns whether a rectangle intersects this rectangle.
+ */
+ bool intersects(Rect other) {
+ return (left <= other.left + other.width && other.left <= left + width &&
+ top <= other.top + other.height && other.top <= top + height);
+ }
+
+ /**
+ * Returns a new rectangle which completely contains this rectangle and the
+ * input rectangle.
+ */
+ Rect union(Rect rect) {
+ var right = max(this.left + this.width, rect.left + rect.width);
+ var bottom = max(this.top + this.height, rect.top + rect.height);
+
+ var left = min(this.left, rect.left);
+ var top = min(this.top, rect.top);
+
+ return new Rect(left, top, right - left, bottom - top);
+ }
+
+ /**
+ * Tests whether this rectangle entirely contains another rectangle.
+ */
+ bool containsRect(Rect another) {
+ return left <= another.left &&
+ left + width >= another.left + another.width &&
+ top <= another.top &&
+ top + height >= another.top + another.height;
+ }
+
+ /**
+ * Tests whether this rectangle entirely contains a point.
+ */
+ bool containsPoint(Point another) {
+ return another.x >= left &&
+ another.x <= left + width &&
+ another.y >= top &&
+ another.y <= top + height;
+ }
+
+ Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
+ Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
+ height.floor());
+ Rect round() => new Rect(left.round(), top.round(), width.round(),
+ height.round());
+
+ /**
+ * Truncates coordinates to integers and returns the result as a new
+ * rectangle.
+ */
+ Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
+ height.toInt());
+
+ Point get topLeft => new Point(this.left, this.top);
+ Point get bottomRight => new Point(this.left + this.width,
+ this.top + this.height);
+
+ @DomName('ClientRect.bottom')
+ @DocsEditable
+ final num bottom;
+
+ @DomName('ClientRect.height')
+ @DocsEditable
+ final num height;
+
+ @DomName('ClientRect.left')
+ @DocsEditable
+ final num left;
+
+ @DomName('ClientRect.right')
+ @DocsEditable
+ final num right;
+
+ @DomName('ClientRect.top')
+ @DocsEditable
+ final num top;
+
+ @DomName('ClientRect.width')
+ @DocsEditable
+ final num width;
+}
// 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.
@@ -27064,103 +27213,103 @@ class XsltProcessor native "*XSLTProcessor" {
@DocsEditable
@DomName('ClientRectList')
-class _ClientRectList implements JavaScriptIndexingBehavior, List<ClientRect> native "*ClientRectList" {
+class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native "*ClientRectList" {
@DomName('ClientRectList.length')
@DocsEditable
int get length => JS("int", "#.length", this);
- ClientRect operator[](int index) => JS("ClientRect", "#[#]", this, index);
+ Rect operator[](int index) => JS("Rect", "#[#]", this, index);
- void operator[]=(int index, ClientRect value) {
+ void operator[]=(int index, Rect value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
- // -- start List<ClientRect> mixins.
- // ClientRect is the element type.
+ // -- start List<Rect> mixins.
+ // Rect is the element type.
- // From Iterable<ClientRect>:
+ // From Iterable<Rect>:
- Iterator<ClientRect> get iterator {
+ Iterator<Rect> get iterator {
// Note: NodeLists are not fixed size. And most probably length shouldn't
// be cached in both iterator _and_ forEach method. For now caching it
// for consistency.
- return new FixedSizeListIterator<ClientRect>(this);
+ return new FixedSizeListIterator<Rect>(this);
}
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, ClientRect)) {
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Rect)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
- bool contains(ClientRect element) => IterableMixinWorkaround.contains(this, element);
+ bool contains(Rect element) => IterableMixinWorkaround.contains(this, element);
- void forEach(void f(ClientRect element)) => IterableMixinWorkaround.forEach(this, f);
+ void forEach(void f(Rect element)) => IterableMixinWorkaround.forEach(this, f);
String join([String separator]) =>
IterableMixinWorkaround.joinList(this, separator);
- Iterable map(f(ClientRect element)) =>
+ Iterable map(f(Rect element)) =>
IterableMixinWorkaround.mapList(this, f);
- Iterable<ClientRect> where(bool f(ClientRect element)) =>
+ Iterable<Rect> where(bool f(Rect element)) =>
IterableMixinWorkaround.where(this, f);
- Iterable expand(Iterable f(ClientRect element)) =>
+ Iterable expand(Iterable f(Rect element)) =>
IterableMixinWorkaround.expand(this, f);
- bool every(bool f(ClientRect element)) => IterableMixinWorkaround.every(this, f);
+ bool every(bool f(Rect element)) => IterableMixinWorkaround.every(this, f);
- bool any(bool f(ClientRect element)) => IterableMixinWorkaround.any(this, f);
+ bool any(bool f(Rect element)) => IterableMixinWorkaround.any(this, f);
- List<ClientRect> toList({ bool growable: true }) =>
- new List<ClientRect>.from(this, growable: growable);
+ List<Rect> toList({ bool growable: true }) =>
+ new List<Rect>.from(this, growable: growable);
- Set<ClientRect> toSet() => new Set<ClientRect>.from(this);
+ Set<Rect> toSet() => new Set<Rect>.from(this);
bool get isEmpty => this.length == 0;
- Iterable<ClientRect> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ Iterable<Rect> take(int n) => IterableMixinWorkaround.takeList(this, n);
- Iterable<ClientRect> takeWhile(bool test(ClientRect value)) {
+ Iterable<Rect> takeWhile(bool test(Rect value)) {
return IterableMixinWorkaround.takeWhile(this, test);
}
- Iterable<ClientRect> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ Iterable<Rect> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- Iterable<ClientRect> skipWhile(bool test(ClientRect value)) {
+ Iterable<Rect> skipWhile(bool test(Rect value)) {
return IterableMixinWorkaround.skipWhile(this, test);
}
- ClientRect firstMatching(bool test(ClientRect value), { ClientRect orElse() }) {
+ Rect firstMatching(bool test(Rect value), { Rect orElse() }) {
return IterableMixinWorkaround.firstMatching(this, test, orElse);
}
- ClientRect lastMatching(bool test(ClientRect value), {ClientRect orElse()}) {
+ Rect lastMatching(bool test(Rect value), {Rect orElse()}) {
return IterableMixinWorkaround.lastMatchingInList(this, test, orElse);
}
- ClientRect singleMatching(bool test(ClientRect value)) {
+ Rect singleMatching(bool test(Rect value)) {
return IterableMixinWorkaround.singleMatching(this, test);
}
- ClientRect elementAt(int index) {
+ Rect elementAt(int index) {
return this[index];
}
- // From Collection<ClientRect>:
+ // From Collection<Rect>:
- void add(ClientRect value) {
+ void add(Rect value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addLast(ClientRect value) {
+ void addLast(Rect value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addAll(Iterable<ClientRect> iterable) {
+ void addAll(Iterable<Rect> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- // From List<ClientRect>:
+ // From List<Rect>:
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
@@ -27169,49 +27318,49 @@ class _ClientRectList implements JavaScriptIndexingBehavior, List<ClientRect> na
throw new UnsupportedError("Cannot clear immutable List.");
}
- Iterable<ClientRect> get reversed {
+ Iterable<Rect> get reversed {
return IterableMixinWorkaround.reversedList(this);
}
- void sort([int compare(ClientRect a, ClientRect b)]) {
+ void sort([int compare(Rect a, Rect b)]) {
throw new UnsupportedError("Cannot sort immutable List.");
}
- int indexOf(ClientRect element, [int start = 0]) =>
+ int indexOf(Rect element, [int start = 0]) =>
Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(ClientRect element, [int start]) {
+ int lastIndexOf(Rect element, [int start]) {
if (start == null) start = length - 1;
return Lists.lastIndexOf(this, element, start);
}
- ClientRect get first {
+ Rect get first {
if (this.length > 0) return this[0];
throw new StateError("No elements");
}
- ClientRect get last {
+ Rect get last {
if (this.length > 0) return this[this.length - 1];
throw new StateError("No elements");
}
- ClientRect get single {
+ Rect get single {
if (length == 1) return this[0];
if (length == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
- ClientRect min([int compare(ClientRect a, ClientRect b)]) =>
+ Rect min([int compare(Rect a, Rect b)]) =>
IterableMixinWorkaround.min(this, compare);
- ClientRect max([int compare(ClientRect a, ClientRect b)]) =>
+ Rect max([int compare(Rect a, Rect b)]) =>
IterableMixinWorkaround.max(this, compare);
- ClientRect removeAt(int pos) {
+ Rect removeAt(int pos) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- ClientRect removeLast() {
+ Rect removeLast() {
throw new UnsupportedError("Cannot remove from immutable List.");
}
@@ -27227,15 +27376,15 @@ class _ClientRectList implements JavaScriptIndexingBehavior, List<ClientRect> na
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void removeMatching(bool test(ClientRect element)) {
+ void removeMatching(bool test(Rect element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void retainMatching(bool test(ClientRect element)) {
+ void retainMatching(bool test(Rect element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void setRange(int start, int rangeLength, List<ClientRect> from, [int startFrom]) {
+ void setRange(int start, int rangeLength, List<Rect> from, [int startFrom]) {
throw new UnsupportedError("Cannot setRange on immutable List.");
}
@@ -27243,21 +27392,21 @@ class _ClientRectList implements JavaScriptIndexingBehavior, List<ClientRect> na
throw new UnsupportedError("Cannot removeRange on immutable List.");
}
- void insertRange(int start, int rangeLength, [ClientRect initialValue]) {
+ void insertRange(int start, int rangeLength, [Rect initialValue]) {
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
- List<ClientRect> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <ClientRect>[]);
+ List<Rect> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Rect>[]);
- Map<int, ClientRect> asMap() =>
+ Map<int, Rect> asMap() =>
IterableMixinWorkaround.asMapList(this);
- // -- end List<ClientRect> mixins.
+ // -- end List<Rect> mixins.
@DomName('ClientRectList.item')
@DocsEditable
- ClientRect item(int index) native;
+ Rect item(int index) native;
}
// 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
@@ -31193,14 +31342,7 @@ class Rect {
final num width;
final num height;
- Rect(this.left, this.top, this.width, this.height) {
- if (width < 0) {
- throw new ArgumentError(width);
- }
- if (height < 0) {
- throw new ArgumentError(height);
- }
- }
+ const Rect(this.left, this.top, this.width, this.height);
factory Rect.fromPoints(Point a, Point b) {
var left;
@@ -32385,12 +32527,10 @@ class KeyEvent implements KeyboardEvent {
* KeyLocation.NUMPAD, KeyLocation.MOBILE, KeyLocation.JOYSTICK).
*/
int get keyLocation => _parent.keyLocation;
- int get layerX => _parent.layerX;
- int get layerY => _parent.layerY;
+ Point get layer => _parent.layer;
/** True if the Meta (or Mac command) key is pressed during this event. */
bool get metaKey => _parent.metaKey;
- int get pageX => _parent.pageX;
- int get pageY => _parent.pageY;
+ Point get page => _parent.page;
bool get returnValue => _parent.returnValue;
void set returnValue(bool value) {
_parent.returnValue = value;
« no previous file with comments | « samples/swipe/web/swipe.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698