This commit is contained in:
John Factotum
2024-09-25 22:33:02 +08:00
parent 59a5aa22a0
commit 02a24ea25c
+1 -1
View File
@@ -67,7 +67,7 @@ const filter = SHOW_ELEMENT | SHOW_TEXT | SHOW_CDATA_SECTION
// needed cause there seems to be a bug in `getBoundingClientRect()` in Firefox // needed cause there seems to be a bug in `getBoundingClientRect()` in Firefox
// where it fails to include rects that have zero width and non-zero height // where it fails to include rects that have zero width and non-zero height
// (CSSOM spec says "rectangles [...] of which the height or width is not zero") // (CSSOM spec says "rectangles [...] of which the height or width is not zero")
// which makes the visible range to include an extra space at column boundaries // which makes the visible range include an extra space at column boundaries
const getBoundingClientRect = target => { const getBoundingClientRect = target => {
let top = Infinity, right = -Infinity, left = Infinity, bottom = -Infinity let top = Infinity, right = -Infinity, left = Infinity, bottom = -Infinity
for (const rect of target.getClientRects()) { for (const rect of target.getClientRects()) {