mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make computed types hold Percentage instead of bare CSSFloat
This commit is contained in:
parent
4b633c8637
commit
608e7f71a2
22 changed files with 140 additions and 110 deletions
|
@ -322,7 +322,7 @@ impl CandidateBSizeIterator {
|
|||
|
||||
let block_size = match (fragment.style.content_block_size(), block_container_block_size) {
|
||||
(LengthOrPercentageOrAuto::Percentage(percent), Some(block_container_block_size)) => {
|
||||
MaybeAuto::Specified(block_container_block_size.scale_by(percent))
|
||||
MaybeAuto::Specified(block_container_block_size.scale_by(percent.0))
|
||||
}
|
||||
(LengthOrPercentageOrAuto::Calc(calc), _) => {
|
||||
MaybeAuto::from_option(calc.to_used_value(block_container_block_size))
|
||||
|
@ -333,7 +333,7 @@ impl CandidateBSizeIterator {
|
|||
};
|
||||
let max_block_size = match (fragment.style.max_block_size(), block_container_block_size) {
|
||||
(LengthOrPercentageOrNone::Percentage(percent), Some(block_container_block_size)) => {
|
||||
Some(block_container_block_size.scale_by(percent))
|
||||
Some(block_container_block_size.scale_by(percent.0))
|
||||
}
|
||||
(LengthOrPercentageOrNone::Calc(calc), _) => {
|
||||
calc.to_used_value(block_container_block_size)
|
||||
|
@ -344,7 +344,7 @@ impl CandidateBSizeIterator {
|
|||
};
|
||||
let min_block_size = match (fragment.style.min_block_size(), block_container_block_size) {
|
||||
(LengthOrPercentage::Percentage(percent), Some(block_container_block_size)) => {
|
||||
block_container_block_size.scale_by(percent)
|
||||
block_container_block_size.scale_by(percent.0)
|
||||
}
|
||||
(LengthOrPercentage::Calc(calc), _) => {
|
||||
calc.to_used_value(block_container_block_size).unwrap_or(Au(0))
|
||||
|
@ -1178,7 +1178,7 @@ impl BlockFlow {
|
|||
}
|
||||
(LengthOrPercentageOrAuto::Length(length), _) => Some(length),
|
||||
(LengthOrPercentageOrAuto::Percentage(percent), Some(container_size)) => {
|
||||
Some(container_size.scale_by(percent))
|
||||
Some(container_size.scale_by(percent.0))
|
||||
}
|
||||
(LengthOrPercentageOrAuto::Percentage(_), None) |
|
||||
(LengthOrPercentageOrAuto::Auto, None) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue