mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #17092 - heycam:document-colors, r=xidorn
style: Add support for disabled document colors. Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1355716. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17092) <!-- Reviewable:end -->
This commit is contained in:
commit
43862ba045
15 changed files with 103 additions and 13 deletions
|
@ -177,6 +177,15 @@ impl CSSColor {
|
|||
authored: None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns false if the color is completely transparent, and
|
||||
/// true otherwise.
|
||||
pub fn is_non_transparent(&self) -> bool {
|
||||
match self.parsed {
|
||||
Color::RGBA(rgba) if rgba.alpha == 0 => false,
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
no_viewport_percentage!(CSSColor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue