Bug 1577740 - Set custom disabled text color for urlbar and searchbar results since native graytext is too faint on Mac. r=harry

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2019-09-25 13:03:33 +00:00
parent 561f9c7ff6
commit b048f83074
4 changed files with 30 additions and 18 deletions

View File

@ -270,6 +270,11 @@ notification[value="translation"] menulist > .menulist-dropmarker {
/* AutoComplete */
%include ../shared/autocomplete.inc.css
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid ThreeDShadow;
}
%include ../shared/urlbar-autocomplete.inc.css
:root {
@ -277,10 +282,6 @@ notification[value="translation"] menulist > .menulist-dropmarker {
--urlbar-popup-action-color: -moz-nativehyperlinktext;
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid ThreeDShadow;
}
.urlbarView {
font-size: 1.05em;
}

View File

@ -282,6 +282,11 @@
/* ----- AUTOCOMPLETE ----- */
%include ../shared/autocomplete.inc.css
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid #C7C7C7;
}
%include ../shared/urlbar-autocomplete.inc.css
:root {
@ -289,8 +294,10 @@
--urlbar-popup-action-color: hsl(178, 100%, 28%);
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid #C7C7C7;
.urlbarView:not(:-moz-lwtheme),
#PopupSearchAutoComplete:not(:-moz-lwtheme) {
/* Set custom disabled text color since native graytext is too faint on macOS 10.14+. */
--panel-disabled-color: #737373;
}
.urlbarView {

View File

@ -572,12 +572,13 @@ menuitem.bookmark-item {
/* autocomplete */
%include ../shared/autocomplete.inc.css
%include ../shared/urlbar-autocomplete.inc.css
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid ThreeDShadow;
}
%include ../shared/urlbar-autocomplete.inc.css
@media (-moz-windows-default-theme) {
:root {
--urlbar-popup-url-color: hsl(210, 77%, 47%);

View File

@ -253,16 +253,19 @@ add_task(async function test_popup_url() {
"darktext should not be set!"
);
// Calculate what GrayText should be. May differ between platforms.
let span = document.createXULElement("span");
span.style.color = "GrayText";
document.documentElement.appendChild(span);
let GRAY_TEXT = window.getComputedStyle(span).color;
span.remove();
// Calculate what GrayText should be. Differs between platforms.
// We don't use graytext for urlbar results on Mac as it's too faint.
if (AppConstants.platform != "macosx") {
let span = document.createXULElement("span");
span.style.color = "GrayText";
document.documentElement.appendChild(span);
let GRAY_TEXT = window.getComputedStyle(span).color;
span.remove();
Assert.equal(
window.getComputedStyle(urlResult.element.separator, ":before").color,
GRAY_TEXT,
`Urlbar popup separator color should be set to ${GRAY_TEXT}`
);
Assert.equal(
window.getComputedStyle(urlResult.element.separator, ":before").color,
GRAY_TEXT,
`Urlbar popup separator color should be set to ${GRAY_TEXT}`
);
}
});