Bug 1528237 [wpt PR 15367] - [ElementTiming] Create entries for SVGImageElements, a=testonly
authorNicolas Pena <npm@chromium.org>
Tue, 05 Mar 2019 12:13:07 +0000
changeset 464532 641af081b5e6f38ac2d24d707f41de5cfb80ba81
parent 464531 1e4f678f8bf97200cb609a08342e3c70b3d00b8e
child 464533 e76df98e1ed41f7ebd15d6e7e237e7e6a438111c
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528237, 15367, 879270, 1467918, 631923
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528237 [wpt PR 15367] - [ElementTiming] Create entries for SVGImageElements, a=testonly Automatic update from web-platform-tests [ElementTiming] Create entries for SVGImageElements This change adds ElementTiming support for SVGImageElements. It adds a layout test to verify that the entry is being created in a simple example. Bug: 879270 Change-Id: I39ae0a1209f1b299d6a431ac1ba2fcfa94b25b3e Reviewed-on: https://chromium-review.googlesource.com/c/1467918 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#631923} -- wpt-commits: 679777df34300565db3d3dcca0f32424fb0472a0 wpt-pr: 15367
testing/web-platform/tests/element-timing/observe-svg-image.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/element-timing/observe-svg-image.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>Element Timing: observe image inside SVG</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/element-timing-helpers.js"></script>
+<script>
+let beforeRender;
+async_test(function (t) {
+  const observer = new PerformanceObserver(
+    t.step_func_done(function(entryList) {
+      assert_equals(entryList.getEntries().length, 1);
+      const entry = entryList.getEntries()[0];
+      checkElement(entry, 'my_svg', beforeRender);
+      // Assume viewport has size at least 200, so the element is fully visible.
+      checkRect(entry, [0, 200, 0, 200]);
+    })
+  );
+  observer.observe({entryTypes: ['element']});
+  beforeRender = performance.now();
+}, "Able to observe svg image.");
+</script>
+<style>
+body {
+  margin: 0;
+}
+</style>
+<svg>
+  <image href='resources/circle.svg' elementtiming='my_svg'/>
+</svg>