mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Fix ToResolvedValue implementation for caret-color, and serialize some color properties with Servo.
Differential Revision: https://phabricator.services.mozilla.com/D26785
This commit is contained in:
parent
5fd4e17020
commit
0f57b7b833
3 changed files with 48 additions and 20 deletions
|
@ -8,6 +8,9 @@
|
|||
use cssparser;
|
||||
use smallvec::SmallVec;
|
||||
use crate::properties::ComputedValues;
|
||||
|
||||
mod color;
|
||||
|
||||
use crate::values::computed;
|
||||
|
||||
/// Information needed to resolve a given value.
|
||||
|
@ -187,22 +190,3 @@ where
|
|||
Vec::from_resolved_value(Vec::from(resolved)).into_boxed_slice()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A resolved color value is an rgba color, with currentcolor resolved.
|
||||
pub type Color = cssparser::RGBA;
|
||||
|
||||
impl ToResolvedValue for computed::Color {
|
||||
type ResolvedValue = Color;
|
||||
|
||||
#[inline]
|
||||
fn to_resolved_value(self, context: &Context) -> Self::ResolvedValue {
|
||||
context.style.resolve_color(self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_resolved_value(resolved: Self::ResolvedValue) -> Self {
|
||||
use crate::values::generics::color::Color as GenericColor;
|
||||
GenericColor::Numeric(resolved)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue