Files
tubestation/devtools/client/framework/toolbox-window.xhtml
Emilio Cobos Álvarez f125fdcce4 Bug 1609446 - Make default window-constraints always show the content. r=mats,mstange
This code is used to determine the sizes of the top-level windows. However the
code doesn't cause quite desirable behavior (see the bug, and comment 15).

This patch does two things:

 * Unifies the html / xul code-paths. This shouldn't change behavior (because
   GetXULMinSize returns the fixed min-* property if present anyways), but
   makes the patch a bit simpler.

 * Makes the min-width of the XUL window be the pref size instead of the
   min-size (for the cases where you have no explicit min-width). This looks a
   bit counter intuitive, but it's the only way to guarantee that the content
   will be shown. This matches the sizing algorithm that dialogs use by default
   (via calling window.sizeToContent()), while allowing to undersize the window
   via a fixed min-width property.

This in turn makes sizeToContent() work "by default" on XUL windows, avoiding
having to make JS listen to everything that possibly could change the layout of
the document (like resolution changes).

Differential Revision: https://phabricator.services.mozilla.com/D70209
2020-04-15 01:44:25 +00:00

24 lines
951 B
HTML

<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!--
min-width: min-content makes us have the min size of our
browser element, which is set explicitly via css in
toolbox-host-manager.js. It could be set on the window
instead and then it wouldn't be needed.
-->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="devtools-toolbox-window"
macanimationtype="document"
fullscreenbutton="true"
windowtype="devtools:toolbox"
width="900" height="320"
style="min-width: min-content"
persist="screenX screenY width height sizemode">
<tooltip id="aHTMLTooltip" page="true"/>
</window>