ladybird/Tests/LibWeb/Layout/input/getComputedStyle-on-unconnected-element.html
Andreas Kling 89ba7246dd LibWeb: Don't resolve CSS property values for unconnected elements
While it's possible to getComputedStyle() on an unconnected element,
the resulting object is not supposed to have any values, since we can't
resolve style without a document root anyway.

This fixes a crash on https://bandcamp.com
2023-05-10 17:27:07 +02:00

11 lines
No EOL
313 B
HTML

<!doctype html><style>
* { font: 20px SerenitySans; }
</style><script>
let fragment = document.createDocumentFragment()
let a = document.createElement("a")
fragment.appendChild(a)
let b = document.createElement("b")
a.appendChild(b)
window.getComputedStyle(b).display
</script>
This test passes if we don't crash.