Files
ladybird/Tests/LibWeb/Crash/Layout/style-propagation-for-long-continuation-chain.html
Jelle Raaijmakers d94906fa1a LibWeb: Only apply style for continuation nodes once
This fixes the very, _very_ slow loading of https://yzy-sply.com. The
`apply_style()` method also calls into this method recursively, so we
just need to call it once instead of once per node in the continuation
chain.
2025-02-05 14:34:21 +01:00

22 lines
776 B
HTML

<!DOCTYPE html>
<span></span>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Create a long continuation chain
const spanElm = document.querySelector('span');
for (let i = 0; i < 200; ++i) {
spanElm.appendChild(document.createTextNode('a'));
let divElm = document.createElement('div');
divElm.appendChild(document.createTextNode('b'));
spanElm.appendChild(divElm);
}
// Force layout
document.body.offsetWidth;
// Trigger style propagation. This does not necessarily crash, but it verifies that this action completes
// within reasonable time instead of hanging indefinitely.
document.body.style.fontSize = '10px';
});
</script>