mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
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.
22 lines
776 B
HTML
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>
|