Backed out changeset 0dba60796753 (bug 1611204) for perma failures on isIntersecting-threshold.html. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-05-28 05:33:20 +03:00
Родитель d76f77f616
Коммит 42c461fb61
4 изменённых файлов: 13 добавлений и 17 удалений

Просмотреть файл

@ -618,9 +618,7 @@ void DOMIntersectionObserver::Update(Document* aDocument,
// length of observer.thresholds if intersectionRatio is greater than or
// equal to the last entry in observer.thresholds.
int32_t thresholdIndex = -1;
// If not intersecting, we can just shortcut, as we know that the thresholds
// are always between 0 and 1.
// FIXME(emilio): Why the isIntersecting check?
if (isIntersecting) {
thresholdIndex = mThresholds.IndexOfFirstElementGt(intersectionRatio);
if (thresholdIndex == 0) {
@ -630,22 +628,18 @@ void DOMIntersectionObserver::Update(Document* aDocument,
// neither Chrome nor the WPT tests expect this behavior, so treat these
// two cases as one.
//
// See https://github.com/w3c/IntersectionObserver/issues/432 about
// this.
// FIXME(emilio): Looks like a good candidate for a spec issue.
thresholdIndex = -1;
}
}
// Steps 2.10 - 2.15.
if (target->UpdateIntersectionObservation(this, thresholdIndex)) {
// See https://github.com/w3c/IntersectionObserver/issues/432 about
// why we use thresholdIndex > 0 rather than isIntersecting for the
// entry's isIntersecting value.
QueueIntersectionObserverEntry(
target, time,
origin == BrowsingContextOrigin::Similar ? Some(rootBounds)
: Nothing(),
targetRect, intersectionRect, thresholdIndex > 0, intersectionRatio);
targetRect, intersectionRect, intersectionRatio);
}
}
}
@ -653,7 +647,7 @@ void DOMIntersectionObserver::Update(Document* aDocument,
void DOMIntersectionObserver::QueueIntersectionObserverEntry(
Element* aTarget, DOMHighResTimeStamp time, const Maybe<nsRect>& aRootRect,
const nsRect& aTargetRect, const Maybe<nsRect>& aIntersectionRect,
bool aIsIntersecting, double aIntersectionRatio) {
double aIntersectionRatio) {
RefPtr<DOMRect> rootBounds;
if (aRootRect.isSome()) {
rootBounds = new DOMRect(this);
@ -667,7 +661,7 @@ void DOMIntersectionObserver::QueueIntersectionObserverEntry(
}
RefPtr<DOMIntersectionObserverEntry> entry = new DOMIntersectionObserverEntry(
this, time, rootBounds.forget(), boundingClientRect.forget(),
intersectionRect.forget(), aIsIntersecting, aTarget,
intersectionRect.forget(), aIntersectionRect.isSome(), aTarget,
aIntersectionRatio);
mQueuedEntries.AppendElement(entry.forget());
}

Просмотреть файл

@ -31,9 +31,9 @@ class DOMIntersectionObserverEntry final : public nsISupports,
double aIntersectionRatio)
: mOwner(aOwner),
mTime(aTime),
mRootBounds(std::move(aRootBounds)),
mBoundingClientRect(std::move(aBoundingClientRect)),
mIntersectionRect(std::move(aIntersectionRect)),
mRootBounds(aRootBounds),
mBoundingClientRect(aBoundingClientRect),
mIntersectionRect(aIntersectionRect),
mIsIntersecting(aIsIntersecting),
mTarget(aTarget),
mIntersectionRatio(aIntersectionRatio) {}
@ -138,7 +138,6 @@ class DOMIntersectionObserver final : public nsISupports,
const Maybe<nsRect>& aRootRect,
const nsRect& aTargetRect,
const Maybe<nsRect>& aIntersectionRect,
bool aIsIntersecting,
double aIntersectionRatio);
nsCOMPtr<nsPIDOMWindowInner> mOwner;

Просмотреть файл

@ -0,0 +1,4 @@
[initial-observation-with-threshold.html]
[First rAF]
expected: FAIL

Просмотреть файл

@ -33,8 +33,7 @@ function step2() {
assert_equals(entries.length, 1);
assert_equals(entries[0].intersectionRatio, 1);
// See https://github.com/w3c/IntersectionObserver/issues/432
assert_equals(entries[0].isIntersecting, false);
assert_equals(entries[0].isIntersecting, true);
scroller.scrollTop = 50;
}