From 96abb4bbe7bfde35c92f268d5a3072282f8898f5 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 29 Oct 2018 16:15:28 +0100 Subject: [PATCH] [Regression] Ensure that "Highlight All" is propagated to all pages for 'findagain' events where the findbar was previously closed (PR 10100 follow-up) **STR:** 1. Open the default viewer, with the `tracemonkey` file. 2. Open the findbar, and search for "trace". 3. Enable the "Highlight All" option. 4. Close the findbar. 5. Re-open the findbar, and click on the "findNext" button. 6. Scroll down to the *second* page of the document. **ER:** Since "Highlight All" is active, all matches on the *second* page should be highlighted. **AR:** No matches are highlighted on the *second* page. --- web/pdf_find_controller.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index 8ec5b6398..a8f60a1fb 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -139,6 +139,16 @@ class PDFFindController { this._nextMatch(); this._findTimeout = null; }, FIND_TIMEOUT); + } else if (cmd === 'findagain' && !this._dirtyMatch) { + const updateHighlightAll = (!this._highlightMatches && + this._state.highlightAll); + this._nextMatch(); + + // When the findbar was previously closed, and `highlightAll` is set, + // ensure that the matches on all active pages are highlighted again. + if (updateHighlightAll) { + this._updateAllPages(); + } } else { this._nextMatch(); }