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

Side by Side Diff: client/html/src/WindowWrappingImplementation.dart

Issue 9145004: Revert "Example showing alternate async measurement solution" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « client/html/src/Window.dart ('k') | client/layout/GridLayout.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(jacobr): define a base class containing the overlap between 5 // TODO(jacobr): define a base class containing the overlap between
6 // this class and ElementEvents. 6 // this class and ElementEvents.
7 class WindowEventsImplementation extends EventsImplementation 7 class WindowEventsImplementation extends EventsImplementation
8 implements WindowEvents { 8 implements WindowEvents {
9 WindowEventsImplementation._wrap(_ptr) : super._wrap(_ptr); 9 WindowEventsImplementation._wrap(_ptr) : super._wrap(_ptr);
10 10
11 EventListenerList get abort() => _get('abort'); 11 EventListenerList get abort() => _get('abort');
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 796
797 void stop() { 797 void stop() {
798 _ptr.stop(); 798 _ptr.stop();
799 } 799 }
800 800
801 void webkitCancelRequestAnimationFrame(int id) { 801 void webkitCancelRequestAnimationFrame(int id) {
802 _ptr.webkitCancelRequestAnimationFrame(id); 802 _ptr.webkitCancelRequestAnimationFrame(id);
803 } 803 }
804 804
805 Point webkitConvertPointFromNodeToPage([Node node = null, Point p = null]) { 805 Point webkitConvertPointFromNodeToPage([Node node = null, Point p = null]) {
806 assert(_inMeasurementFrame);
807 if (node === null) { 806 if (node === null) {
808 if (p === null) { 807 if (p === null) {
809 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage()); 808 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage());
810 } 809 }
811 } else { 810 } else {
812 if (p === null) { 811 if (p === null) {
813 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage(LevelDom .unwrap(node))); 812 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage(LevelDom .unwrap(node)));
814 } else { 813 } else {
815 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage(LevelDom .unwrap(node), LevelDom.unwrap(p))); 814 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromNodeToPage(LevelDom .unwrap(node), LevelDom.unwrap(p)));
816 } 815 }
817 } 816 }
818 throw "Incorrect number or type of arguments"; 817 throw "Incorrect number or type of arguments";
819 } 818 }
820 819
821 Point webkitConvertPointFromPageToNode([Node node = null, Point p = null]) { 820 Point webkitConvertPointFromPageToNode([Node node = null, Point p = null]) {
822 assert(_inMeasurementFrame);
823 if (node === null) { 821 if (node === null) {
824 if (p === null) { 822 if (p === null) {
825 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode()); 823 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode());
826 } 824 }
827 } else { 825 } else {
828 if (p === null) { 826 if (p === null) {
829 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode(LevelDom .unwrap(node))); 827 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode(LevelDom .unwrap(node)));
830 } else { 828 } else {
831 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode(LevelDom .unwrap(node), LevelDom.unwrap(p))); 829 return LevelDom.wrapPoint(_ptr.webkitConvertPointFromPageToNode(LevelDom .unwrap(node), LevelDom.unwrap(p)));
832 } 830 }
833 } 831 }
834 throw "Incorrect number or type of arguments"; 832 throw "Incorrect number or type of arguments";
835 } 833 }
836 834
837 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback, [Eleme nt element = null]) { 835 int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback, [Eleme nt element = null]) {
838 return _ptr.webkitRequestAnimationFrame(callback, LevelDom.unwrap(element)); 836 return _ptr.webkitRequestAnimationFrame(callback, LevelDom.unwrap(element));
839 } 837 }
840 838
841 void requestMeasurementFrame(MeasurementCallback callback) { 839 void requestLayoutFrame(TimeoutHandler callback) {
842 _addMeasurementFrameCallback(callback); 840 _addMeasurementFrameCallback(callback);
843 } 841 }
844 842
845 bool get inMeasurementFrame() => _inMeasurementFrame;
846
847 WindowEvents get on() { 843 WindowEvents get on() {
848 if (_on === null) { 844 if (_on === null) {
849 _on = new WindowEventsImplementation._wrap(_ptr); 845 _on = new WindowEventsImplementation._wrap(_ptr);
850 } 846 }
851 return _on; 847 return _on;
852 } 848 }
853 } 849 }
OLDNEW
« no previous file with comments | « client/html/src/Window.dart ('k') | client/layout/GridLayout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698