mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 17:17:31 +09:00
Add isIntersecting property to IntersectionObserverEntry.
Per updated spec. This resolves the issue raised in #249.
This commit is contained in:
parent
54b77893e2
commit
9222116f26
3 changed files with 11 additions and 0 deletions
|
|
@ -482,6 +482,7 @@ DOMIntersectionObserver::QueueIntersectionObserverEntry(Element* aTarget,
|
||||||
rootBounds.forget(),
|
rootBounds.forget(),
|
||||||
boundingClientRect.forget(),
|
boundingClientRect.forget(),
|
||||||
intersectionRect.forget(),
|
intersectionRect.forget(),
|
||||||
|
aIntersectionRect.isSome(),
|
||||||
aTarget, aIntersectionRatio);
|
aTarget, aIntersectionRatio);
|
||||||
mQueuedEntries.AppendElement(entry.forget());
|
mQueuedEntries.AppendElement(entry.forget());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ public:
|
||||||
RefPtr<DOMRect> aRootBounds,
|
RefPtr<DOMRect> aRootBounds,
|
||||||
RefPtr<DOMRect> aBoundingClientRect,
|
RefPtr<DOMRect> aBoundingClientRect,
|
||||||
RefPtr<DOMRect> aIntersectionRect,
|
RefPtr<DOMRect> aIntersectionRect,
|
||||||
|
bool aIsIntersecting,
|
||||||
Element* aTarget,
|
Element* aTarget,
|
||||||
double aIntersectionRatio)
|
double aIntersectionRatio)
|
||||||
: mOwner(aOwner),
|
: mOwner(aOwner),
|
||||||
|
|
@ -37,6 +38,7 @@ public:
|
||||||
mRootBounds(aRootBounds),
|
mRootBounds(aRootBounds),
|
||||||
mBoundingClientRect(aBoundingClientRect),
|
mBoundingClientRect(aBoundingClientRect),
|
||||||
mIntersectionRect(aIntersectionRect),
|
mIntersectionRect(aIntersectionRect),
|
||||||
|
mIsIntersecting(aIsIntersecting),
|
||||||
mTarget(aTarget),
|
mTarget(aTarget),
|
||||||
mIntersectionRatio(aIntersectionRatio)
|
mIntersectionRatio(aIntersectionRatio)
|
||||||
{
|
{
|
||||||
|
|
@ -74,6 +76,11 @@ public:
|
||||||
return mIntersectionRect;
|
return mIntersectionRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsIntersecting()
|
||||||
|
{
|
||||||
|
return mIsIntersecting;
|
||||||
|
}
|
||||||
|
|
||||||
double IntersectionRatio()
|
double IntersectionRatio()
|
||||||
{
|
{
|
||||||
return mIntersectionRatio;
|
return mIntersectionRatio;
|
||||||
|
|
@ -90,6 +97,7 @@ protected:
|
||||||
RefPtr<DOMRect> mRootBounds;
|
RefPtr<DOMRect> mRootBounds;
|
||||||
RefPtr<DOMRect> mBoundingClientRect;
|
RefPtr<DOMRect> mBoundingClientRect;
|
||||||
RefPtr<DOMRect> mIntersectionRect;
|
RefPtr<DOMRect> mIntersectionRect;
|
||||||
|
bool mIsIntersecting;
|
||||||
RefPtr<Element> mTarget;
|
RefPtr<Element> mTarget;
|
||||||
double mIntersectionRatio;
|
double mIntersectionRatio;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ interface IntersectionObserverEntry {
|
||||||
[Constant]
|
[Constant]
|
||||||
readonly attribute DOMRectReadOnly intersectionRect;
|
readonly attribute DOMRectReadOnly intersectionRect;
|
||||||
[Constant]
|
[Constant]
|
||||||
|
readonly attribute boolean isIntersecting;
|
||||||
|
[Constant]
|
||||||
readonly attribute double intersectionRatio;
|
readonly attribute double intersectionRatio;
|
||||||
[Constant]
|
[Constant]
|
||||||
readonly attribute Element target;
|
readonly attribute Element target;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue