From afd1bab71f2148ed533f4b163436c4f2840dff4a Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Tue, 23 Nov 2021 15:37:24 +0000 Subject: [PATCH] Bug 1741132 - Correctly evict entries with session history in parent. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D131894 --- docshell/base/CanonicalBrowsingContext.cpp | 2 + docshell/test/mochitest/file_bug1741132.html | 28 +++++++++ docshell/test/mochitest/mochitest.ini | 3 + docshell/test/mochitest/test_bug1741132.html | 66 ++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 docshell/test/mochitest/file_bug1741132.html create mode 100644 docshell/test/mochitest/test_bug1741132.html diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp index 440ff57b4086..70798e001da7 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp @@ -2143,6 +2143,8 @@ void CanonicalBrowsingContext::HistoryCommitIndexAndLength( GetChildSessionHistory()->SetIndexAndLength(index, length, aChangeID); + shistory->EvictOutOfRangeContentViewers(index); + Group()->EachParent([&](ContentParent* aParent) { Unused << aParent->SendHistoryCommitIndexAndLength(this, index, length, aChangeID); diff --git a/docshell/test/mochitest/file_bug1741132.html b/docshell/test/mochitest/file_bug1741132.html new file mode 100644 index 000000000000..6603e47417f0 --- /dev/null +++ b/docshell/test/mochitest/file_bug1741132.html @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/docshell/test/mochitest/mochitest.ini b/docshell/test/mochitest/mochitest.ini index c95190e09154..372844cf34a7 100644 --- a/docshell/test/mochitest/mochitest.ini +++ b/docshell/test/mochitest/mochitest.ini @@ -121,6 +121,9 @@ support-files = support-files = file_bug1740517.html file_bug1740517.html^headers^ +[test_bug1741132.html] +support-files = + file_bug1741132.html [test_close_onpagehide_by_history_back.html] [test_close_onpagehide_by_window_close.html] [test_compressed_multipart.html] diff --git a/docshell/test/mochitest/test_bug1741132.html b/docshell/test/mochitest/test_bug1741132.html new file mode 100644 index 000000000000..753fb2665762 --- /dev/null +++ b/docshell/test/mochitest/test_bug1741132.html @@ -0,0 +1,66 @@ + + + + + Test form restoration for no-store pages + + + + + +

+ +

+
+