LibWeb/CSS: Do not crash when parsing some multi-layer mask shorthands

This fixes a silly bug where we would crash when parsing a multi-layer
mask shorthand property that contained the no-clip keyword but no value
for mask-origin.

Fixes a crash when parsing the CSS of https://www.browserbase.com/. The
site still has other, unrelated problems though.
This commit is contained in:
InvalidUsernameException 2025-10-29 00:01:43 +01:00 committed by Jelle Raaijmakers
parent 418f1575b0
commit 35254d17d1
2 changed files with 8 additions and 4 deletions

View File

@ -3854,12 +3854,10 @@ RefPtr<StyleValue const> Parser::parse_mask_value(TokenStream<ComponentValue>& t
mask_composites.append(mask_composite ? mask_composite.release_nonnull() : initial_mask_composite);
mask_modes.append(mask_mode ? mask_mode.release_nonnull() : initial_mask_mode);
if (!mask_origin && !mask_clip) {
if (!mask_origin)
mask_origin = initial_mask_origin;
mask_clip = initial_mask_clip;
} else if (!mask_clip) {
if (!mask_clip)
mask_clip = mask_origin;
}
mask_origins.append(mask_origin.release_nonnull());
mask_clips.append(mask_clip.release_nonnull());

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<style>
body {
mask: url(foo.png), url(bar.png) no-clip;
}
</style>