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

Side by Side Diff: Source/devtools/front_end/ui/ViewportControl.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | « Source/devtools/front_end/ui/View.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @param {!WebInspector.ViewportControl.Provider} provider 33 * @param {!WebInspector.ViewportControl.Provider} provider
34 */ 34 */
35 WebInspector.ViewportControl = function(provider) 35 WebInspector.ViewportControl = function(provider)
36 { 36 {
37 this.element = document.createElement("div"); 37 this.element = createElement("div");
38 this.element.style.overflow = "auto"; 38 this.element.style.overflow = "auto";
39 this._topGapElement = this.element.createChild("div", "viewport-control-gap- element"); 39 this._topGapElement = this.element.createChild("div", "viewport-control-gap- element");
40 this._topGapElement.textContent = "."; 40 this._topGapElement.textContent = ".";
41 this._topGapElement.style.height = "0px"; 41 this._topGapElement.style.height = "0px";
42 this._contentElement = this.element.createChild("div"); 42 this._contentElement = this.element.createChild("div");
43 this._bottomGapElement = this.element.createChild("div", "viewport-control-g ap-element"); 43 this._bottomGapElement = this.element.createChild("div", "viewport-control-g ap-element");
44 this._bottomGapElement.textContent = "."; 44 this._bottomGapElement.textContent = ".";
45 this._bottomGapElement.style.height = "0px"; 45 this._bottomGapElement.style.height = "0px";
46 46
47 this._provider = provider; 47 this._provider = provider;
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 /** 602 /**
603 * @return {number} 603 * @return {number}
604 */ 604 */
605 _visibleHeight: function() 605 _visibleHeight: function()
606 { 606 {
607 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll. 607 // Use offsetHeight instead of clientHeight to avoid being affected by h orizontal scroll.
608 return this.element.offsetHeight; 608 return this.element.offsetHeight;
609 } 609 }
610 } 610 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/View.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698