Bug 1883279 - Check browser.navigation.requireUserInteraction before skipping entries based on user interaction. r=farre

We don't want to start skipping entries just because callers passed in
aRequireUserInteraction, since the feature is not ready and the flag in the
entries might not be correct.

Differential Revision: https://phabricator.services.mozilla.com/D203376
This commit is contained in:
Peter Van der Beken 2024-03-13 10:56:33 +00:00
Родитель 80aa10467a
Коммит 108dd29bbc
2 изменённых файлов: 4 добавлений и 2 удалений

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

@ -1220,7 +1220,8 @@ Maybe<int32_t> CanonicalBrowsingContext::HistoryGo(
// Check for user interaction if desired, except for the first and last
// history entries. We compare with >= to account for the case where
// aOffset >= length.
if (!aRequireUserInteraction || index.value() >= shistory->Length() - 1 ||
if (!StaticPrefs::browser_navigation_requireUserInteraction() ||
!aRequireUserInteraction || index.value() >= shistory->Length() - 1 ||
index.value() <= 0) {
break;
}

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

@ -156,7 +156,8 @@ void ChildSHistory::Go(int32_t aOffset, bool aRequireUserInteraction,
// Check for user interaction if desired, except for the first and last
// history entries. We compare with >= to account for the case where
// aOffset >= Count().
if (!aRequireUserInteraction || index.value() >= Count() - 1 ||
if (!StaticPrefs::browser_navigation_requireUserInteraction() ||
!aRequireUserInteraction || index.value() >= Count() - 1 ||
index.value() <= 0) {
break;
}