Chromium Code Reviews| 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 5f54dcc4b2fd96cc0decd7ae404558a5b713f686..56ce509dd63b2312e9e0f47092b28dfe4d6c66a2 100644 |
| --- a/sdk/lib/html/dart2js/html_dart2js.dart |
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart |
| @@ -8675,6 +8675,13 @@ abstract class Element extends Node implements ElementTraversal native "Element" |
| TemplateElement.decorate(this); |
| } |
| + /** Provides the coordinates of the element relative to the document. */ |
| + Point get documentOffset() { |
|
blois
2013/07/12 23:10:08
Seems like it would be more useful to expose somet
|
| + final docElem = document.documentElement; |
| + final box = getBoundingClientRect(); |
| + return new Point(box.left + window.pageXOffset - docElem.clientLeft, |
| + box.top + window.pageYOffset - docElem.clientTop); |
| + } |
| // To suppress missing implicit constructor warnings. |
| factory Element._() { throw new UnsupportedError("Not supported"); } |