LibWeb: Cache the used CSS 'position' value on LayoutNodeWithStyle

This avoids having to query the StyleProperties hash map whenever we
need to know if an element is absolutely positioned. This was extremely
hot in interactive window resize profiles.
This commit is contained in:
Andreas Kling 2020-06-23 23:15:23 +02:00
commit 9b8464f455
Notes: sideshowbarker 2024-07-19 05:25:06 +09:00
4 changed files with 27 additions and 12 deletions

View file

@ -642,7 +642,7 @@ void LayoutBlock::place_block_level_non_replaced_element_in_normal_flow(LayoutBl
auto* relevant_sibling = block.previous_sibling();
while (relevant_sibling != nullptr) {
if (relevant_sibling->style().position() != CSS::Position::Absolute)
if (relevant_sibling->position() != CSS::Position::Absolute)
break;
relevant_sibling = relevant_sibling->previous_sibling();
}