Bug 1692301 - Add dark mode support for about:buildconfig r=mconley,glandium

Also make it so it'd match the style of other about: pages.

Differential Revision: https://phabricator.services.mozilla.com/D104877
This commit is contained in:
Itiel 2021-02-18 22:05:09 +00:00
parent 1fc32fef7f
commit 05d88b715b
4 changed files with 98 additions and 80 deletions

View File

@ -98,8 +98,10 @@ class TestUnifiedBuildFinder(TestUnified):
[
"<html>",
" <body>",
" <div>",
" <h1>Build Configuration</h1>",
" <div>foo</div>",
" </div>",
" </body>",
"</html>",
]
@ -112,8 +114,10 @@ class TestUnifiedBuildFinder(TestUnified):
[
"<html>",
" <body>",
" <div>",
" <h1>Build Configuration</h1>",
" <div>bar</div>",
" </div>",
" </body>",
"</html>",
]
@ -133,10 +137,12 @@ class TestUnifiedBuildFinder(TestUnified):
[
"<html>",
" <body>",
" <div>",
" <h1>Build Configuration</h1>",
" <div>foo</div>",
" <hr> </hr>",
" <div>bar</div>",
" </div>",
" </body>",
"</html>",
]

View File

@ -220,14 +220,16 @@ class UnifiedBuildFinder(UnifiedFinder):
if file1 and file2 and basename == "buildconfig.html":
content1 = file1.open().readlines()
content2 = file2.open().readlines()
# Copy everything from the first file up to the end of its <body>,
# Copy everything from the first file up to the end of its <div>,
# insert a <hr> between the two files and copy the second file's
# content beginning after its leading <h1>.
return GeneratedFile(
b"".join(
content1[: content1.index(b"</body>\n")]
content1[: content1.index(b" </div>\n")]
+ [b" <hr> </hr>\n"]
+ content2[content2.index(b"<h1>Build Configuration</h1>\n") + 1 :]
+ content2[
content2.index(b" <h1>Build Configuration</h1>\n") + 1 :
]
)
)
elif file1 and file2 and basename == "install.rdf":

View File

@ -2,6 +2,14 @@
* 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/. */
th { text-align: start; }
h2 { margin-top: 1.5em; }
th, td { vertical-align: top; }
h2 {
margin-top: 1.5em;
}
p {
font: message-box;
}
.build-platform-table {
width: auto;
}

View File

@ -11,17 +11,18 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width; user-scalable=false;">
<title>Build Configuration</title>
<link rel="stylesheet" href="chrome://global/skin/about.css" type="text/css">
<link rel="stylesheet" href="chrome://global/skin/in-content/info-pages.css" type="text/css">
<link rel="stylesheet" href="chrome://global/content/buildconfig.css" type="text/css">
</head>
<body class="aboutPageWideContainer">
<body>
<div class="container">
<h1>Build Configuration</h1>
#ifdef MOZ_SOURCE_URL
<h2>Source</h2>
<p>Built from <a href="@MOZ_SOURCE_URL@">@MOZ_SOURCE_URL@</a></p>
#endif
<h2>Build platform</h2>
<table>
<table class="build-platform-table">
<tbody>
<tr>
<th>target</th>
@ -64,5 +65,6 @@
<h2>Package name</h2>
<p>@ANDROID_PACKAGE_NAME@</p>
#endif
</div>
</body>
</html>