Bug 1402930 - Use the PresContext's override dppx value if set; r=bradwerth
MozReview-Commit-ID: 9DWQdVevIaz
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -351,16 +351,21 @@ ResponsiveImageSelector::SelectImage(boo
nsPresContext *pctx = shell ? shell->GetPresContext() : nullptr;
nsCOMPtr<nsIURI> baseURI = mOwnerNode ? mOwnerNode->GetBaseURI() : nullptr;
if (!pctx || !doc || !baseURI) {
return oldBest != -1;
}
double displayDensity = pctx->CSSPixelsToDevPixels(1.0f);
+ double overrideDPPX = pctx->GetOverrideDPPX();
+
+ if (overrideDPPX > 0) {
+ displayDensity = overrideDPPX;
+ }
// Per spec, "In a UA-specific manner, choose one image source"
// - For now, select the lowest density greater than displayDensity, otherwise
// the greatest density available
// If the list contains computed width candidates, compute the current
// effective image width.
double computedWidth = -1;