mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Cleanup position and make use of generic Position for its users
This commit is contained in:
parent
3f53fb148d
commit
61a17993eb
10 changed files with 277 additions and 677 deletions
|
@ -338,13 +338,11 @@ fn serialize_basicshape_position<W>(position: &Position, dest: &mut W) -> fmt::R
|
|||
replace_with_percent(y).to_css(dest)
|
||||
}
|
||||
|
||||
match (position.horizontal.keyword, position.horizontal.position.clone(),
|
||||
position.vertical.keyword, position.vertical.position.clone()) {
|
||||
match (position.horizontal.0.keyword, position.horizontal.0.position.clone(),
|
||||
position.vertical.0.keyword, position.vertical.0.position.clone()) {
|
||||
(Some(hk), None, Some(vk), None) => {
|
||||
// two keywords: serialize as two lengths
|
||||
serialize_position_pair(hk.to_length_or_percentage(),
|
||||
vk.to_length_or_percentage(),
|
||||
dest)
|
||||
serialize_position_pair(hk.into(), vk.into(), dest)
|
||||
}
|
||||
(None, Some(hp), None, Some(vp)) => {
|
||||
// two lengths: just serialize regularly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue