Chromium Code Reviews| Index: Source/devtools/front_end/InspectedPagePlaceholder.js |
| diff --git a/Source/devtools/front_end/InspectedPagePlaceholder.js b/Source/devtools/front_end/InspectedPagePlaceholder.js |
| index 0251747b475d88a5e49c7e43ceb94658b75c24c0..cd52809e3fd9469cee63eba615ba67de2455f39c 100644 |
| --- a/Source/devtools/front_end/InspectedPagePlaceholder.js |
| +++ b/Source/devtools/front_end/InspectedPagePlaceholder.js |
| @@ -11,6 +11,7 @@ WebInspector.InspectedPagePlaceholder = function() |
| WebInspector.View.call(this); |
| WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); |
| this._margins = { top: false, right: false, bottom: false, left: false }; |
| + this.setMinimumSize(new Size(WebInspector.InspectedPagePlaceholder.Constraints.Width, WebInspector.InspectedPagePlaceholder.Constraints.Height)); |
| }; |
| WebInspector.InspectedPagePlaceholder.Constraints = { |
| @@ -82,25 +83,20 @@ WebInspector.InspectedPagePlaceholder.prototype = { |
| delete this._updateId; |
| var zoomFactor = WebInspector.zoomManager.zoomFactor(); |
| + var totalWidth = document.body.offsetWidth; |
|
pfeldman
2014/03/14 06:23:10
You change this code in every CL :)
dgozman
2014/03/14 15:55:15
Now we have improved system on Mac, and I have mor
|
| + var totalHeight = document.body.offsetHeight; |
| + var boundingRect = this.element.getBoundingClientRect(); |
| - var marginValue = Math.round(WebInspector.InspectedPagePlaceholder.MarginValue / zoomFactor); |
| var insets = { |
| - top: this._margins.top ? marginValue : 0, |
| - left: this._margins.left ? marginValue : 0, |
| - right: this._margins.right ? marginValue : 0, |
| - bottom: this._margins.bottom ? marginValue : 0}; |
| + top: Math.round(boundingRect.top * zoomFactor), |
| + left: Math.round(boundingRect.left * zoomFactor), |
| + bottom: Math.round((totalHeight - boundingRect.bottom) * zoomFactor), |
| + right: Math.round((totalWidth - boundingRect.right) * zoomFactor)}; |
| + var marginValue = Math.round(WebInspector.InspectedPagePlaceholder.MarginValue / zoomFactor); |
| var minSize = { |
| - width: WebInspector.InspectedPagePlaceholder.Constraints.Width - Math.round(insets.left * zoomFactor) - Math.round(insets.right * zoomFactor), |
| - height: WebInspector.InspectedPagePlaceholder.Constraints.Height - Math.round(insets.top * zoomFactor) - Math.round(insets.bottom * zoomFactor)}; |
| - |
| - // This view assumes it's always inside the main split view element, not a sidebar. |
| - var view = this; |
| - while (view) { |
| - if ((view instanceof WebInspector.SplitView) && view.sidebarSide()) |
| - insets[view.sidebarSide()] += view.preferredSidebarSize(); |
| - view = view.parentView(); |
| - } |
| + width: WebInspector.InspectedPagePlaceholder.Constraints.Width - (this._margins.left ? marginValue : 0) - (this._margins.right ? marginValue : 0), |
| + height: WebInspector.InspectedPagePlaceholder.Constraints.Height - (this._margins.top ? marginValue : 0) - (this._margins.bottom ? marginValue : 0)}; |
| InspectorFrontendHost.setContentsResizingStrategy(insets, minSize); |
| }, |