LibWeb: Resolve relative lengths in @font-face using correct viewport

As with everywhere else we should be using the document rather than the
window's viewports.

Fixes #6467
This commit is contained in:
Callum Law 2025-10-15 20:55:58 +13:00 committed by Tim Ledbetter
commit 3708fc6aa7
Notes: github-actions[bot] 2025-10-16 09:28:48 +00:00
6 changed files with 92 additions and 1 deletions

View file

@ -77,7 +77,7 @@ ParsedFontFace ParsedFontFace::from_descriptors(CSSFontFaceDescriptors const& de
font_family = extract_font_name(*value);
ComputationContext computation_context {
.length_resolution_context = Length::ResolutionContext::for_window(*descriptors.parent_rule()->parent_style_sheet()->owning_document()->window())
.length_resolution_context = Length::ResolutionContext::for_document(*descriptors.parent_rule()->parent_style_sheet()->owning_document())
};
Optional<int> weight;