Before/after the document is attached to a frame, there's no point in doing any kind of layout, since we can't display the results anywhere.
@@ -187,6 +187,9 @@ void Document::update_style()
void Document::update_layout()
{
+ if (!frame())
+ return;
+
layout();
if (on_layout_updated)
on_layout_updated();