From dc8b49ab3b85d73d9a7088d87fa4af0dcf2a676d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=A1s=20Pe=C3=B1a=20Moreno?= Date: Thu, 18 Apr 2019 11:57:54 +0000 Subject: [PATCH] Bug 1540738 [wpt PR 15936] - [ElementTiming] Mimic FCP++ rect computations, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests [ElementTiming] Mimic FCP++ rect computations This CL changes ElementTiming rect computation to use a computation similar to that used by FCP++, but relative to the owning frame. The tests show that the new computation seems more accurate as they uncovered a problem with the SVG test: default SVG size is 300x150 so it was clipping the element inside. A test for rect coordinates relative to iframe is added. Bug: 879270, 943138 Change-Id: Ib8fa266bda76843fbf7ca07f82ac5bb245d52c4d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531503 Reviewed-by: Liquan (Max) Gu Reviewed-by: Mason Freed Reviewed-by: Chris Harrelson Commit-Queue: Nicolás Peña Moreno Cr-Commit-Position: refs/heads/master@{#645021} -- wpt-commits: 5570bb27d55420f0639dab2415e618afdb94a6f6 wpt-pr: 15936 --- ...serve-svg-image.html => image-clipped-svg.html} | 8 +++---- .../tests/element-timing/image-rect-iframe.html | 28 ++++++++++++++++++++++ .../tests/element-timing/observe-svg-image.html | 2 +- .../resources/iframe-with-square-sends-entry.html | 21 ++++++++++++++++ 4 files changed, 54 insertions(+), 5 deletions(-) copy testing/web-platform/tests/element-timing/{observe-svg-image.html => image-clipped-svg.html} (80%) create mode 100644 testing/web-platform/tests/element-timing/image-rect-iframe.html create mode 100644 testing/web-platform/tests/element-timing/resources/iframe-with-square-sends-entry.html diff --git a/testing/web-platform/tests/element-timing/observe-svg-image.html b/testing/web-platform/tests/element-timing/image-clipped-svg.html similarity index 80% copy from testing/web-platform/tests/element-timing/observe-svg-image.html copy to testing/web-platform/tests/element-timing/image-clipped-svg.html index f127152cf869..13c4a81a1e02 100644 --- a/testing/web-platform/tests/element-timing/observe-svg-image.html +++ b/testing/web-platform/tests/element-timing/image-clipped-svg.html @@ -1,6 +1,6 @@ -Element Timing: observe image inside SVG +Element Timing: observe image inside SVG with small dimensions @@ -15,8 +15,8 @@ async_test(function (t) { const pathname = window.location.href.substring(0, index) + '/resources/circle.svg'; checkElement(entry, pathname, 'my_svg', beforeRender); - // Assume viewport has size at least 200, so the element is fully visible. - checkRect(entry, [0, 200, 0, 200]); + // Image size is 200x200 but SVG size is 100x100 so it is clipped. + checkRect(entry, [0, 100, 0, 100]); }) ); observer.observe({entryTypes: ['element']}); @@ -28,6 +28,6 @@ body { margin: 0; } - + diff --git a/testing/web-platform/tests/element-timing/image-rect-iframe.html b/testing/web-platform/tests/element-timing/image-rect-iframe.html new file mode 100644 index 000000000000..da46d785a0b7 --- /dev/null +++ b/testing/web-platform/tests/element-timing/image-rect-iframe.html @@ -0,0 +1,28 @@ + + +Element Timing: check intersectionRect for element in iframe + + + + + +