mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-01 07:41:00 +02:00
The custom solution for obtaining the bounding box of a given element that we have now was necessary during the original introduction of the integration tests because at the time the `ElementHandle.boundingBox()` API in Puppeteer didn't work correctly in Chrome. However, `getRect`, where this is used, is a hot utility function because most tests call it multiple times, either directly or indirectly via other utility functions, and it turns out that the approach we use is slower than the native `ElementHandle.boundingBox()` API. Fortunately, most likely after a combination of Chrome/Puppeteer updates and the conversion to the formalized WebDriver BiDi protocol the custom solution is no longer necessary because all tests pass without it too, so this commit converts `getRect` to use `ElementHandle.boundingBox()` instead to speed up the tests.