mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Remove a bunch of redundant Document::navigable() lookups
Document::navigable() can be unpleasantly slow, since we don't have a direct link between documents and navigables at the moment. So let's not call it twice when once is enough.
This commit is contained in:
parent
77d98b5697
commit
43c720db81
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/awesomekling
Commit: 43c720db81
Pull-request: https://github.com/SerenityOS/serenity/pull/23602
4 changed files with 21 additions and 14 deletions
|
@ -29,8 +29,9 @@ void HTMLTitleElement::initialize(JS::Realm& realm)
|
|||
void HTMLTitleElement::children_changed()
|
||||
{
|
||||
HTMLElement::children_changed();
|
||||
if (navigable() && navigable()->is_traversable()) {
|
||||
navigable()->traversable_navigable()->page().client().page_did_change_title(document().title().to_byte_string());
|
||||
auto navigable = this->navigable();
|
||||
if (navigable && navigable->is_traversable()) {
|
||||
navigable->traversable_navigable()->page().client().page_did_change_title(document().title().to_byte_string());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue