gecko_ia2 vbuf backend: Support IAccessibleHypertext2 to improve performance for Firefox multi-process. (#7719)
* gecko_ia2 vbuf backend: Support IAccessibleHypertext2 to improve performance for Firefox multi-process.
IAccessibleHypertext2::hyperlinks allows all embedded objects to be retrieved at once, rather than retrieving them one at a time.
This improves performance for cross-process renders, which is the case for Firefox multi-process.
IAccessibleHypertext is still supported and will be used if the newer interface is not present.
In addition:
1. Don't bother calling hyperlinkIndex, since in Gecko (and Chrome), hyperlinks correspond with embedded object characters.
2. Use a constant for the embedded object character.
* Move hyperlink getter code into ia2utils so it can be reused.
* Fix typo in comment.
* Slight performance enhancement to HyperlinkGetter.
The gecko vbuf (and probably any future callers) only call HyperlinkGetter::next() when they encounter an embedded object character.
That is, if there are no embedded object characters, there will be no calls.
Thus:
1. For IAccessibleHypertext, we don't need to call nHyperlinks. hyperlink will fail or return null if we pass an invalid index anyway.
2. For IAccessibleHypertext2, we can lazily fetch the hyperlinks on the first call to get(), thus saving a potential cross-process call when there are none.