mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 07:49:05 +00:00
LibWeb/CSS: Implement mix-blend-mode
This adds support for the `mix-blend-mode` CSS property.
This commit is contained in:
parent
8575bddfe6
commit
0fe30886f5
Notes:
github-actions[bot]
2025-02-05 11:28:01 +00:00
Author: https://github.com/skyz1
Commit: 0fe30886f5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3267
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/konradekk
24 changed files with 311 additions and 57 deletions
|
@ -240,6 +240,11 @@ bool Node::establishes_stacking_context() const
|
|||
return true;
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/compositing/#mix-blend-mode
|
||||
// Applying a blendmode other than normal to the element must establish a new stacking context.
|
||||
if (computed_values().mix_blend_mode() != CSS::MixBlendMode::Normal)
|
||||
return true;
|
||||
|
||||
return computed_values().opacity() < 1.0f;
|
||||
}
|
||||
|
||||
|
@ -1039,6 +1044,9 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
|
|||
if (auto isolation = computed_style.isolation(); isolation.has_value())
|
||||
computed_values.set_isolation(isolation.value());
|
||||
|
||||
if (auto mix_blend_mode = computed_style.mix_blend_mode(); mix_blend_mode.has_value())
|
||||
computed_values.set_mix_blend_mode(mix_blend_mode.value());
|
||||
|
||||
propagate_style_to_anonymous_wrappers();
|
||||
|
||||
if (is<NodeWithStyleAndBoxModelMetrics>(this))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue