[IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
authorajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Nov 2018 14:47:40 +0000 (14:47 +0000)
committerajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Nov 2018 14:47:40 +0000 (14:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191210

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Update expectation for test that now passes.

* web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.txt:

Source/WebCore:

isIntersecting should be false if the intersection ratio is smaller than the
smallest threshold value. Update the computation of isIntersecting to depend on
the current thresholdIndex.

Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html

* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237798 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp

index a4abd64..199e34e 100644 (file)
@@ -1,3 +1,14 @@
+2018-11-05  Ali Juma  <ajuma@chromium.org>
+
+        [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
+        https://bugs.webkit.org/show_bug.cgi?id=191210
+
+        Reviewed by Simon Fraser.
+
+        Update expectation for test that now passes.
+
+        * web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.txt:
+
 2018-11-04  Youenn Fablet  <youenn@apple.com>
 
         IDB should allow storing RTCCertificate
index 9ab7bd2..b6b6a02 100644 (file)
@@ -1,3 +1,19 @@
+2018-11-05  Ali Juma  <ajuma@chromium.org>
+
+        [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
+        https://bugs.webkit.org/show_bug.cgi?id=191210
+
+        Reviewed by Simon Fraser.
+
+        isIntersecting should be false if the intersection ratio is smaller than the
+        smallest threshold value. Update the computation of isIntersecting to depend on
+        the current thresholdIndex.
+
+        Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::updateIntersectionObservations):
+
 2018-11-05  Rob Buis  <rbuis@igalia.com>
 
         Remove some virtual methods in CachedRawResource
index 6626a98..338e1b5 100644 (file)
@@ -7778,7 +7778,7 @@ void Document::updateIntersectionObservations()
                     { clientIntersectionRect.x(), clientIntersectionRect.y(), clientIntersectionRect.width(), clientIntersectionRect.height() },
                     intersectionRatio,
                     target,
-                    intersectionState? intersectionState->isIntersecting : false,
+                    thresholdIndex > 0,
                 }));
                 needNotify = true;
                 registration.previousThresholdIndex = thresholdIndex;