mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Extract device_pixels_per_css_pixel getter from loop
This reduces time spent in StyleComputer::compute_property_values() by ~10% when loading https://html.spec.whatwg.org/
This commit is contained in:
parent
df23b42b37
commit
0ec97eabab
Notes:
github-actions[bot]
2025-11-12 10:22:17 +00:00
Author: https://github.com/tcl3
Commit: 0ec97eabab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6788
Reviewed-by: https://github.com/Calme1709
Reviewed-by: https://github.com/gmta
1 changed files with 2 additions and 1 deletions
|
|
@ -2149,8 +2149,9 @@ void StyleComputer::compute_property_values(ComputedProperties& style, Optional<
|
|||
return style.property(property_id);
|
||||
};
|
||||
|
||||
auto device_pixels_per_css_pixel = m_document->page().client().device_pixels_per_css_pixel();
|
||||
style.for_each_property([&](PropertyID property_id, auto& specified_value) {
|
||||
auto const& computed_value = compute_value_of_property(property_id, specified_value, get_property_specified_value, computation_context, m_document->page().client().device_pixels_per_css_pixel());
|
||||
auto const& computed_value = compute_value_of_property(property_id, specified_value, get_property_specified_value, computation_context, device_pixels_per_css_pixel);
|
||||
|
||||
style.set_property_without_modifying_flags(property_id, computed_value);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue