diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index f526b195012..2613deeb648 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -271,6 +271,9 @@ pub struct StackingContext { /// things like preserve-3d. spatial_id: wr::SpatialId, + /// The clip chain id of this stacking context if it has one. Used for filter clipping. + clip_chain_id: Option, + /// The fragment that established this stacking context. initializing_fragment_style: Option>, @@ -330,11 +333,13 @@ impl StackingContext { fn create_descendant( &self, spatial_id: wr::SpatialId, + clip_chain_id: Option, initializing_fragment_style: ServoArc, context_type: StackingContextType, ) -> Self { Self { spatial_id, + clip_chain_id: clip_chain_id, initializing_fragment_style: Some(initializing_fragment_style), context_type, contents: vec![], @@ -348,6 +353,7 @@ impl StackingContext { pub(crate) fn create_root(wr: &wr::DisplayListBuilder, debug: &DebugOptions) -> Self { Self { spatial_id: wr::SpaceAndClipInfo::root_scroll(wr.pipeline_id).spatial_id, + clip_chain_id: None, initializing_fragment_style: None, context_type: StackingContextType::RealStackingContext, contents: vec![], @@ -430,6 +436,8 @@ impl StackingContext { return false; } + let clip_id = self.clip_chain_id.map(wr::ClipId::ClipChain); + // Create the filter pipeline. let current_color = style.clone_color(); let mut filters: Vec = effects @@ -455,7 +463,7 @@ impl StackingContext { LayoutPoint::zero(), // origin self.spatial_id, style.get_webrender_primitive_flags(), - None, // clip_chain_id + clip_id, style.get_used_transform_style().to_webrender(), effects.mix_blend_mode.to_webrender(), &filters, @@ -982,6 +990,7 @@ impl BoxFragment { let mut child_stacking_context = parent_stacking_context.create_descendant( containing_block.scroll_node_id.spatial_id, + Some(containing_block.clip_chain_id), self.style.clone(), context_type, ); diff --git a/tests/wpt/meta/css/filter-effects/blur-clip-stacking-context-001.html.ini b/tests/wpt/meta/css/filter-effects/blur-clip-stacking-context-001.html.ini deleted file mode 100644 index 7f5296515c2..00000000000 --- a/tests/wpt/meta/css/filter-effects/blur-clip-stacking-context-001.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[blur-clip-stacking-context-001.html] - expected: FAIL diff --git a/tests/wpt/meta/css/filter-effects/drop-shadow-clipped-001.html.ini b/tests/wpt/meta/css/filter-effects/drop-shadow-clipped-001.html.ini deleted file mode 100644 index fd9bd8fc327..00000000000 --- a/tests/wpt/meta/css/filter-effects/drop-shadow-clipped-001.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[drop-shadow-clipped-001.html] - expected: FAIL diff --git a/tests/wpt/meta/css/filter-effects/will-change-blur-filter-under-clip.html.ini b/tests/wpt/meta/css/filter-effects/will-change-blur-filter-under-clip.html.ini deleted file mode 100644 index c9667038f9d..00000000000 --- a/tests/wpt/meta/css/filter-effects/will-change-blur-filter-under-clip.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[will-change-blur-filter-under-clip.html] - expected: FAIL