summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-14 10:39:39 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-14 10:39:57 +0100
commit3c9dcec44275d20bea1ac79ee64a4f213c152101 (patch)
tree4c8dcea3c1e266b2fc52f4efad5ed8ee3df52e00
parentdbfce38c90b2aa6851c1c83460c9bb9ab87ca774 (diff)
downloadserenity-3c9dcec44275d20bea1ac79ee64a4f213c152101.zip
LibWeb: Merge Document::layout() and Document::update_layout()
There is now only Document::update_layout().
-rw-r--r--Libraries/LibWeb/DOM/Document.cpp14
-rw-r--r--Libraries/LibWeb/DOM/Document.h1
-rw-r--r--Libraries/LibWeb/HTML/HTMLElement.cpp2
-rw-r--r--Libraries/LibWeb/Page/Frame.cpp2
-rw-r--r--Services/WebContent/PageHost.cpp2
5 files changed, 6 insertions, 15 deletions
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp
index 9e2f5afb28..100f78caba 100644
--- a/Libraries/LibWeb/DOM/Document.cpp
+++ b/Libraries/LibWeb/DOM/Document.cpp
@@ -287,7 +287,7 @@ void Document::attach_to_frame(Badge<Frame>, Frame& frame)
node.document_did_attach_to_frame(frame);
return IterationDecision::Continue;
});
- layout();
+ update_layout();
}
void Document::detach_from_frame(Badge<Frame>, Frame& frame)
@@ -376,10 +376,10 @@ void Document::invalidate_layout()
void Document::force_layout()
{
invalidate_layout();
- layout();
+ update_layout();
}
-void Document::layout()
+void Document::update_layout()
{
if (!frame())
return;
@@ -410,14 +410,6 @@ void Document::update_style()
update_layout();
}
-void Document::update_layout()
-{
- if (!frame())
- return;
-
- layout();
-}
-
RefPtr<Layout::Node> Document::create_layout_node(const CSS::StyleProperties*)
{
return adopt(*new Layout::InitialContainingBlockBox(*this, CSS::StyleProperties::create()));
diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h
index ae26b3defa..0dba6aed7b 100644
--- a/Libraries/LibWeb/DOM/Document.h
+++ b/Libraries/LibWeb/DOM/Document.h
@@ -117,7 +117,6 @@ public:
Color visited_link_color() const;
void set_visited_link_color(Color);
- void layout();
void force_layout();
void invalidate_layout();
diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp
index d0b590d541..317d4bc3ef 100644
--- a/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -113,7 +113,7 @@ String HTMLElement::inner_text()
StringBuilder builder;
// innerText for element being rendered takes visibility into account, so force a layout and then walk the layout tree.
- document().layout();
+ document().update_layout();
if (!layout_node())
return text_content();
diff --git a/Libraries/LibWeb/Page/Frame.cpp b/Libraries/LibWeb/Page/Frame.cpp
index 794a9fef2d..ba87cc815c 100644
--- a/Libraries/LibWeb/Page/Frame.cpp
+++ b/Libraries/LibWeb/Page/Frame.cpp
@@ -103,7 +103,7 @@ void Frame::set_size(const Gfx::IntSize& size)
return;
m_size = size;
if (m_document)
- m_document->layout();
+ m_document->update_layout();
}
void Frame::set_viewport_scroll_offset(const Gfx::IntPoint& offset)
diff --git a/Services/WebContent/PageHost.cpp b/Services/WebContent/PageHost.cpp
index 6dc8adcb3c..11641235eb 100644
--- a/Services/WebContent/PageHost.cpp
+++ b/Services/WebContent/PageHost.cpp
@@ -102,7 +102,7 @@ void PageHost::set_viewport_rect(const Gfx::IntRect& rect)
{
page().main_frame().set_size(rect.size());
if (page().main_frame().document())
- page().main_frame().document()->layout();
+ page().main_frame().document()->update_layout();
page().main_frame().set_viewport_scroll_offset(rect.location());
}