mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
LibWeb: Add a 1-entry lookup cache to FormattingState
This makes repeated lookups of the state for the same box much faster by bypassing the HashMap.
This commit is contained in:
parent
e7370443f2
commit
83a6be593c
2 changed files with 39 additions and 16 deletions
|
@ -111,6 +111,13 @@ struct FormattingState {
|
|||
|
||||
FormattingState const* m_parent { nullptr };
|
||||
FormattingState const& m_root;
|
||||
|
||||
struct LookupCache {
|
||||
NodeWithStyleAndBoxModelMetrics const* box { nullptr };
|
||||
NodeState* state { nullptr };
|
||||
bool is_mutable { false };
|
||||
};
|
||||
LookupCache m_lookup_cache;
|
||||
};
|
||||
|
||||
Gfx::FloatRect absolute_content_rect(Box const&, FormattingState const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue