| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |