Backed out changeset 0de3705203a4 (bug 1742168) for causing failures at browser_multiple_pushState.js. CLOSED TREE

This commit is contained in:
Butkovits Atila 2021-11-30 16:31:10 +02:00
Родитель 32d4280266
Коммит 8e13e5203a
5 изменённых файлов: 6 добавлений и 40 удалений

Просмотреть файл

@ -11114,7 +11114,9 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
}
// Check that the state object isn't too long.
int32_t maxStateObjSize = StaticPrefs::browser_history_maxStateObjectSize();
// Default max length: 2097152 (0x200000) bytes.
int32_t maxStateObjSize =
Preferences::GetInt("browser.history.maxStateObjectSize", 2097152);
if (maxStateObjSize < 0) {
maxStateObjSize = 0;
}

Просмотреть файл

@ -170,7 +170,6 @@ support-files = file_sessionhistory_iframe_removal.html
[test_bug1326251.html]
skip-if = toolkit == 'android' || sessionHistoryInParent # It relies on the bfcache
[test_bug1379762.html]
[test_state_size.html]
[test_static_and_dynamic.html]
skip-if = true # This was disabled for a few years now anyway, bug 1677544
[test_sibling-matching-parent.html]

Просмотреть файл

@ -1,32 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test the max size of the data parameter of push/replaceState</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
SimpleTest.waitForExplicitFinish();
function test() {
let tooLarge = SpecialPowers.getIntPref("browser.history.maxStateObjectSize");
let allowed = Math.floor(tooLarge / 2);
history.pushState(new Array(allowed).join("a"), "");
ok(true, "Adding a state should succeed.");
try {
history.pushState(new Array(tooLarge).join("a"), "");
ok(false, "Adding a too large state object should fail.");
} catch(ex) {
ok(true, "Adding a too large state object should fail.");
}
SimpleTest.finish();
}
</script>
</head>
<body onload="test()">
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>
</body>
</html>

Просмотреть файл

@ -1174,12 +1174,6 @@
value: 2000
mirror: always
# Max size of push/replaceState data parameter
- name: browser.history.maxStateObjectSize
type: int32_t
value: 16777216
mirror: always
#ifdef XP_WIN
# Notify TabUnloader or send the memory pressure if the memory resource
# notification is signaled AND the available commit space is lower than

Просмотреть файл

@ -3756,6 +3756,9 @@ pref("browser.region.update.enabled", true);
// Enable/Disable the device storage API for content
pref("device.storage.enabled", false);
// Push/Pop/Replace State prefs
pref("browser.history.maxStateObjectSize", 2097152);
pref("browser.meta_refresh_when_inactive.disabled", false);
// XPInstall prefs