Skip to content

Commit c772134

Browse files
committed
LibWeb: Make update_style() a no-op if there's no browsing context
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.
1 parent e452550 commit c772134

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Userland/Libraries/LibWeb/DOM/Document.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ static void update_style_recursively(DOM::Node& node)
445445

446446
void Document::update_style()
447447
{
448+
if (!browsing_context())
449+
return;
448450
update_style_recursively(*this);
449451
update_layout();
450452
}

0 commit comments

Comments
 (0)