mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Add Document::invalidate_layout()
This function allows you to throw away the entire layout tree if that's something you want to do. It's certainly not super cheap to reconstruct, but hey, who am I to tell you what to do? :^)
This commit is contained in:
parent
90a53b3520
commit
1146ab0fae
2 changed files with 10 additions and 1 deletions
|
@ -196,14 +196,22 @@ URL Document::complete_url(const String& string) const
|
||||||
return m_url.complete_url(string);
|
return m_url.complete_url(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::force_layout()
|
void Document::invalidate_layout()
|
||||||
{
|
{
|
||||||
m_layout_root = nullptr;
|
m_layout_root = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Document::force_layout()
|
||||||
|
{
|
||||||
|
invalidate_layout();
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::layout()
|
void Document::layout()
|
||||||
{
|
{
|
||||||
|
if (!frame())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!m_layout_root) {
|
if (!m_layout_root) {
|
||||||
LayoutTreeBuilder tree_builder;
|
LayoutTreeBuilder tree_builder;
|
||||||
m_layout_root = tree_builder.build(*this);
|
m_layout_root = tree_builder.build(*this);
|
||||||
|
|
|
@ -106,6 +106,7 @@ public:
|
||||||
|
|
||||||
void layout();
|
void layout();
|
||||||
void force_layout();
|
void force_layout();
|
||||||
|
void invalidate_layout();
|
||||||
|
|
||||||
void update_style();
|
void update_style();
|
||||||
void update_layout();
|
void update_layout();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue