Bug 1561227 Part 1: Make nsDocumentViewer send a new event before setting full zoom levels on the pres contexts. r=emilio

The PreFullZoomChange event gives listeners an opportunity to capture
state before the viewport full zoom changes. Responsive Design Mode uses
this to save and later restore the resolution of the RDM pane.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brad Werth 2019-10-25 21:05:42 +00:00
Родитель a42aaaf977
Коммит 0d470caf2a
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -2826,6 +2826,14 @@ nsDocumentViewer::SetFullZoom(float aFullZoom) {
}
bool fullZoomChange = (mPageZoom != aFullZoom);
// Dispatch PreFullZoomChange event only if fullzoom value really has changed.
if (fullZoomChange) {
nsContentUtils::DispatchChromeEvent(mDocument, ToSupports(mDocument),
NS_LITERAL_STRING("PreFullZoomChange"),
CanBubble::eYes, Cancelable::eYes);
}
mPageZoom = aFullZoom;
PropagateToPresContextsHelper(