Bug 1379762 part 1. Don't call MediaFeaturesChanged if our override device pixel ratio is set to its current value

Issue #357
This commit is contained in:
janekptacijarabaci 2018-05-15 21:14:18 +02:00 committed by Roy Tam
commit eb80674e82
4 changed files with 44 additions and 5 deletions

View file

@ -1307,10 +1307,15 @@ nsPresContext::SetFullZoom(float aZoom)
void
nsPresContext::SetOverrideDPPX(float aDPPX)
{
mOverrideDPPX = aDPPX;
// SetOverrideDPPX is called during navigations, including history
// traversals. In that case, it's typically called with our current value,
// and we don't need to actually do anything.
if (aDPPX != mOverrideDPPX) {
mOverrideDPPX = aDPPX;
if (HasCachedStyleData()) {
MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
if (HasCachedStyleData()) {
MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
}
}
}