Bug 1500672 - Part 2: Make Navigator return MaxTouchPointsOverride when in RDM. r=bradwerth,smaug

Differential Revision: https://phabricator.services.mozilla.com/D70128

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Micah Tigley 2020-04-14 13:40:43 +00:00
parent dc7c4bf3db
commit bee37397b8

View File

@ -813,6 +813,15 @@ bool Navigator::Vibrate(const nsTArray<uint32_t>& aPattern) {
//*****************************************************************************
uint32_t Navigator::MaxTouchPoints(CallerType aCallerType) {
nsIDocShell* docshell = GetDocShell();
BrowsingContext* bc = docshell ? docshell->GetBrowsingContext() : nullptr;
// Responsive Design Mode overrides the maxTouchPoints property when
// touch simulation is enabled.
if (bc && bc->InRDMPane()) {
return bc->GetMaxTouchPointsOverride();
}
// The maxTouchPoints is going to reveal the detail of users' hardware. So,
// we will spoof it into 0 if fingerprinting resistance is on.
if (aCallerType != CallerType::System &&