[EnhanceTextSelection] Make `expandTextDivs` more efficient by updating all styles at once instead of piecewise
[EnhanceTextSelection] Make `expandTextDivs` more efficient by updating all styles at once instead of piecewise

I intended to provide proper benchmarking results here, as outlined in https://github.com/mozilla/pdf.js/wiki/Benchmarking-your-changes, but after wasting a couple of hours over the weekend getting weird results I gave up.
It appears that there's a lot of, i.e. way too much, variance between subsequent runs of `text` tests for the results to be meaningful.
(Previously I've only benchmarked `eq` tests, so I don't know if the `text` tests has never worked well or if it's a newer problem. For reference, please see the results of back-to-back benchmark runs on the current `master` with a *very* simple manifest file: [link here].)

Instead I used `console.time/timeEnd` in `appendText` and `expandTextDivs` to be able to compare the performance with/without the patch. The entire viewer was (skip-cache) reloaded between measurements, and the result are available here: [link here].
Given the troubles I've had with benchmarking, I've not yet computed any statistics on the results (e.g. mean, variance, confidence intervals, and so on).
However, just by looking at the data I think it's safe to say that this patch first of all doesn't seem to regress the current performance. Secondly it certainly looks *very* likely that this patch actually improves the performance, especially for the one-glyph-per-text-div case (cf. issue 7224).

Re: issue 7584.

a0preetham/pdf.js,Shoobx/pdf.js,nawawi/pdf.js,tinderboxhq/pdf.js,yurydelendik/pdf.js,tinderboxhq/pdf.js,jasonjensen/pdf.js,WhitesteinTechnologies/wt-vaadin-pdf.js,mukulmishra18/pdf.js,Snuffleupagus/pdf.js,macroplant/pdf.js,Rob--W/pdf.js,skalnik/pdf.js,mozilla/pdf.js,mozilla/pdf.js,adlerweb/pdf.js-Touch,mozilla/pdf.js,macroplant/pdf.js,Shoobx/pdf.js,skalnik/pdf.js,xavier114fch/pdf.js,nawawi/pdf.js,websirnik/pdf.js,timvandermeij/pdf.js,xavier114fch/pdf.js,timvandermeij/pdf.js,yurydelendik/pdf.js,mainegreen/pdf.js,macroplant/pdf.js,websirnik/pdf.js,WhitesteinTechnologies/wt-vaadin-pdf.js,Snuffleupagus/pdf.js,caremerge/pdf.js,showpad/mozilla-pdf.js,caremerge/pdf.js,mysterlune/pdf.js,timvandermeij/pdf.js,a0preetham/pdf.js,showpad/mozilla-pdf.js,mysterlune/pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,1and1/pdf.js,1and1/pdf.js,adlerweb/pdf.js-Touch,jasonjensen/pdf.js,mainegreen/pdf.js,ydfzgyj/pdf.js,showpad/mozilla-pdf.js,mukulmishra18/pdf.js,Rob--W/pdf.js,nawawi/pdf.js,ydfzgyj/pdf.js