mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibHTML: Add Document::force_layout()
..for when you really need a layout to happen right now. Also, automatically repaint the layout root after layout.
This commit is contained in:
parent
d24164ac6a
commit
98ff8ef0cf
Notes:
sideshowbarker
2024-07-19 11:30:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/98ff8ef0cf2
2 changed files with 8 additions and 0 deletions
|
@ -181,6 +181,12 @@ URL Document::complete_url(const String& string) const
|
|||
return url;
|
||||
}
|
||||
|
||||
void Document::force_layout()
|
||||
{
|
||||
m_layout_root = nullptr;
|
||||
layout();
|
||||
}
|
||||
|
||||
void Document::layout()
|
||||
{
|
||||
if (!m_layout_root) {
|
||||
|
@ -188,6 +194,7 @@ void Document::layout()
|
|||
m_layout_root = tree_builder.build(*this);
|
||||
}
|
||||
m_layout_root->layout();
|
||||
m_layout_root->set_needs_display();
|
||||
}
|
||||
|
||||
void Document::update_style()
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
void set_visited_link_color(Color);
|
||||
|
||||
void layout();
|
||||
void force_layout();
|
||||
|
||||
void update_style();
|
||||
void update_layout();
|
||||
|
|
Loading…
Add table
Reference in a new issue