summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/details-add-summary.html
blob: 1b0062e43aaec84a5bafc096e759c96ca1240876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html class="reftest-wait">
<link rel=match href="details-add-summary-ref.html">
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://github.com/whatwg/html/pull/6466">

<!-- This test makes sure that new <summary> elements get rendered correctly
  when added to a <details> element. I ran into it when adding
  content-visibility:hidden to the second slot of <details>. -->

<script>
onload = () => {
  const newsummary = document.createElement('summary');
  newsummary.textContent = 'new summary';
  document.getElementById('detailsid').insertBefore(newsummary,
    document.getElementById('oldsummary'));

  document.documentElement.classList.remove('reftest-wait');
};
</script>

<details id=detailsid>
  <summary id=oldsummary>old summary</summary>
  details
</details>