mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Removing unnecessary field from serialization css enum
This commit is contained in:
parent
3dafd558c5
commit
f6bbeae67f
1 changed files with 5 additions and 8 deletions
|
@ -404,7 +404,7 @@ enum AppendableValue<'a, I>
|
||||||
where I: Iterator<Item=&'a PropertyDeclaration> {
|
where I: Iterator<Item=&'a PropertyDeclaration> {
|
||||||
Declaration(&'a PropertyDeclaration),
|
Declaration(&'a PropertyDeclaration),
|
||||||
DeclarationsForShorthand(I),
|
DeclarationsForShorthand(I),
|
||||||
Css(&'a str, bool)
|
Css(&'a str)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn append_property_name<W>(dest: &mut W,
|
fn append_property_name<W>(dest: &mut W,
|
||||||
|
@ -430,7 +430,7 @@ fn append_declaration_value<'a, W, I>
|
||||||
-> fmt::Result
|
-> fmt::Result
|
||||||
where W: fmt::Write, I: Iterator<Item=&'a PropertyDeclaration> {
|
where W: fmt::Write, I: Iterator<Item=&'a PropertyDeclaration> {
|
||||||
match appendable_value {
|
match appendable_value {
|
||||||
AppendableValue::Css(css, _) => {
|
AppendableValue::Css(css) => {
|
||||||
try!(write!(dest, "{}", css))
|
try!(write!(dest, "{}", css))
|
||||||
},
|
},
|
||||||
AppendableValue::Declaration(decl) => {
|
AppendableValue::Declaration(decl) => {
|
||||||
|
@ -468,10 +468,8 @@ fn append_serialization<'a, W, I>(dest: &mut W,
|
||||||
|
|
||||||
// for normal parsed values, add a space between key: and value
|
// for normal parsed values, add a space between key: and value
|
||||||
match &appendable_value {
|
match &appendable_value {
|
||||||
&AppendableValue::Css(_, is_unparsed) => {
|
&AppendableValue::Css(_) => {
|
||||||
if !is_unparsed {
|
try!(write!(dest, " "))
|
||||||
try!(write!(dest, " "))
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
&AppendableValue::Declaration(decl) => {
|
&AppendableValue::Declaration(decl) => {
|
||||||
if !decl.value_is_unparsed() {
|
if !decl.value_is_unparsed() {
|
||||||
|
@ -705,8 +703,7 @@ impl Shorthand {
|
||||||
// https://drafts.csswg.org/css-variables/#variables-in-shorthands
|
// https://drafts.csswg.org/css-variables/#variables-in-shorthands
|
||||||
if let Some(css) = first_declaration.with_variables_from_shorthand(self) {
|
if let Some(css) = first_declaration.with_variables_from_shorthand(self) {
|
||||||
if declarations2.all(|d| d.with_variables_from_shorthand(self) == Some(css)) {
|
if declarations2.all(|d| d.with_variables_from_shorthand(self) == Some(css)) {
|
||||||
let is_unparsed = first_declaration.value_is_unparsed();
|
return Some(AppendableValue::Css(css));
|
||||||
return Some(AppendableValue::Css(css, is_unparsed));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return None;
|
return None;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue