Skip to content

Commit

Permalink
Change MediaExpressionValue::from_css_value to only accept one type o…
Browse files Browse the repository at this point in the history
…f unit (pixels).

MozReview-Commit-ID: Hn3twVa8xLo
  • Loading branch information
bradwerth committed Oct 5, 2017
1 parent f2879a5 commit 61b9b68
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions components/style/gecko/media_queries.rs
Expand Up @@ -373,18 +373,8 @@ impl MediaExpressionValue {
Some(MediaExpressionValue::BoolInteger(i == 1))
}
nsMediaFeature_ValueType::eResolution => {
// This is temporarily more complicated to allow Gecko Bug
// 1376931 to land. Parts of that bug will supply pixel values
// and expect them to be passed through without conversion.
// After all parts of that bug have landed, Bug 1404097 will
// return this function to once again only allow one type of
// value to be accepted: this time, only pixel values.
let res = match css_value.mUnit {
nsCSSUnit::eCSSUnit_Pixel => Resolution::Dppx(css_value.float_unchecked()),
nsCSSUnit::eCSSUnit_Inch => Resolution::Dpi(css_value.float_unchecked()),
_ => unreachable!(),
};
Some(MediaExpressionValue::Resolution(res))
debug_assert!(css_value.mUnit == nsCSSUnit::eCSSUnit_Pixel);
Some(MediaExpressionValue::Resolution(Resolution::Dppx(css_value.float_unchecked())))
}
nsMediaFeature_ValueType::eEnumerated => {
let value = css_value.integer_unchecked() as i16;
Expand Down

0 comments on commit 61b9b68

Please sign in to comment.