Bug 1659084 - Clean up some nsPageSequenceFrame. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D87061
This commit is contained in:
Emilio Cobos Álvarez 2020-08-14 12:23:39 +00:00
Родитель 5c720db7a4
Коммит 31a5cfa91b
1 изменённых файлов: 3 добавлений и 6 удалений

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

@ -559,7 +559,7 @@ nsresult nsPageSequenceFrame::PrePrintNextPage(nsITimerCallback* aCallback,
mCurrentCanvasListSetup = true;
GetPrintCanvasElementsInFrame(currentPage, &mCurrentCanvasList);
if (mCurrentCanvasList.Length() != 0) {
if (!mCurrentCanvasList.IsEmpty()) {
nsresult rv = NS_OK;
// Begin printing of the document
@ -579,8 +579,7 @@ nsresult nsPageSequenceFrame::PrePrintNextPage(nsITimerCallback* aCallback,
return NS_ERROR_FAILURE;
}
for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0; i--) {
HTMLCanvasElement* canvas = mCurrentCanvasList[i];
for (HTMLCanvasElement* canvas : Reversed(mCurrentCanvasList)) {
nsIntSize size = canvas->GetSize();
RefPtr<DrawTarget> canvasTarget =
@ -613,9 +612,7 @@ nsresult nsPageSequenceFrame::PrePrintNextPage(nsITimerCallback* aCallback,
}
}
uint32_t doneCounter = 0;
for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0; i--) {
HTMLCanvasElement* canvas = mCurrentCanvasList[i];
for (HTMLCanvasElement* canvas : mCurrentCanvasList) {
if (canvas->IsPrintCallbackDone()) {
doneCounter++;
}