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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user