mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Use ToResolvedValue for computed style serialization.
Differential Revision: https://phabricator.services.mozilla.com/D26784
This commit is contained in:
parent
a47dcb5707
commit
5fd4e17020
1 changed files with 8 additions and 8 deletions
|
@ -39,7 +39,7 @@ use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
|||
use to_shmem::impl_trivial_to_shmem;
|
||||
use crate::stylesheets::{CssRuleType, Origin, UrlExtraData};
|
||||
use crate::values::generics::text::LineHeight;
|
||||
use crate::values::computed;
|
||||
use crate::values::{computed, resolved};
|
||||
use crate::values::computed::NonNegativeLength;
|
||||
use crate::values::serialize_atom_name;
|
||||
use crate::rule_tree::StrongRuleNode;
|
||||
|
@ -2812,19 +2812,19 @@ impl ComputedValues {
|
|||
where
|
||||
W: Write,
|
||||
{
|
||||
use crate::values::resolved::ToResolvedValue;
|
||||
|
||||
let context = resolved::Context {
|
||||
style: self,
|
||||
};
|
||||
|
||||
// TODO(emilio): Is it worth to merge branches here just like
|
||||
// PropertyDeclaration::to_css does?
|
||||
//
|
||||
// We'd need to get a concept of ~resolved value, which may not be worth
|
||||
// it.
|
||||
match property_id {
|
||||
% for prop in data.longhands:
|
||||
LonghandId::${prop.camel_case} => {
|
||||
let value = self.clone_${prop.ident}();
|
||||
% if prop.predefined_type == "Color":
|
||||
let value = self.resolve_color(value);
|
||||
% endif
|
||||
value.to_css(dest)
|
||||
value.to_resolved_value(&context).to_css(dest)
|
||||
}
|
||||
% endfor
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue