⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271234 in webkit


Ignore:
Timestamp:
Jan 7, 2021, 2:38:53 AM (6 years ago)
Author:
cathiechen
Message:

Update WPT test suite for intersection-observer
https://bugs.webkit.org/show_bug.cgi?id=220403

Reviewed by Rob Buis.

Sync WPT intersection-observer tests with 5a3a1b414d32952355eae7c949c109424979b988.

  • web-platform-tests/intersection-observer/cross-document-root-expected.txt: Added.
  • web-platform-tests/intersection-observer/cross-document-root.html: Added.
  • web-platform-tests/intersection-observer/explicit-root-different-document.tentative-expected.txt: Added.
  • web-platform-tests/intersection-observer/explicit-root-different-document.tentative.html: Added.
  • web-platform-tests/intersection-observer/intersection-ratio-ib-split.html:
  • web-platform-tests/intersection-observer/not-in-containing-block-chain.tentative-expected.txt: Added.
  • web-platform-tests/intersection-observer/not-in-containing-block-chain.tentative.html: Added.
  • web-platform-tests/intersection-observer/observer-attributes-expected.txt:
  • web-platform-tests/intersection-observer/observer-attributes.html:
  • web-platform-tests/intersection-observer/resources/cross-origin-child-iframe.sub.html:
  • web-platform-tests/intersection-observer/resources/same-origin-grand-child-iframe.html:
  • web-platform-tests/intersection-observer/same-document-with-document-root-expected.txt: Added.
  • web-platform-tests/intersection-observer/same-document-with-document-root.html: Added.
  • web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub.html:
  • web-platform-tests/intersection-observer/target-in-different-window.html:
  • web-platform-tests/intersection-observer/w3c-import.log:
Location:
trunk/LayoutTests/imported/w3c
Files:
8 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r271196 r271234  
     12021-01-07  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Update WPT test suite for intersection-observer
     4        https://bugs.webkit.org/show_bug.cgi?id=220403
     5
     6        Reviewed by Rob Buis.
     7
     8        Sync WPT intersection-observer tests with 5a3a1b414d32952355eae7c949c109424979b988.
     9
     10        * web-platform-tests/intersection-observer/cross-document-root-expected.txt: Added.
     11        * web-platform-tests/intersection-observer/cross-document-root.html: Added.
     12        * web-platform-tests/intersection-observer/explicit-root-different-document.tentative-expected.txt: Added.
     13        * web-platform-tests/intersection-observer/explicit-root-different-document.tentative.html: Added.
     14        * web-platform-tests/intersection-observer/intersection-ratio-ib-split.html:
     15        * web-platform-tests/intersection-observer/not-in-containing-block-chain.tentative-expected.txt: Added.
     16        * web-platform-tests/intersection-observer/not-in-containing-block-chain.tentative.html: Added.
     17        * web-platform-tests/intersection-observer/observer-attributes-expected.txt:
     18        * web-platform-tests/intersection-observer/observer-attributes.html:
     19        * web-platform-tests/intersection-observer/resources/cross-origin-child-iframe.sub.html:
     20        * web-platform-tests/intersection-observer/resources/same-origin-grand-child-iframe.html:
     21        * web-platform-tests/intersection-observer/same-document-with-document-root-expected.txt: Added.
     22        * web-platform-tests/intersection-observer/same-document-with-document-root.html: Added.
     23        * web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub.html:
     24        * web-platform-tests/intersection-observer/target-in-different-window.html:
     25        * web-platform-tests/intersection-observer/w3c-import.log:
     26
    1272021-01-06  Youenn Fablet  <youenn@apple.com>
    228
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/intersection-ratio-ib-split.html

    r265294 r271234  
    2727    assert_true(entries[0].isIntersecting, element.nodeName + ": Should be intersecting");
    2828    assert_equals(entries[0].intersectionRatio, 1, element.nodeName + ": Should be fully intersecting");
     29
     30    function assert_rects_equal(r1, r2, label) {
     31      assert_equals(r1.top, r2.top, label + ": top should be equal");
     32      assert_equals(r1.right, r2.right, label + ": right should be equal");
     33      assert_equals(r1.bottom, r2.bottom, label + ": bottom should be equal");
     34      assert_equals(r1.left, r2.left, label + ": left should be equal");
     35    }
     36
     37    assert_rects_equal(entries[0].boundingClientRect, element.getBoundingClientRect(), element.nodeName + ": boundingClientRect should match");
     38    assert_rects_equal(entries[0].intersectionRect, entries[0].boundingClientRect, element.nodeName + ": intersectionRect should match entry.boundingClientRect");
    2939  }
    3040}, "IntersectionObserver on an IB split gets the right intersection ratio");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-attributes-expected.txt

    r267647 r271234  
    11
    2 PASS Observer attribute getters.
     2FAIL Observer attribute getters. Failed to construct 'IntersectionObserver': rootMargin must be specified in pixels or percent.
    33PASS observer.root
    44PASS observer.thresholds
    55PASS observer.rootMargin
    6 PASS set observer.root
    7 PASS set observer.thresholds
    8 PASS set observer.rootMargin
    96
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html

    r257137 r271234  
    1616       "observer.rootMargin");
    1717
     18  observer = new IntersectionObserver(function(e) {}, {
     19    rootMargin: " ",
     20    threshold: []
     21  });
     22  test(function() { assert_array_equals(observer.thresholds, [0]) },
     23       "empty observer.thresholds");
     24  test(function() { assert_equals(observer.rootMargin, "0px 0px 0px 0px") },
     25       "whitespace observer.rootMargin");
     26
    1827  var rootDiv = document.getElementById("root");
    1928  observer = new IntersectionObserver(function(e) {}, {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/cross-origin-child-iframe.sub.html

    r257137 r271234  
    11<!DOCTYPE html>
    22<script src="/common/get-host-info.sub.js"></script>
    3 <iframe id="iframe"></iframe>
     3<iframe scrolling="no" frameborder="0" id="iframe"></iframe>
    44<script>
    55iframe.src =
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/same-origin-grand-child-iframe.html

    r257137 r271234  
    11<!DOCTYPE html>
    2 <div id="target"></div>
     2<!--
     3  target should be fully vertically in-viewport as 100px is way less than the
     4  default iframe height.
     5
     6  right: 0 makes sure that we're occluded by 8px by the intermediate iframe.
     7-->
     8<div id="target" style="width: 100px; height: 100px; position: absolute; right: 0"></div>
    39<script>
    410const observer = new IntersectionObserver(records => {
    5   window.top.postMessage(records[0].rootBounds, "*");
     11  if (records[0].isIntersecting) {
     12    let { rootBounds, intersectionRect } = records[0];
     13    window.top.postMessage({ rootBounds, intersectionRect }, "*");
     14  }
    615}, {});
    7 observer.observe(target);
     16observer.observe(document.getElementById("target"));
    817</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub.html

    r257137 r271234  
    66<script src="/common/get-host-info.sub.js"></script>
    77<script src="./resources/intersection-observer-test-utils.js"></script>
    8 <iframe id="iframe"></iframe>
     8<iframe scrolling="no" frameborder="0" id="iframe"></iframe>
    99<script>
    1010promise_test(async t => {
     
    1212    get_host_info().HTTP_NOTSAMESITE_ORIGIN + "/intersection-observer/resources/cross-origin-child-iframe.sub.html";
    1313
    14   const rootBounds = await new Promise(resolve => {
     14  const { rootBounds, intersectionRect } = await new Promise(resolve => {
    1515    window.addEventListener("message", event => resolve(event.data));
    1616  }, { once: true } );
     17
     18  // 300px = iframe viewport width
     19  // 8px = default body margin
     20  // (intersectionRect is in the coordinate space of the target iframe)
     21  assert_equals(intersectionRect.top, 8);
     22  assert_equals(intersectionRect.left, 200);
     23  assert_equals(intersectionRect.right, 300 - 8);
     24  assert_equals(intersectionRect.width, 100 - 8);
     25  assert_equals(intersectionRect.height, 100);
    1726
    1827  assert_equals(rootBounds.left, 0);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/target-in-different-window.html

    r257137 r271234  
    11<!DOCTYPE html>
    22<meta name="viewport" content="width=device-width,initial-scale=1">
     3<!--
     4  NOTE(emilio): This tests Chrome's behavior but it's not clear that's what the
     5  spec asks for, see https://github.com/w3c/IntersectionObserver/issues/456
     6-->
    37<script src="/resources/testharness.js"></script>
    48<script src="/resources/testharnessreport.js"></script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log

    r265294 r271234  
    1919/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/client-rect.html
    2020/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/containing-block.html
     21/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/cross-document-root.html
    2122/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/cross-origin-iframe.sub.html
    2223/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/disconnect.html
     
    2526/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/edge-inclusive-intersection.html
    2627/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html
     28/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/explicit-root-different-document.tentative.html
    2729/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/idlharness.window.js
    2830/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/iframe-no-root-with-wrapping-scroller.html
     
    3739/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/multiple-thresholds.html
    3840/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/nested-cross-origin-iframe.sub.html
     41/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/not-in-containing-block-chain.tentative.html
    3942/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html
    4043/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-callback-arguments.html
     
    4952/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-no-root.html
    5053/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-root.html
     54/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-with-document-root.html
    5155/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-zero-size-target.html
    5256/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub.html
Note: See TracChangeset for help on using the changeset viewer.