Skip to content

Commit e07b5f3

Browse files
noamrchromium-wpt-export-bot
authored andcommitted
Avoid cyclic insertion in adoption agency
Cyclic insertion can happen due to iframe pagehide, when the iframe is removed during the adoption agency algorithm. Separate the removal from the insertion, and check for cyclic references *after* the removal. See whatwg/html#10194 and whatwg/html#12708 Bug: 547963403 Change-Id: Ib37ca63359ecfc9f8bce86a69be6eada62d8abb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8261279 Commit-Queue: Noam Rosenthal <[email protected]> Reviewed-by: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1688198}
1 parent fb24b8b commit e07b5f3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Adoption agency algorithm with circular DOM mutation</title>
4+
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm">
5+
<div id="common-ancestor">
6+
<b id="formatting-element">
7+
<p id="furthest-block">
8+
<iframe id="trap-frame"></iframe>
9+
<script>
10+
let frame = document.getElementById('trap-frame');
11+
frame.contentWindow.onpagehide = () => {
12+
const ca = document.getElementById('common-ancestor');
13+
const fb = document.getElementById('furthest-block');
14+
fb.remove();
15+
fb.appendChild(ca);
16+
};
17+
</script>
18+
</b>
19+
</p>
20+
</div>

0 commit comments

Comments
 (0)