mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Simplify serialisation of BorderCornerRadius when possible.
Closes #18458. Matches other browsers in test-cases like: <div id="t" style="border-top-left-radius: 5px 5px"></div> <script>alert(t.style.borderTopLeftRadius)</script> (I think it'd be nicer to preserve the original value completely, but not going to complain given we already do this for all sorts of Rect<T>s and such, and this is much easier).
This commit is contained in:
parent
6f97dd1c96
commit
4936314b7e
3 changed files with 13 additions and 8 deletions
|
@ -151,13 +151,18 @@ impl<L: Clone> From<L> for BorderCornerRadius<L> {
|
|||
}
|
||||
|
||||
impl<L> ToCss for BorderCornerRadius<L>
|
||||
where L: ToCss,
|
||||
where L: ToCss + PartialEq,
|
||||
{
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write
|
||||
{
|
||||
self.0.width.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.0.height.to_css(dest)
|
||||
|
||||
if self.0.height != self.0.width {
|
||||
dest.write_str(" ")?;
|
||||
self.0.height.to_css(dest)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue