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

Side by Side Diff: Source/devtools/front_end/toolbox/InspectedPagePlaceholder.js

Issue 727823002: [DevTools] Ban getSelection, requestAnimationFrame, cancelAnimationFrame global functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.View} 7 * @extends {WebInspector.View}
8 */ 8 */
9 WebInspector.InspectedPagePlaceholder = function() 9 WebInspector.InspectedPagePlaceholder = function()
10 { 10 {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 onResize: function() 52 onResize: function()
53 { 53 {
54 this._findMargins(); 54 this._findMargins();
55 this._scheduleUpdate(); 55 this._scheduleUpdate();
56 }, 56 },
57 57
58 _scheduleUpdate: function() 58 _scheduleUpdate: function()
59 { 59 {
60 if (this._updateId) 60 if (this._updateId)
61 window.cancelAnimationFrame(this._updateId); 61 this.element.window().cancelAnimationFrame(this._updateId);
62 this._updateId = window.requestAnimationFrame(this.update.bind(this)); 62 this._updateId = this.element.window().requestAnimationFrame(this.update .bind(this));
63 }, 63 },
64 64
65 /** 65 /**
66 * @return {!Size} 66 * @return {!Size}
67 */ 67 */
68 dipPageSize: function() 68 dipPageSize: function()
69 { 69 {
70 var rect = this._dipPageRect(); 70 var rect = this._dipPageRect();
71 return new Size(Math.round(rect.width), Math.round(rect.height)); 71 return new Size(Math.round(rect.width), Math.round(rect.height));
72 }, 72 },
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 update: function() 114 update: function()
115 { 115 {
116 delete this._updateId; 116 delete this._updateId;
117 var rect = this._dipPageRect(); 117 var rect = this._dipPageRect();
118 var bounds = { x: Math.round(rect.x), y: Math.round(rect.y), height: Mat h.max(1, Math.round(rect.height)), width: Math.max(1, Math.round(rect.width)) }; 118 var bounds = { x: Math.round(rect.x), y: Math.round(rect.y), height: Mat h.max(1, Math.round(rect.height)), width: Math.max(1, Math.round(rect.width)) };
119 this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Even ts.Update, bounds); 119 this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Even ts.Update, bounds);
120 }, 120 },
121 121
122 __proto__: WebInspector.View.prototype 122 __proto__: WebInspector.View.prototype
123 }; 123 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698