mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -449,8 +449,8 @@ impl HoistedAbsolutelyPositionedBox {
|
|||
let cbis = containing_block.size.inline;
|
||||
let cbbs = containing_block.size.block;
|
||||
let containing_block_writing_mode = containing_block.style.writing_mode;
|
||||
let mut absolutely_positioned_box = self.absolutely_positioned_box.borrow_mut();
|
||||
let context = &mut absolutely_positioned_box.context;
|
||||
let absolutely_positioned_box = self.absolutely_positioned_box.borrow();
|
||||
let context = &absolutely_positioned_box.context;
|
||||
let style = context.style().clone();
|
||||
let containing_block = &containing_block.into();
|
||||
let pbm = style.padding_border_margin(containing_block);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue