mirror of
https://github.com/servo/servo
synced 2026-05-11 17:37:21 +02:00
This change includes two related fixes for flakiness revealed by #42847. 1. When caching fonts, try harder to not re-cache a font. This could happen due to a race condition with the read-write lock on the font cache. This change improves memory usage in some cases as it prevents a font from being loaded twice. 2. Incorporate both the strut size and the block size contribution of a previously unused font in an inline container. Before the code was incorporating one or the other. In addition, *only* incorporate the block contribution of a previously unused font if its metrics meaningfully differ from the container's default font. This was the case triggered by failing to have the fix in part one of the change. Testing: This fixes flakiness in an internal WPT-style test. Fixes: #42908. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Luke Warlow <lwarlow@igalia.com>