mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Expose text selection foreground / background colors to chrome code
Differential Revision: https://phabricator.services.mozilla.com/D117417
This commit is contained in:
parent
2bf074e434
commit
ed806afe52
1 changed files with 13 additions and 7 deletions
|
@ -196,13 +196,13 @@ pub enum SystemColor {
|
|||
TextBackground,
|
||||
#[css(skip)]
|
||||
TextForeground,
|
||||
#[css(skip)]
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
TextSelectBackground,
|
||||
#[css(skip)]
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
TextSelectForeground,
|
||||
#[css(skip)]
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
TextSelectBackgroundDisabled,
|
||||
#[css(skip)]
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
TextSelectBackgroundAttention,
|
||||
#[css(skip)]
|
||||
TextHighlightBackground,
|
||||
|
@ -417,9 +417,15 @@ impl SystemColor {
|
|||
SystemColor::Activetext => prefs.mActiveLinkColor,
|
||||
SystemColor::Visitedtext => prefs.mVisitedLinkColor,
|
||||
|
||||
_ => unsafe {
|
||||
bindings::Gecko_GetLookAndFeelSystemColor(*self as i32, cx.device().document(), scheme)
|
||||
},
|
||||
_ => {
|
||||
let color = unsafe {
|
||||
bindings::Gecko_GetLookAndFeelSystemColor(*self as i32, cx.device().document(), scheme)
|
||||
};
|
||||
if color == bindings::NS_SAME_AS_FOREGROUND_COLOR {
|
||||
return ComputedColor::currentcolor();
|
||||
}
|
||||
color
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue