Skip to content

Commit 35254d1

Browse files
InvalidUsernameExceptiongmta
authored andcommitted
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.
1 parent 418f157 commit 35254d1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3854,12 +3854,10 @@ RefPtr<StyleValue const> Parser::parse_mask_value(TokenStream<ComponentValue>& t
38543854
mask_composites.append(mask_composite ? mask_composite.release_nonnull() : initial_mask_composite);
38553855
mask_modes.append(mask_mode ? mask_mode.release_nonnull() : initial_mask_mode);
38563856

3857-
if (!mask_origin && !mask_clip) {
3857+
if (!mask_origin)
38583858
mask_origin = initial_mask_origin;
3859-
mask_clip = initial_mask_clip;
3860-
} else if (!mask_clip) {
3859+
if (!mask_clip)
38613860
mask_clip = mask_origin;
3862-
}
38633861
mask_origins.append(mask_origin.release_nonnull());
38643862
mask_clips.append(mask_clip.release_nonnull());
38653863

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<style>
3+
body {
4+
mask: url(foo.png), url(bar.png) no-clip;
5+
}
6+
</style>

0 commit comments

Comments
 (0)