diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-14 17:56:19 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-14 17:57:06 +0200 |
commit | 667b31746ab0eab143a5f3f67afea5777208d5b2 (patch) | |
tree | bdc80c3c31c01f1ca3f7d4b4999afc5e800b7bd3 /Libraries | |
parent | 61ef17b87ad7e8003184c9635c1ea34d106562ee (diff) | |
download | serenity-667b31746ab0eab143a5f3f67afea5777208d5b2.zip |
LibHTML: Rename Document's invalidate_{style,layout}() to update_foo()
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibHTML/DOM/Document.cpp | 12 | ||||
-rw-r--r-- | Libraries/LibHTML/DOM/Document.h | 6 | ||||
-rw-r--r-- | Libraries/LibHTML/DOM/HTMLImageElement.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibHTML/DOM/HTMLLinkElement.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibHTML/HtmlView.cpp | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/Libraries/LibHTML/DOM/Document.cpp b/Libraries/LibHTML/DOM/Document.cpp index 9c0586ec1c..48bbeec6e5 100644 --- a/Libraries/LibHTML/DOM/Document.cpp +++ b/Libraries/LibHTML/DOM/Document.cpp @@ -158,17 +158,17 @@ void Document::layout() m_layout_root->layout(); } -void Document::invalidate_style() +void Document::update_style() { m_layout_root = nullptr; - invalidate_layout(); + update_layout(); } -void Document::invalidate_layout() +void Document::update_layout() { layout(); - if (on_invalidate_layout) - on_invalidate_layout(); + if (on_layout_updated) + on_layout_updated(); } RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const @@ -202,6 +202,6 @@ void Document::set_hovered_node(Node* node) return; m_hovered_node = node; - invalidate_style(); + update_style(); } diff --git a/Libraries/LibHTML/DOM/Document.h b/Libraries/LibHTML/DOM/Document.h index 5c9b42fb9d..6898805377 100644 --- a/Libraries/LibHTML/DOM/Document.h +++ b/Libraries/LibHTML/DOM/Document.h @@ -67,9 +67,9 @@ public: void layout(); - void invalidate_style(); - void invalidate_layout(); - Function<void()> on_invalidate_layout; + void update_style(); + void update_layout(); + Function<void()> on_layout_updated; virtual bool is_child_allowed(const Node&) const override; diff --git a/Libraries/LibHTML/DOM/HTMLImageElement.cpp b/Libraries/LibHTML/DOM/HTMLImageElement.cpp index b2b8e33733..3d6a8d0ae4 100644 --- a/Libraries/LibHTML/DOM/HTMLImageElement.cpp +++ b/Libraries/LibHTML/DOM/HTMLImageElement.cpp @@ -30,7 +30,7 @@ void HTMLImageElement::load_image(const String& src) } m_bitmap = load_png_from_memory(data.data(), data.size()); - document().invalidate_layout(); + document().update_layout(); }); } diff --git a/Libraries/LibHTML/DOM/HTMLLinkElement.cpp b/Libraries/LibHTML/DOM/HTMLLinkElement.cpp index 194427ae6f..cc1529c325 100644 --- a/Libraries/LibHTML/DOM/HTMLLinkElement.cpp +++ b/Libraries/LibHTML/DOM/HTMLLinkElement.cpp @@ -29,7 +29,7 @@ void HTMLLinkElement::inserted_into(Node&) return; } document().add_sheet(*sheet); - document().invalidate_style(); + document().update_style(); }); } } diff --git a/Libraries/LibHTML/HtmlView.cpp b/Libraries/LibHTML/HtmlView.cpp index 06eeaa1187..71552ecdd3 100644 --- a/Libraries/LibHTML/HtmlView.cpp +++ b/Libraries/LibHTML/HtmlView.cpp @@ -42,12 +42,12 @@ void HtmlView::set_document(Document* document) return; if (m_document) - m_document->on_invalidate_layout = nullptr; + m_document->on_layout_updated = nullptr; m_document = document; if (m_document) { - m_document->on_invalidate_layout = [this] { + m_document->on_layout_updated = [this] { layout_and_sync_size(); update(); }; |