mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: When resetting background color for high contrast, preserve alpha channel appropriately.
But discard it when backplating behind text, so that text is readable. This should be uncontroversial... Dealing with widgets is a bit harder so TBD. Differential Revision: https://phabricator.services.mozilla.com/D91779
This commit is contained in:
parent
1a5f48ba43
commit
379fb984f1
2 changed files with 40 additions and 15 deletions
|
@ -529,15 +529,6 @@ impl Color {
|
|||
parse_hash_color(&serialization)
|
||||
.map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
|
||||
}
|
||||
|
||||
/// Returns true if the color is completely transparent, and false
|
||||
/// otherwise.
|
||||
pub fn is_transparent(&self) -> bool {
|
||||
match *self {
|
||||
Color::Numeric { ref parsed, .. } => parsed.alpha == 0,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue