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 522150 f6690a972633487cbb8c5a3415bad810320d84a9
parent 522149 f62003f22992c78307a6d36deab204fb2f789f83
child 522151 48f705e0ae7ecb8b9af4d91516c8920532a279e4
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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>