fix element invisible detect (#1889)

Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Shuchang Zheng
2025-03-05 14:37:15 -05:00
committed by GitHub
parent adfce8f85c
commit ab02998d19

View File

@@ -257,7 +257,11 @@ function isElementStyleVisibilityVisible(element, style) {
// TODO: support style.clipPath and style.clipRule?
// if element is clipped with rect(0px, 0px, 0px, 0px), it means it's invisible on the page
if (style.clip === "rect(0px, 0px, 0px, 0px)") {
// FIXME: need a better algorithm to calculate the visible rect area, using (right-left)*(bottom-top) from rect(top, right, bottom, left)
if (
style.clip === "rect(0px, 0px, 0px, 0px)" ||
style.clip === "rect(1px, 1px, 1px, 1px)"
) {
return false;
}