1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

LibWeb: Add CSS mask property and make it form a stacking context

This commit is contained in:
MacDue 2023-09-03 19:44:00 +01:00 committed by Andreas Kling
parent b69e8ee893
commit dc58b5f418
3 changed files with 45 additions and 0 deletions

View file

@ -184,6 +184,16 @@ bool Node::establishes_stacking_context() const
if (!computed_values().backdrop_filter().is_none())
return true;
// Element with any of the following properties with value other than none:
// - transform
// - filter
// - backdrop-filter
// - perspective
// - clip-path
// - mask / mask-image / mask-border
if (computed_values().mask().has_value())
return true;
return computed_values().opacity() < 1.0f;
}
@ -755,6 +765,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
else if (stroke_width->is_percentage())
computed_values.set_stroke_width(CSS::LengthPercentage { stroke_width->as_percentage().percentage() });
if (auto mask = computed_style.property(CSS::PropertyID::Mask); mask->is_url())
computed_values.set_mask(mask->as_url().url());
if (auto fill_rule = computed_style.fill_rule(); fill_rule.has_value())
computed_values.set_fill_rule(*fill_rule);