mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1717873 - Move link color styles to ua.css. r=morgan
We expose these via CSS system colors, so this way we don't need to rebuild the preference sheet when the link color is different. Differential Revision: https://phabricator.services.mozilla.com/D120677
This commit is contained in:
parent
6c225e7975
commit
38cb903038
@ -137,9 +137,9 @@ async function userAgentStylesVisible(inspector, view) {
|
||||
);
|
||||
ok(
|
||||
uaRules.some(rule => {
|
||||
return rule.matchedSelectors.includes("*|*:link");
|
||||
return rule.matchedSelectors.includes(":link");
|
||||
}),
|
||||
"There is a rule for *|*:link"
|
||||
"There is a rule for :link"
|
||||
);
|
||||
ok(
|
||||
uaRules.some(rule => {
|
||||
|
@ -589,17 +589,6 @@ void GlobalStyleSheetCache::BuildPreferenceSheet(
|
||||
"@namespace svg url(http://www.w3.org/2000/svg);\n");
|
||||
|
||||
// Rules for link styling.
|
||||
nscolor linkColor = aPrefs.mLinkColor;
|
||||
nscolor activeColor = aPrefs.mActiveLinkColor;
|
||||
nscolor visitedColor = aPrefs.mVisitedLinkColor;
|
||||
|
||||
sheetText.AppendPrintf(
|
||||
"*|*:link { color: #%02x%02x%02x; }\n"
|
||||
"*|*:any-link:active { color: #%02x%02x%02x; }\n"
|
||||
"*|*:visited { color: #%02x%02x%02x; }\n",
|
||||
NS_GET_R_G_B(linkColor), NS_GET_R_G_B(activeColor),
|
||||
NS_GET_R_G_B(visitedColor));
|
||||
|
||||
bool underlineLinks = aPrefs.mUnderlineLinks;
|
||||
sheetText.AppendPrintf("*|*:any-link%s { text-decoration: %s; }\n",
|
||||
underlineLinks ? ":not(svg|a)" : "",
|
||||
|
@ -150,6 +150,18 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:link {
|
||||
color: LinkText;
|
||||
}
|
||||
|
||||
:any-link:active {
|
||||
color: ActiveText;
|
||||
}
|
||||
|
||||
:visited {
|
||||
color: VisitedText;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
/* Don't specify the outline-color, we should always use initial value. */
|
||||
outline: 1px dotted;
|
||||
|
Loading…
Reference in New Issue
Block a user