mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +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:
committed by
Andreas Kling
parent
77610db58c
commit
bdb67d2bcb
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user