forked from mirrors/gecko-dev
Bug 1816503 - Remove RFP Window.{inner,outer}{Width,Height} setter checks. r=smaug
Given Tor browser prevents content from resizing windows[1], and how the
checks work, this would only come into effect when chrome code uses
these to resize a content window.
Chrome code doesn't use these to begin with (the right thing to do would
be resizeTo()). But even if it did it'd probably do it on the chrome
window.
So all in all this shouldn't change behavior for Tor browser, and the
math here is somewhat broken to begin with. Let's remove this because it
blocks making these properties really readonly (bug 1816472).
[1]: ba59316f96 (a11e9477e16f35c1147f46dbf93e1b2c5c8b79d1_0_265)
Differential Revision: https://phabricator.services.mozilla.com/D169719
This commit is contained in:
parent
21d7ca47f7
commit
c31f962179
8 changed files with 0 additions and 282 deletions
|
|
@ -53,28 +53,6 @@ https_first_disabled = true
|
|||
[browser_roundedWindow_open_max_inner.js]
|
||||
[browser_roundedWindow_open_mid_inner.js]
|
||||
[browser_roundedWindow_open_min_inner.js]
|
||||
[browser_roundedWindow_windowSetting_max_inner.js]
|
||||
skip-if =
|
||||
os == 'linux' && socketprocess_networking
|
||||
os == "linux" && fission && !swgl # high frequency intermittent
|
||||
[browser_roundedWindow_windowSetting_max_outer.js]
|
||||
skip-if =
|
||||
os == 'linux' && socketprocess_networking
|
||||
os == "linux" && fission && !swgl # high frequency intermittent
|
||||
[browser_roundedWindow_windowSetting_mid_inner.js]
|
||||
skip-if =
|
||||
os == 'linux' && socketprocess_networking
|
||||
os == "linux" && fission && !swgl # high frequency intermittent
|
||||
[browser_roundedWindow_windowSetting_mid_outer.js]
|
||||
skip-if = os == "linux" && bits == 64 && os_version == "18.04"
|
||||
[browser_roundedWindow_windowSetting_min_inner.js]
|
||||
skip-if =
|
||||
os == 'linux' && socketprocess_networking
|
||||
os == "linux" && fission && !swgl # high frequency intermittent
|
||||
[browser_roundedWindow_windowSetting_min_outer.js]
|
||||
skip-if =
|
||||
os == 'linux' && socketprocess_networking
|
||||
os == "linux" && fission && !swgl # high frequency intermittent
|
||||
[browser_spoofing_keyboard_event.js]
|
||||
skip-if = (debug || asan) && os == "linux" && bits == 64 #Bug 1518179
|
||||
[browser_timezone.js]
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for maximum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 1025,
|
||||
settingHeight: 1050,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 9999,
|
||||
settingHeight: 9999,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 999,
|
||||
settingHeight: 999,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
],
|
||||
false
|
||||
);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.outerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for maximum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 1025,
|
||||
settingHeight: 1050,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 9999,
|
||||
settingHeight: 9999,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 999,
|
||||
settingHeight: 999,
|
||||
targetWidth: 1000,
|
||||
targetHeight: 1000,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
],
|
||||
true
|
||||
);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for middle values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 600,
|
||||
settingHeight: 600,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 599,
|
||||
settingHeight: 599,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 401,
|
||||
settingHeight: 501,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
],
|
||||
false
|
||||
);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.outerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for middle values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 600,
|
||||
settingHeight: 600,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 599,
|
||||
settingHeight: 599,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
{
|
||||
settingWidth: 401,
|
||||
settingHeight: 501,
|
||||
targetWidth: 600,
|
||||
targetHeight: 600,
|
||||
initWidth: 200,
|
||||
initHeight: 100,
|
||||
},
|
||||
],
|
||||
true
|
||||
);
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for minimum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 199,
|
||||
settingHeight: 99,
|
||||
targetWidth: 200,
|
||||
targetHeight: 100,
|
||||
initWidth: 1000,
|
||||
initHeight: 1000,
|
||||
},
|
||||
{
|
||||
settingWidth: 10,
|
||||
settingHeight: 10,
|
||||
targetWidth: 200,
|
||||
targetHeight: 100,
|
||||
initWidth: 1000,
|
||||
initHeight: 1000,
|
||||
},
|
||||
],
|
||||
false
|
||||
);
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.outerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for minimum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run(
|
||||
[
|
||||
{
|
||||
settingWidth: 199,
|
||||
settingHeight: 99,
|
||||
targetWidth: 200,
|
||||
targetHeight: 100,
|
||||
initWidth: 1000,
|
||||
initHeight: 1000,
|
||||
},
|
||||
{
|
||||
settingWidth: 10,
|
||||
settingHeight: 10,
|
||||
targetWidth: 200,
|
||||
targetHeight: 100,
|
||||
initWidth: 1000,
|
||||
initHeight: 1000,
|
||||
},
|
||||
],
|
||||
true
|
||||
);
|
||||
|
|
@ -7608,78 +7608,6 @@ void nsGlobalWindowInner::SetReplaceableWindowCoord(
|
|||
return;
|
||||
}
|
||||
|
||||
if (ShouldResistFingerprinting()) {
|
||||
bool innerWidthSpecified = false;
|
||||
bool innerHeightSpecified = false;
|
||||
bool outerWidthSpecified = false;
|
||||
bool outerHeightSpecified = false;
|
||||
|
||||
if (strcmp(aPropName, "innerWidth") == 0) {
|
||||
innerWidthSpecified = true;
|
||||
} else if (strcmp(aPropName, "innerHeight") == 0) {
|
||||
innerHeightSpecified = true;
|
||||
} else if (strcmp(aPropName, "outerWidth") == 0) {
|
||||
outerWidthSpecified = true;
|
||||
} else if (strcmp(aPropName, "outerHeight") == 0) {
|
||||
outerHeightSpecified = true;
|
||||
}
|
||||
|
||||
if (innerWidthSpecified || innerHeightSpecified || outerWidthSpecified ||
|
||||
outerHeightSpecified) {
|
||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = outer->GetTreeOwnerWindow();
|
||||
nsCOMPtr<nsIScreenManager> screenMgr(
|
||||
do_GetService("@mozilla.org/gfx/screenmanager;1"));
|
||||
|
||||
if (treeOwnerAsWin && screenMgr) {
|
||||
// Acquire current window size.
|
||||
//
|
||||
// FIXME: This needs to account for full zoom like the outer window code
|
||||
// does! Ideally move there?
|
||||
auto cssScale = treeOwnerAsWin->UnscaledDevicePixelsPerCSSPixel();
|
||||
LayoutDeviceIntRect devWinRect = treeOwnerAsWin->GetPositionAndSize();
|
||||
CSSIntRect cssWinRect = RoundedToInt(devWinRect / cssScale);
|
||||
|
||||
// Acquire content window size.
|
||||
CSSSize contentSize;
|
||||
outer->GetInnerSize(contentSize);
|
||||
|
||||
nsCOMPtr<nsIScreen> screen = screenMgr->ScreenForRect(RoundedToInt(
|
||||
devWinRect / treeOwnerAsWin->DevicePixelsPerDesktopPixel()));
|
||||
if (screen) {
|
||||
int32_t roundedValue = std::round(value);
|
||||
int32_t* targetContentWidth = nullptr;
|
||||
int32_t* targetContentHeight = nullptr;
|
||||
int32_t inputWidth = 0;
|
||||
int32_t inputHeight = 0;
|
||||
int32_t unused = 0;
|
||||
|
||||
CSSIntSize availScreenSize =
|
||||
RoundedToInt(screen->GetAvailRect().Size() / cssScale);
|
||||
|
||||
// Calculate the chrome UI size.
|
||||
CSSIntSize chromeSize = cssWinRect.Size() - RoundedToInt(contentSize);
|
||||
|
||||
if (innerWidthSpecified || outerWidthSpecified) {
|
||||
inputWidth = value;
|
||||
targetContentWidth = &roundedValue;
|
||||
targetContentHeight = &unused;
|
||||
} else if (innerHeightSpecified || outerHeightSpecified) {
|
||||
inputHeight = value;
|
||||
targetContentWidth = &unused;
|
||||
targetContentHeight = &roundedValue;
|
||||
}
|
||||
|
||||
nsContentUtils::CalcRoundedWindowSizeForResistingFingerprinting(
|
||||
chromeSize.width, chromeSize.height, availScreenSize.width,
|
||||
availScreenSize.height, inputWidth, inputHeight,
|
||||
outerWidthSpecified, outerHeightSpecified, targetContentWidth,
|
||||
targetContentHeight);
|
||||
value = T(roundedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(this->*aSetter)(value, aCallerType, aError);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue