Title: [237829] trunk/LayoutTests/imported/w3c
Revision
237829
Author
[email protected]
Date
2018-11-05 12:43:09 -0800 (Mon, 05 Nov 2018)

Log Message

[IntersectionObserver] Update WPTs to the latest upstream version
https://bugs.webkit.org/show_bug.cgi?id=191274

Reviewed by Simon Fraser.

* web-platform-tests/intersection-observer/bounding-box-expected.txt:
* web-platform-tests/intersection-observer/bounding-box.html:
* web-platform-tests/intersection-observer/target-in-different-window-expected.txt: Added.
* web-platform-tests/intersection-observer/target-in-different-window.html: Added.
* web-platform-tests/intersection-observer/w3c-import.log:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (237828 => 237829)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-11-05 20:36:21 UTC (rev 237828)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-11-05 20:43:09 UTC (rev 237829)
@@ -1,3 +1,16 @@
+2018-11-05  Ali Juma  <[email protected]>
+
+        [IntersectionObserver] Update WPTs to the latest upstream version
+        https://bugs.webkit.org/show_bug.cgi?id=191274
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/intersection-observer/bounding-box-expected.txt:
+        * web-platform-tests/intersection-observer/bounding-box.html:
+        * web-platform-tests/intersection-observer/target-in-different-window-expected.txt: Added.
+        * web-platform-tests/intersection-observer/target-in-different-window.html: Added.
+        * web-platform-tests/intersection-observer/w3c-import.log:
+
 2018-11-05  Chris Dumez  <[email protected]>
 
         Resync html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name WPT tests

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box-expected.txt (237828 => 237829)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box-expected.txt	2018-11-05 20:36:21 UTC (rev 237828)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box-expected.txt	2018-11-05 20:43:09 UTC (rev 237829)
@@ -2,4 +2,6 @@
 PASS Test that the target's border bounding box is used to calculate intersection. 
 PASS First rAF. 
 PASS target.style.transform = 'translateY(195px)' 
+PASS target.style.transform = 'translateY(300px)' 
+FAIL target.style.zoom = 2 assert_equals: entries[3].boundingClientRect.left expected 18 but got 36
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box.html (237828 => 237829)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box.html	2018-11-05 20:36:21 UTC (rev 237828)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/bounding-box.html	2018-11-05 20:43:09 UTC (rev 237829)
@@ -13,7 +13,7 @@
   overflow: visible;
   height: 200px;
   width: 160px;
-  border: 7px solid black;
+  border: 8px solid black;
 }
 #target {
   margin: 10px;
@@ -50,12 +50,35 @@
   var targetBounds = clientBounds(target);
   target.style.transform = "translateY(195px)";
   runTestCycle(step1, "target.style.transform = 'translateY(195px)'");
-  checkLastEntry(entries, 0, targetBounds.concat(0, 0, 0, 0, 8, 182, 8, 222, false));
+  checkLastEntry(entries, 0, targetBounds.concat(0, 0, 0, 0, 8, 184, 8, 224, false));
 }
 
 function step1() {
   var targetBounds = clientBounds(target);
+  target.style.transform = "translateY(300px)";
+  runTestCycle(step2, "target.style.transform = 'translateY(300px)'");
+  checkLastEntry(entries, 1, targetBounds.concat(26, 146, 221, 224, 8, 184, 8, 224, true));
+}
+
+function step2() {
+  var targetBounds = clientBounds(target);
   target.style.transform = "";
-  checkLastEntry(entries, 1, targetBounds.concat(25, 145, 220, 222, 8, 182, 8, 222, true));
+  target.style.zoom = "2";
+  runTestCycle(step3, "target.style.zoom = 2");
+  checkLastEntry(entries, 2, targetBounds.concat(0, 0, 0, 0, 8, 184, 8, 224, false));
 }
+
+function step3() {
+  var targetBounds = clientBounds(target);
+  var intersectionWidth = (
+      176  // root width including border
+      -8   // root left border
+      -20  // target left margin * target zoom
+  ) / 2;   // convert to target's zoom factor.
+  var intersectionHeight = (216 - 8 - 20) / 2;
+  var intersectionRect = [targetBounds[0], targetBounds[0] + intersectionWidth,
+                          targetBounds[2], targetBounds[2] + intersectionHeight];
+  checkLastEntry(entries, 3, targetBounds.concat(intersectionRect).concat(8, 184, 8, 224, true));
+}
+
 </script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window-expected.txt (0 => 237829)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window-expected.txt	2018-11-05 20:43:09 UTC (rev 237829)
@@ -0,0 +1,3 @@
+
+FAIL IntersectionObserver with target in a different window. assert_equals: Notification after insertion into popup. expected 2 but got 1
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window.html (0 => 237829)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window.html	2018-11-05 20:43:09 UTC (rev 237829)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<script src=""
+
+<script>
+var entries = [];
+var popup, target;
+
+function waitForPopupNotification(f) {
+  popup.requestAnimationFrame(function() {
+    popup.requestAnimationFrame(function() { popup.setTimeout(f); });
+  });
+}
+
+async_test((t) => {
+  var observer = new IntersectionObserver(function(changes) {
+    entries = entries.concat(changes);
+  });
+  popup = window.open();
+  t.add_cleanup(() => popup.close());
+  target = popup.document.createElement('div');
+  target.style.width = "100px";
+  target.style.height = "100px";
+  observer.observe(target);
+  waitForPopupNotification(t.step_func(() => {
+    assert_equals(entries.length, 1, "Initial notification for detached target.");
+    assert_equals(entries[0].isIntersecting, false, "not intersecting");
+    popup.document.body.appendChild(target);
+    waitForPopupNotification(t.step_func_done(() => {
+      assert_equals(entries.length, 2, "Notification after insertion into popup.");
+      assert_equals(entries[1].isIntersecting, true, "intersecting");
+    }));
+  }));
+}, "IntersectionObserver with target in a different window.");
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log (237828 => 237829)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log	2018-11-05 20:36:21 UTC (rev 237828)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log	2018-11-05 20:43:09 UTC (rev 237829)
@@ -39,6 +39,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-root.html
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-zero-size-target.html
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/shadow-content.html
+/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window.html
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/text-target.html
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/timestamp.html
 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/unclipped-root.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to