mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 11:07:29 +09:00
parent
42d9f2ffb3
commit
47f52cee1f
1 changed files with 7 additions and 1 deletions
|
|
@ -411,7 +411,13 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
||||||
double targetArea = targetRect.width * targetRect.height;
|
double targetArea = targetRect.width * targetRect.height;
|
||||||
double intersectionArea = !intersectionRect ?
|
double intersectionArea = !intersectionRect ?
|
||||||
0 : intersectionRect->width * intersectionRect->height;
|
0 : intersectionRect->width * intersectionRect->height;
|
||||||
double intersectionRatio = targetArea > 0.0 ? intersectionArea / targetArea : 0.0;
|
|
||||||
|
double intersectionRatio;
|
||||||
|
if (targetArea > 0.0) {
|
||||||
|
intersectionRatio = intersectionArea / targetArea;
|
||||||
|
} else {
|
||||||
|
intersectionRatio = intersectionRect.isSome() ? 1.0 : 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
size_t threshold = -1;
|
size_t threshold = -1;
|
||||||
if (intersectionRatio > 0.0) {
|
if (intersectionRatio > 0.0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue