Web: Fix performance issue resulting from detecting offscreen text brokenness
When authors hide text offscreen so that only screen readers will find them and present them, they think they are being helpful. Unfortunately, their techniques by side effect can break what we get for the accessible text (e.g. asking for a line at offset results in only a single char or word). Thus we have to sanity check all text in order to work around this. Normally this is not a performance problem because we can bail after checking the first line. But in a giant text object whose contents consist almost entirely of embedded object chars, we can get quite laggy. Therefore, if the accessible text is more than 30% embedded object chars, bail on the lines-are-single-words sanity check.
Showing with 10 additions and 0 deletions