mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #15951 - upsuper:image-layer-serialization, r=canaltinova
Skip some parts of image-layer shorthands when they are initial To make it closer to Gecko's serialization algorithm. Neither Servo nor Gecko currently perfectly matches the spec. Gecko has some test for this, but I don't think that's sufficient, so I'll add some later if there aren't any in Servo. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15951) <!-- Reviewable:end -->
This commit is contained in:
commit
17da52bf2b
2 changed files with 22 additions and 35 deletions
|
@ -158,31 +158,25 @@
|
||||||
try!(write!(dest, " "));
|
try!(write!(dest, " "));
|
||||||
}
|
}
|
||||||
|
|
||||||
% for name in "image repeat attachment position_x position_y".split():
|
try!(image.to_css(dest));
|
||||||
try!(${name}.to_css(dest));
|
% for name in "repeat attachment position_x position_y".split():
|
||||||
try!(write!(dest, " "));
|
try!(write!(dest, " "));
|
||||||
|
try!(${name}.to_css(dest));
|
||||||
% endfor
|
% endfor
|
||||||
|
|
||||||
try!(write!(dest, "/ "));
|
if *size != background_size::single_value::get_initial_specified_value() {
|
||||||
try!(size.to_css(dest));
|
try!(write!(dest, " / "));
|
||||||
try!(write!(dest, " "));
|
try!(size.to_css(dest));
|
||||||
|
}
|
||||||
|
|
||||||
match (origin, clip) {
|
if *origin != Origin::padding_box || *clip != Clip::border_box {
|
||||||
(&Origin::padding_box, &Clip::padding_box) => {
|
try!(write!(dest, " "));
|
||||||
try!(origin.to_css(dest));
|
try!(origin.to_css(dest));
|
||||||
},
|
if *clip != From::from(*origin) {
|
||||||
(&Origin::border_box, &Clip::border_box) => {
|
|
||||||
try!(origin.to_css(dest));
|
|
||||||
},
|
|
||||||
(&Origin::content_box, &Clip::content_box) => {
|
|
||||||
try!(origin.to_css(dest));
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
try!(origin.to_css(dest));
|
|
||||||
try!(write!(dest, " "));
|
try!(write!(dest, " "));
|
||||||
try!(clip.to_css(dest));
|
try!(clip.to_css(dest));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -151,26 +151,19 @@
|
||||||
position_x.to_css(dest)?;
|
position_x.to_css(dest)?;
|
||||||
dest.write_str(" ")?;
|
dest.write_str(" ")?;
|
||||||
position_y.to_css(dest)?;
|
position_y.to_css(dest)?;
|
||||||
dest.write_str(" / ")?;
|
if *size != mask_size::single_value::get_initial_specified_value() {
|
||||||
size.to_css(dest)?;
|
dest.write_str(" / ")?;
|
||||||
|
size.to_css(dest)?;
|
||||||
|
}
|
||||||
dest.write_str(" ")?;
|
dest.write_str(" ")?;
|
||||||
repeat.to_css(dest)?;
|
repeat.to_css(dest)?;
|
||||||
dest.write_str(" ")?;
|
|
||||||
|
|
||||||
match (origin, clip) {
|
if *origin != Origin::border_box || *clip != Clip::border_box {
|
||||||
(&Origin::padding_box, &Clip::padding_box) => {
|
dest.write_str(" ")?;
|
||||||
try!(origin.to_css(dest));
|
origin.to_css(dest)?;
|
||||||
},
|
if *clip != From::from(*origin) {
|
||||||
(&Origin::border_box, &Clip::border_box) => {
|
dest.write_str(" ")?;
|
||||||
try!(origin.to_css(dest));
|
clip.to_css(dest)?;
|
||||||
},
|
|
||||||
(&Origin::content_box, &Clip::content_box) => {
|
|
||||||
try!(origin.to_css(dest));
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
try!(origin.to_css(dest));
|
|
||||||
try!(write!(dest, " "));
|
|
||||||
try!(clip.to_css(dest));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue