зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1537955 - Do not spoof DevicePixelRatio for pdfs r=Ehsan
pdfs should not have a way to exfiltrate the true device pixel ratio, so it is safe to provide the correct value, enabling them to be rendered correctly. Differential Revision: https://phabricator.services.mozilla.com/D39994 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e7f4ed385b
Коммит
41227282b4
|
@ -3736,7 +3736,18 @@ double nsGlobalWindowOuter::GetDevicePixelRatioOuter(CallerType aCallerType) {
|
|||
}
|
||||
|
||||
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
|
||||
return 1.0;
|
||||
// Spoofing the DevicePixelRatio causes blurriness in some situations
|
||||
// on HiDPI displays. pdf.js is a non-system caller; but it can't
|
||||
// expose the fingerprintable information, so we can safely disable
|
||||
// spoofing in this situation. It doesn't address the issue for
|
||||
// web-rendered content (including pdf.js instances on the web.)
|
||||
// In the future we hope to have a better solution to fix all HiDPI
|
||||
// blurriness...
|
||||
nsAutoCString origin;
|
||||
nsresult rv = this->GetPrincipal()->GetOrigin(origin);
|
||||
if (NS_FAILED(rv) || origin != NS_LITERAL_CSTRING("resource://pdf.js")) {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
float overrideDPPX = presContext->GetOverrideDPPX();
|
||||
|
|
Загрузка…
Ссылка в новой задаче