mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibWeb: Use LayoutState::UsedValues::containing_block_used_values() more
Use this cached pointer to the containing block's used values when obviously possible. This avoids a hash lookup each time, and these hash lookups do show up in profiles.
This commit is contained in:
parent
77610db58c
commit
bdb67d2bcb
Notes:
github-actions[bot]
2024-09-13 14:00:05 +00:00
Author: https://github.com/awesomekling
Commit: bdb67d2bcb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1390
3 changed files with 15 additions and 22 deletions
|
@ -456,7 +456,7 @@ void BlockFormattingContext::compute_height(Box const& box, AvailableSpace const
|
|||
auto margins = box_state.margin_top + box_state.margin_bottom;
|
||||
|
||||
// 2. Let size be the size of the initial containing block in the block flow direction minus margins.
|
||||
auto size = m_state.get(*box.containing_block()).content_height() - margins;
|
||||
auto size = box_state.containing_block_used_values()->content_height() - margins;
|
||||
|
||||
// 3. Return the bigger value of size and the normal border box size the element would have
|
||||
// according to the CSS specification.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue