mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix filter clipping caused by overflow: hidden
(#30517)
* Partially fix filter clipping * Clean up the logic * Update components/layout_2020/display_list/stacking_context.rs --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
5eed4e978c
commit
84dd447d9d
4 changed files with 10 additions and 7 deletions
|
@ -271,6 +271,9 @@ pub struct StackingContext {
|
||||||
/// things like preserve-3d.
|
/// things like preserve-3d.
|
||||||
spatial_id: wr::SpatialId,
|
spatial_id: wr::SpatialId,
|
||||||
|
|
||||||
|
/// The clip chain id of this stacking context if it has one. Used for filter clipping.
|
||||||
|
clip_chain_id: Option<wr::ClipChainId>,
|
||||||
|
|
||||||
/// The fragment that established this stacking context.
|
/// The fragment that established this stacking context.
|
||||||
initializing_fragment_style: Option<ServoArc<ComputedValues>>,
|
initializing_fragment_style: Option<ServoArc<ComputedValues>>,
|
||||||
|
|
||||||
|
@ -330,11 +333,13 @@ impl StackingContext {
|
||||||
fn create_descendant(
|
fn create_descendant(
|
||||||
&self,
|
&self,
|
||||||
spatial_id: wr::SpatialId,
|
spatial_id: wr::SpatialId,
|
||||||
|
clip_chain_id: Option<wr::ClipChainId>,
|
||||||
initializing_fragment_style: ServoArc<ComputedValues>,
|
initializing_fragment_style: ServoArc<ComputedValues>,
|
||||||
context_type: StackingContextType,
|
context_type: StackingContextType,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
spatial_id,
|
spatial_id,
|
||||||
|
clip_chain_id: clip_chain_id,
|
||||||
initializing_fragment_style: Some(initializing_fragment_style),
|
initializing_fragment_style: Some(initializing_fragment_style),
|
||||||
context_type,
|
context_type,
|
||||||
contents: vec![],
|
contents: vec![],
|
||||||
|
@ -348,6 +353,7 @@ impl StackingContext {
|
||||||
pub(crate) fn create_root(wr: &wr::DisplayListBuilder, debug: &DebugOptions) -> Self {
|
pub(crate) fn create_root(wr: &wr::DisplayListBuilder, debug: &DebugOptions) -> Self {
|
||||||
Self {
|
Self {
|
||||||
spatial_id: wr::SpaceAndClipInfo::root_scroll(wr.pipeline_id).spatial_id,
|
spatial_id: wr::SpaceAndClipInfo::root_scroll(wr.pipeline_id).spatial_id,
|
||||||
|
clip_chain_id: None,
|
||||||
initializing_fragment_style: None,
|
initializing_fragment_style: None,
|
||||||
context_type: StackingContextType::RealStackingContext,
|
context_type: StackingContextType::RealStackingContext,
|
||||||
contents: vec![],
|
contents: vec![],
|
||||||
|
@ -430,6 +436,8 @@ impl StackingContext {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let clip_id = self.clip_chain_id.map(wr::ClipId::ClipChain);
|
||||||
|
|
||||||
// Create the filter pipeline.
|
// Create the filter pipeline.
|
||||||
let current_color = style.clone_color();
|
let current_color = style.clone_color();
|
||||||
let mut filters: Vec<wr::FilterOp> = effects
|
let mut filters: Vec<wr::FilterOp> = effects
|
||||||
|
@ -455,7 +463,7 @@ impl StackingContext {
|
||||||
LayoutPoint::zero(), // origin
|
LayoutPoint::zero(), // origin
|
||||||
self.spatial_id,
|
self.spatial_id,
|
||||||
style.get_webrender_primitive_flags(),
|
style.get_webrender_primitive_flags(),
|
||||||
None, // clip_chain_id
|
clip_id,
|
||||||
style.get_used_transform_style().to_webrender(),
|
style.get_used_transform_style().to_webrender(),
|
||||||
effects.mix_blend_mode.to_webrender(),
|
effects.mix_blend_mode.to_webrender(),
|
||||||
&filters,
|
&filters,
|
||||||
|
@ -982,6 +990,7 @@ impl BoxFragment {
|
||||||
|
|
||||||
let mut child_stacking_context = parent_stacking_context.create_descendant(
|
let mut child_stacking_context = parent_stacking_context.create_descendant(
|
||||||
containing_block.scroll_node_id.spatial_id,
|
containing_block.scroll_node_id.spatial_id,
|
||||||
|
Some(containing_block.clip_chain_id),
|
||||||
self.style.clone(),
|
self.style.clone(),
|
||||||
context_type,
|
context_type,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[blur-clip-stacking-context-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[drop-shadow-clipped-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[will-change-blur-filter-under-clip.html]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue