| Index: Source/devtools/front_end/ui/RootView.js
|
| diff --git a/Source/devtools/front_end/ui/RootView.js b/Source/devtools/front_end/ui/RootView.js
|
| index 01fcb96293aa1da8cd2928de89a5374480acb2db..e4b5ef9bfb2ead634f523cbe3059910f063cf654 100644
|
| --- a/Source/devtools/front_end/ui/RootView.js
|
| +++ b/Source/devtools/front_end/ui/RootView.js
|
| @@ -5,7 +5,6 @@
|
| /**
|
| * @constructor
|
| * @extends {WebInspector.VBox}
|
| - * @suppressGlobalPropertiesCheck
|
| */
|
| WebInspector.RootView = function()
|
| {
|
| @@ -13,29 +12,30 @@ WebInspector.RootView = function()
|
| this.markAsRoot();
|
| this.element.classList.add("root-view");
|
| this.element.setAttribute("spellcheck", false);
|
| - // This view is not designed to change owner document.
|
| - window.addEventListener("resize", this.doResize.bind(this), false);
|
| }
|
|
|
| WebInspector.RootView.prototype = {
|
| /**
|
| - * @public // FIXME: this is a workaround for validator bug (http://crbug.com/425506).
|
| - * @suppressGlobalPropertiesCheck
|
| + * @param {!Document} document
|
| */
|
| - attachToBody: function()
|
| + attachToDocument: function(document)
|
| {
|
| + document.defaultView.addEventListener("resize", this.doResize.bind(this), false);
|
| + this._window = document.defaultView;
|
| this.doResize();
|
| this.show(document.body);
|
| },
|
|
|
| doResize: function()
|
| {
|
| - var size = this.constraints().minimum;
|
| - var zoom = WebInspector.zoomManager.zoomFactor();
|
| - var right = Math.min(0, window.innerWidth - size.width / zoom);
|
| - this.element.style.marginRight = right + "px";
|
| - var bottom = Math.min(0, window.innerHeight - size.height / zoom);
|
| - this.element.style.marginBottom = bottom + "px";
|
| + if (this._window) {
|
| + var size = this.constraints().minimum;
|
| + var zoom = WebInspector.zoomManager.zoomFactor();
|
| + var right = Math.min(0, this._window.innerWidth - size.width / zoom);
|
| + this.element.style.marginRight = right + "px";
|
| + var bottom = Math.min(0, this._window.innerHeight - size.height / zoom);
|
| + this.element.style.marginBottom = bottom + "px";
|
| + }
|
| WebInspector.VBox.prototype.doResize.call(this);
|
| },
|
|
|
|
|