Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that matches are not scrolled into after the findbar has been closed (PR 10100 follow-up) #10184

Merged
merged 2 commits into from
Oct 28, 2018

Conversation

Snuffleupagus
Copy link
Collaborator

This is something that I noticed while testing PR #10183, and it probably deserves a separate PR rather than being lumped in with those changes since it's a direct follow-up to PR #10100.

… to reduce the amount of event dispatching

Given that dispatching the 'updatetextlayermatches' event with `pageIndex = -1` set is now used to target the textLayers of *all* pages, there's no need to send individual events to every single page during `_nextMatch`. Since there can be an arbitrary number of pages in a document, this small/simple optimization seems too easy to ignore.
…closed (PR 10100 follow-up)

Despite all highlighted matches being removed in response to the 'findbarclose' event, there's a risk that a match could still be scrolled into view *after* the findbar has been closed[1].
Hence we need to ensure that long running searches, particularily those happening in large and/or slow loading documents[2], are ignored as well.

---
[1] The match is hidden, as expected, but the document could still scroll unexpectedly.
[2] Large documents loaded with `disableAutoFetch = true` and `disableStream = true` set are particularily susceptible to this issue.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/6e98403eec774b8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/6e98403eec774b8/output.txt

Total script time: 2.96 mins

Published

@timvandermeij timvandermeij merged commit 991a574 into mozilla:master Oct 28, 2018
@timvandermeij
Copy link
Contributor

Looks good; thank you! It's also good to see that the find code is becoming much more readable lately.

@Snuffleupagus Snuffleupagus deleted the findbarclose-abort branch October 28, 2018 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants