Bug 1608246 - Fixes for small subdialogs in preferences r=bgrins

Bug 1588142 introduced two problems: First, it added CSS to prefrences.css that was meant to apply only to preferences.xhtml, but in fact ends up applying to other pages. This patch fixes that.

The second problem was an assumption made in subdialogs.js that all preferences subdialogs would have either a contentPane or a <dialog> element, which we should set to be scrollable if the window is too small. It turns out that there is at least one dialog that has overflow-y set to auto, thus handling it's own scrolling. The relevant code has been updated not to make that assumption.

Differential Revision: https://phabricator.services.mozilla.com/D60057

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kirk Steuber 2020-01-15 22:18:09 +00:00
Родитель b817712cfb
Коммит e52b55a2a6
3 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -20,7 +20,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
role="document">
role="document"
id="preferences-root">
<head>
<!-- @CSP: The 'oncommand' handler for 'focusSearch1' can not easily be rewritten (see Bug 371900)

Просмотреть файл

@ -431,7 +431,13 @@ SubDialog.prototype = {
let contentPane =
this._frame.contentDocument.querySelector(".contentPane") ||
this._frame.contentDocument.querySelector("dialog");
contentPane.classList.add("doScroll");
if (contentPane) {
// There are also instances where the subdialog is neither implemented
// using a content pane, nor a <dialog> (such as manageAddresses.xhtml)
// so make sure to check that we actually got a contentPane before we
// use it.
contentPane.classList.add("doScroll");
}
}
this._frame.style.height = frameHeight;

Просмотреть файл

@ -7,7 +7,6 @@
:root {
--in-content-warning-container: var(--grey-20);
text-rendering: optimizeLegibility;
}
@supports -moz-bool-pref("browser.in-content.dark-mode") {
@ -18,8 +17,12 @@
}
}
:root,
body {
#preferences-root {
text-rendering: optimizeLegibility;
}
#preferences-root,
#preferences-body {
margin: 0;
padding: 0;
height: 100%;