-
Notifications
You must be signed in to change notification settings - Fork 4
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
Extended API: how exactly do we list results? #7
Comments
Hmm, I just thought about this again. Should the browser really re-do the find after we set the results, for all the results? What if the result items are all far away from each other? That will mean loading a lot of things into the DOM. If we have beforeFirst/afterLast, then the browser can re-do the find only when the browser needs it (at the start/end of browser's own result). |
I can see how giving the browser a hint on how much of the page to re-do the find on could save a bit of processing power. But I'm not sure whether that savings is worth asking authors to manually figure out whether their results are before or after the current search position. But maybe I am confused. You said
How would you propose avoiding loading a lot of things into the DOM in these cases? |
My idea is that the browser should only call the callback in the added results when the active match is nearing those results (nearing the end or the start of browser's own results) one by one. But I guess it's not really worth it to make the authors figure out which function to call.. This is related to #10. If |
Oh, no, you're totally right, we want this. I was confused indeed. I was thinking we would only call the callback when they go to the particular FindInPageResult in question. But I see the problem: how does the browser know when the user wants to go to that FindInPageResult? I think setDeferredResultsBeforeFirst and setDeferredResultsAfterLast is better than just addResults. (Maybe keep the simpler name like addResultsBeforeFirst.) Maybe there is something better, but we should probably go back to that split for now. |
We list several APIs here:
Which of these are we proposing? Probably not all of them. Which ones do we need?
Keeping in mind the example code, I am thinking maybe we just need setDeferredResults (which we should rename "addResults"). If the idea is for the browser to re-do the find after we set the results, then we don't need to tell the browser if they're before the first or after the last.
The text was updated successfully, but these errors were encountered: