mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1791455 - Honor currentColor in HCM. r=morgan
I think it's fair to honor it, just like we honor system color keywords. By definition if we're forcing colors currentColor can only be forced or a system color. Differential Revision: https://phabricator.services.mozilla.com/D157675
This commit is contained in:
parent
00e15b9118
commit
66d4c80ac5
9
layout/reftests/high-contrast/currentColor-ref.html
Normal file
9
layout/reftests/high-contrast/currentColor-ref.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<style>
|
||||
div {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px solid SelectedItem;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
10
layout/reftests/high-contrast/currentColor.html
Normal file
10
layout/reftests/high-contrast/currentColor.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!doctype html>
|
||||
<style>
|
||||
div {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px solid currentColor;
|
||||
color: SelectedItem;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
@ -93,6 +93,7 @@ pref(browser.display.use_system_colors,true) pref(browser.display.document_color
|
||||
|
||||
!= border-color-transparent.html about:blank
|
||||
== border-color-transparent.html border-color-transparent-ref.html
|
||||
== currentColor.html currentColor-ref.html
|
||||
|
||||
pref(layout.css.color-mix.enabled,true) != color-mix.html color-mix-notref.html
|
||||
|
||||
|
@ -514,8 +514,8 @@ impl Color {
|
||||
/// Returns whether this color is allowed in forced-colors mode.
|
||||
pub fn honored_in_forced_colors_mode(&self, allow_transparent: bool) -> bool {
|
||||
match *self {
|
||||
Color::InheritFromBodyQuirk | Color::CurrentColor => false,
|
||||
Color::System(..) => true,
|
||||
Color::InheritFromBodyQuirk => false,
|
||||
Color::CurrentColor | Color::System(..) => true,
|
||||
Color::Numeric { ref parsed, .. } => allow_transparent && parsed.alpha == 0,
|
||||
Color::ColorMix(ref mix) => {
|
||||
mix.left.honored_in_forced_colors_mode(allow_transparent) &&
|
||||
|
Loading…
Reference in New Issue
Block a user