summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-15 21:14:18 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-15 21:14:18 +0200
commite968422d299e49d1906e6f4c7746cfd9a677e72b (patch)
tree53539b4056d934c3886fc77f1b728d78482d199c /layout
parent9c075dc4cdaeef79bc570ed2219bb757cb325c47 (diff)
downloadUXP-e968422d299e49d1906e6f4c7746cfd9a677e72b.tar
UXP-e968422d299e49d1906e6f4c7746cfd9a677e72b.tar.gz
UXP-e968422d299e49d1906e6f4c7746cfd9a677e72b.tar.lz
UXP-e968422d299e49d1906e6f4c7746cfd9a677e72b.tar.xz
UXP-e968422d299e49d1906e6f4c7746cfd9a677e72b.zip
Bug 1379762 part 1. Don't call MediaFeaturesChanged if our override device pixel ratio is set to its current value
Issue #357
Diffstat (limited to 'layout')
-rw-r--r--layout/base/nsPresContext.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
index 4a54a8432..3106ff386 100644
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1307,10 +1307,15 @@ nsPresContext::SetFullZoom(float aZoom)
void
nsPresContext::SetOverrideDPPX(float aDPPX)
{
- mOverrideDPPX = aDPPX;
-
- if (HasCachedStyleData()) {
- MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
+ // 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));
+ }
}
}