retrievability.html (1588B)
1 <!DOCTYPE HTML> 2 <meta charset=utf-8> 3 <title>Element Timing: 'element' entries are not accessible via performance timeline</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="resources/element-timing-helpers.js"></script> 7 <script> 8 let img; 9 async_test(function (t) { 10 assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented"); 11 const beforeRender = performance.now(); 12 new PerformanceObserver( 13 t.step_func_done(function(entryList) { 14 assert_equals(entryList.getEntries().length, 1); 15 const entry = entryList.getEntries()[0]; 16 assert_equals(entry.entryType, 'element'); 17 assert_equals(entry.name, 'image-paint'); 18 19 const entriesByName = performance.getEntriesByName('image-paint', 'element'); 20 const entriesByType = performance.getEntriesByType('element'); 21 const allEntries = performance.getEntries(); 22 assert_equals(entriesByName.length, 0, 'Element Timing entry should not be retrievable by getEntriesByName'); 23 assert_equals(entriesByType.length, 0, 'Element Timing entry should not be retrievable by getEntriesByType'); 24 assert_equals(allEntries.filter(e => e.entryType === 'element').length, 0, 'Element Timing entry should not be retrievable by getEntries'); 25 }) 26 ).observe({type: 'element', buffered: true}); 27 }, 'Element Timing entries are not accessible via performance.getEntries*'); 28 </script> 29 <img src='resources/square100.png' elementtiming='my_image' id='my_id'/>