mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
style: Simplify parsing and storage of SVG paint server fallback. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D36806
This commit is contained in:
parent
f0b5d02901
commit
83da7c1535
5 changed files with 71 additions and 99 deletions
|
@ -20,22 +20,13 @@ pub type SVGPaint = generic::SVGPaint<Color, ComputedUrl>;
|
|||
/// Computed SVG Paint Kind value
|
||||
pub type SVGPaintKind = generic::SVGPaintKind<Color, ComputedUrl>;
|
||||
|
||||
impl Default for SVGPaint {
|
||||
fn default() -> Self {
|
||||
SVGPaint {
|
||||
kind: generic::SVGPaintKind::None,
|
||||
fallback: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SVGPaint {
|
||||
/// Opaque black color
|
||||
pub fn black() -> Self {
|
||||
let rgba = RGBA::from_floats(0., 0., 0., 1.).into();
|
||||
SVGPaint {
|
||||
kind: generic::SVGPaintKind::Color(rgba),
|
||||
fallback: None,
|
||||
fallback: generic::SVGPaintFallback::Unset,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue