bug 1549708: docshell: add nsIDocShell.isForceReloading; r=bzbarsky

Exposes a new nsIDocShell API, isForceReloading, to determine if
the loaded document was force-reloaded or not.

It relies on the underlying behaviour of nsDocShell::IsForceReloading(),
which again relies on nsDocShell::IsForceReloadType(mLoadType).

The getter is used in the remote agent to test that
Page.reload({ignoreCache: true}) works as intended.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Tolfsen 2019-11-04 13:28:23 +00:00
Родитель 55deef9140
Коммит 243b658475
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -13342,6 +13342,12 @@ nsDocShell::GetColorMatrix(nsTArray<float>& aMatrix) {
#undef MATRIX_LENGTH
NS_IMETHODIMP
nsDocShell::GetIsForceReloading(bool* aForceReload) {
*aForceReload = IsForceReloading();
return NS_OK;
}
bool nsDocShell::IsForceReloading() { return IsForceReloadType(mLoadType); }
NS_IMETHODIMP

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

@ -1074,6 +1074,12 @@ interface nsIDocShell : nsIDocShellTreeItem
void setColorMatrix(in Array<float> aMatrix);
/**
* Returns true if the current load is a forced reload,
* e.g. started by holding shift whilst triggering reload.
*/
readonly attribute bool isForceReloading;
Array<float> getColorMatrix();
/**