mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Make Node::is_connected() O(1) via a cached flag
Previously this walked up the parent chain on every call, which shows up as a 2.5% item in the profile while watching YouTube videos. Cache an m_is_connected bit on Node instead, maintained by the DOM insertion and removal steps.
This commit is contained in:
parent
c3fb1be321
commit
e330d5b9ab
Notes:
github-actions[bot]
2026-04-16 06:27:33 +00:00
Author: https://github.com/awesomekling
Commit: e330d5b9ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8935
5 changed files with 25 additions and 14 deletions
|
|
@ -42,14 +42,14 @@ void HTMLStyleElement::children_changed(ChildrenChangedMetadata const& metadata)
|
|||
|
||||
void HTMLStyleElement::inserted()
|
||||
{
|
||||
update_a_style_block();
|
||||
Base::inserted();
|
||||
update_a_style_block();
|
||||
}
|
||||
|
||||
void HTMLStyleElement::removed_from(Node* old_parent, Node& old_root)
|
||||
{
|
||||
update_a_style_block();
|
||||
Base::removed_from(old_parent, old_root);
|
||||
update_a_style_block();
|
||||
}
|
||||
|
||||
void HTMLStyleElement::attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue