mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Use a RwLock to cache inline_content_sizes() (#34232)
In order to support size keywords in block layout, we may need to call `inline_content_sizes()` in order to compute the min/max-content sizes. But this required a mutable reference in order the update the cache, and in various places we already had mutable references. So this switches the cache into a RwLock to avoid needing mutable refs. Note OnceCell wouldn't work because it's not thread-safe. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
c00804190c
commit
9102644470
9 changed files with 76 additions and 74 deletions
|
@ -171,7 +171,7 @@ where
|
|||
let non_replaced = NonReplacedFormattingContext {
|
||||
base_fragment_info: info.into(),
|
||||
style: info.style.clone(),
|
||||
content_sizes_result: None,
|
||||
content_sizes_result: Default::default(),
|
||||
contents: NonReplacedFormattingContextContents::Flow(
|
||||
block_formatting_context,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue