mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
style: Refactor preference stylesheet prefs to not require a pres context.
We really only have two sets of prefs, one for chrome-like documents (stuff in chrome docshells + chrome-origin images), and one for the rest. Differential Revision: https://phabricator.services.mozilla.com/D20946
This commit is contained in:
parent
33814a9afe
commit
4e3e4c106a
4 changed files with 20 additions and 15 deletions
|
@ -351,13 +351,13 @@ impl Color {
|
|||
Color::Special(special) => {
|
||||
use self::gecko::SpecialColorKeyword as Keyword;
|
||||
_context.map(|context| {
|
||||
let pres_context = context.device().pres_context();
|
||||
let prefs = context.device().pref_sheet_prefs();
|
||||
convert_nscolor_to_computedcolor(match special {
|
||||
Keyword::MozDefaultColor => pres_context.mDefaultColor,
|
||||
Keyword::MozDefaultBackgroundColor => pres_context.mBackgroundColor,
|
||||
Keyword::MozHyperlinktext => pres_context.mLinkColor,
|
||||
Keyword::MozActivehyperlinktext => pres_context.mActiveLinkColor,
|
||||
Keyword::MozVisitedhyperlinktext => pres_context.mVisitedLinkColor,
|
||||
Keyword::MozDefaultColor => prefs.mDefaultColor,
|
||||
Keyword::MozDefaultBackgroundColor => prefs.mDefaultBackgroundColor,
|
||||
Keyword::MozHyperlinktext => prefs.mLinkColor,
|
||||
Keyword::MozActivehyperlinktext => prefs.mActiveLinkColor,
|
||||
Keyword::MozVisitedhyperlinktext => prefs.mVisitedLinkColor,
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue