mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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
|
@ -849,8 +849,8 @@ void TableFormattingContext::compute_table_height()
|
|||
for (size_t i = 0; i < cell.column_span; ++i)
|
||||
span_width += m_columns[cell.column_index + i].used_width;
|
||||
|
||||
auto width_of_containing_block = m_state.get(*cell.box->containing_block()).content_width();
|
||||
auto height_of_containing_block = m_state.get(*cell.box->containing_block()).content_height();
|
||||
auto width_of_containing_block = cell_state.containing_block_used_values()->content_width();
|
||||
auto height_of_containing_block = cell_state.containing_block_used_values()->content_height();
|
||||
|
||||
cell_state.padding_top = cell.box->computed_values().padding().top().to_px(cell.box, width_of_containing_block);
|
||||
cell_state.padding_bottom = cell.box->computed_values().padding().bottom().to_px(cell.box, width_of_containing_block);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue