Style is needed to lay out and paint a document, but we can't do either those when the document isn't attached to a browsing context.
@@ -445,6 +445,8 @@ static void update_style_recursively(DOM::Node& node)
void Document::update_style()
{
+ if (!browsing_context())
+ return;
update_style_recursively(*this);
update_layout();
}