mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 01:32:14 -05:00
LibWeb: Only invalidate style & DOM version if attribute really changes
When setting an element attribute to the value it already had, we don't need to update style or invalidate anything that depends on the DOM version counter. This was a source of much pointless busywork.
This commit is contained in:
parent
ddbfac38b0
commit
7df4365e40
Notes:
github-actions[bot]
2024-09-08 07:46:29 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/7df4365e405 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1276
1 changed files with 4 additions and 2 deletions
|
@ -448,9 +448,11 @@ void Element::run_attribute_change_steps(FlyString const& local_name, Optional<S
|
|||
|
||||
// AD-HOC: Run our own internal attribute change handler.
|
||||
attribute_changed(local_name, old_value, value);
|
||||
invalidate_style_after_attribute_change(local_name);
|
||||
|
||||
document().bump_dom_tree_version();
|
||||
if (old_value != value) {
|
||||
invalidate_style_after_attribute_change(local_name);
|
||||
document().bump_dom_tree_version();
|
||||
}
|
||||
}
|
||||
|
||||
void Element::attribute_changed(FlyString const& name, Optional<String> const&, Optional<String> const& value)
|
||||
|
|
Loading…
Reference in a new issue