Navigation Menu

Skip to content

Commit

Permalink
Bug 1331213: Implement the resolution override. r=heycam
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: LFGam2hDoh7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
  • Loading branch information
emilio committed Jan 17, 2017
1 parent 13878d6 commit 3b36f4c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/style/gecko/media_queries.rs
Expand Up @@ -535,11 +535,16 @@ impl Expression {
(one_num * other_den).partial_cmp(&(other_num * one_den)).unwrap()
}
(&Resolution(ref one), &Resolution(ref other)) => {
// FIXME(emilio): The pres context may override the DPPX of the
// `other` resolution, we need to look at that here, but I'm
// skipping that for now (we should check if bindgen can
// generate nsPresContext correctly now).
one.to_dpi().partial_cmp(&other.to_dpi()).unwrap()
let actual_dpi = unsafe {
if (*device.pres_context).mOverrideDPPX > 0.0 {
self::Resolution::Dppx((*device.pres_context).mOverrideDPPX)
.to_dpi()
} else {
other.to_dpi()
}
};

one.to_dpi().partial_cmp(&actual_dpi).unwrap()
}
(&Ident(ref one), &Ident(ref other)) => {
debug_assert!(self.feature.mRangeType != nsMediaFeature_RangeType::eMinMaxAllowed);
Expand Down

0 comments on commit 3b36f4c

Please sign in to comment.