mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: Avoid useless allocations in custom property name serialization.
And make transition-property more correct by serializing --0 unescaped instead of escaped. Bug: 1466645 Reviewed-by: xidorn MozReview-Commit-ID: CCBSe5Frd0d
This commit is contained in:
parent
63ca2a803d
commit
c6e43c0329
3 changed files with 32 additions and 7 deletions
|
@ -49,6 +49,7 @@ use stylesheets::{CssRuleType, Origin, UrlExtraData};
|
|||
use values::generics::text::LineHeight;
|
||||
use values::computed;
|
||||
use values::computed::NonNegativeLength;
|
||||
use values::serialize_atom_name;
|
||||
use rule_tree::{CascadeLevel, StrongRuleNode};
|
||||
use self::computed_value_flags::*;
|
||||
use str::{CssString, CssStringBorrow, CssStringWriter};
|
||||
|
@ -1506,8 +1507,9 @@ impl<'a> ToCss for PropertyDeclarationId<'a> {
|
|||
{
|
||||
match *self {
|
||||
PropertyDeclarationId::Longhand(id) => dest.write_str(id.name()),
|
||||
PropertyDeclarationId::Custom(_) => {
|
||||
serialize_identifier(&self.name(), dest)
|
||||
PropertyDeclarationId::Custom(ref name) => {
|
||||
dest.write_str("--")?;
|
||||
serialize_atom_name(name, dest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1587,8 +1589,9 @@ impl ToCss for PropertyId {
|
|||
PropertyId::Shorthand(id) => dest.write_str(id.name()),
|
||||
PropertyId::LonghandAlias(id, _) => dest.write_str(id.name()),
|
||||
PropertyId::ShorthandAlias(id, _) => dest.write_str(id.name()),
|
||||
PropertyId::Custom(_) => {
|
||||
serialize_identifier(&self.name(), dest)
|
||||
PropertyId::Custom(ref name) => {
|
||||
dest.write_str("--")?;
|
||||
serialize_atom_name(name, dest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue