mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibWeb: Don't schedule style/layout updates in detached documents
There's no need to do any kind of style or layout work in documents that aren't attached to a browsing context.
This commit is contained in:
parent
d0076aaa24
commit
2fbcaadef0
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/awesomekling
Commit: 2fbcaadef0
Pull-request: https://github.com/SerenityOS/serenity/pull/23970
1 changed files with 6 additions and 0 deletions
|
@ -699,12 +699,18 @@ void Document::set_origin(HTML::Origin const& origin)
|
|||
|
||||
void Document::schedule_style_update()
|
||||
{
|
||||
if (!browsing_context())
|
||||
return;
|
||||
|
||||
// NOTE: Update of the style is a step in HTML event loop processing.
|
||||
HTML::main_thread_event_loop().schedule();
|
||||
}
|
||||
|
||||
void Document::schedule_layout_update()
|
||||
{
|
||||
if (!browsing_context())
|
||||
return;
|
||||
|
||||
// NOTE: Update of the layout is a step in HTML event loop processing.
|
||||
HTML::main_thread_event_loop().schedule();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue