mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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,
|
TextBackground,
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
TextForeground,
|
TextForeground,
|
||||||
#[css(skip)]
|
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||||
TextSelectBackground,
|
TextSelectBackground,
|
||||||
#[css(skip)]
|
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||||
TextSelectForeground,
|
TextSelectForeground,
|
||||||
#[css(skip)]
|
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||||
TextSelectBackgroundDisabled,
|
TextSelectBackgroundDisabled,
|
||||||
#[css(skip)]
|
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||||
TextSelectBackgroundAttention,
|
TextSelectBackgroundAttention,
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
TextHighlightBackground,
|
TextHighlightBackground,
|
||||||
|
@ -417,9 +417,15 @@ impl SystemColor {
|
||||||
SystemColor::Activetext => prefs.mActiveLinkColor,
|
SystemColor::Activetext => prefs.mActiveLinkColor,
|
||||||
SystemColor::Visitedtext => prefs.mVisitedLinkColor,
|
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