mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #17906 - emilio:calc-bgsize, r=hiro,birtles
style: Don't unconditionally generate Calc values when converting background-size from Gecko. Bug: 1385140 MozReview-Commit-ID: ERwq50WSvLV <!-- 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/17906) <!-- Reviewable:end -->
This commit is contained in:
commit
6b320eaad3
2 changed files with 11 additions and 1 deletions
|
@ -102,6 +102,16 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<nsStyleCoord_CalcValue> for LengthOrPercentageOrAuto {
|
||||||
|
fn from(other: nsStyleCoord_CalcValue) -> LengthOrPercentageOrAuto {
|
||||||
|
match (other.mHasPercent, other.mLength) {
|
||||||
|
(false, _) => LengthOrPercentageOrAuto::Length(Au(other.mLength)),
|
||||||
|
(true, 0) => LengthOrPercentageOrAuto::Percentage(Percentage(other.mPercent)),
|
||||||
|
_ => LengthOrPercentageOrAuto::Calc(other.into()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<Angle> for CoordDataValue {
|
impl From<Angle> for CoordDataValue {
|
||||||
fn from(reference: Angle) -> Self {
|
fn from(reference: Angle) -> Self {
|
||||||
match reference {
|
match reference {
|
||||||
|
|
|
@ -3446,7 +3446,7 @@ fn static_assert() {
|
||||||
LengthOrPercentageOrAuto::Auto
|
LengthOrPercentageOrAuto::Auto
|
||||||
} else {
|
} else {
|
||||||
debug_assert!(ty == DimensionType::eLengthPercentage as u8);
|
debug_assert!(ty == DimensionType::eLengthPercentage as u8);
|
||||||
LengthOrPercentageOrAuto::Calc(value.into())
|
value.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue