chromium/third_party/blink/web_tests/fast/html/hidden-until-found-attr-usecounter.html

<!DOCTYPE html>
<link rel=author href="mailto:[email protected]">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<body>
<script>
test(() => {
  assert_false(internals.isUseCounted(document, 4113),
    `hidden shouldn't be counted before the test.`);
  assert_false(internals.isUseCounted(document, 4114),
    `hidden=until-found shouldn't be counted before the test.`);

  const div = document.createElement('div');
  document.body.appendChild(div);
  div.setAttribute('hidden', 'until-found');
  div.getBoundingClientRect();

  assert_false(internals.isUseCounted(document, 4113),
    `hidden shouldn't be counted after the test.`);
  assert_true(internals.isUseCounted(document, 4114),
    `hidden=until-found should be counted after the test.`);
}, 'Verifies that setting the hidden=until-found attribute triggers the corresponding use counter.');
</script>