mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Add hook to HtmlView when a new document is set
This commit is contained in:
parent
391237a8e1
commit
51e79a2bbc
Notes:
sideshowbarker
2024-07-19 06:11:43 +09:00
Author: https://github.com/FalseHonesty
Commit: 51e79a2bbc
Pull-request: https://github.com/SerenityOS/serenity/pull/2349
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/linusg
2 changed files with 4 additions and 0 deletions
|
@ -89,6 +89,9 @@ void HtmlView::set_document(Document* new_document)
|
|||
|
||||
main_frame().set_document(new_document);
|
||||
|
||||
if (on_set_document)
|
||||
on_set_document(new_document);
|
||||
|
||||
if (new_document) {
|
||||
new_document->on_layout_updated = [this] {
|
||||
layout_and_sync_size();
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
Function<void(const URL&)> on_load_start;
|
||||
Function<void(const Gfx::Bitmap&)> on_favicon_change;
|
||||
Function<void(const URL&)> on_url_drop;
|
||||
Function<void(Document*)> on_set_document;
|
||||
|
||||
virtual bool accepts_focus() const override { return true; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue