Bug 76334

Summary: Filters that CA can't handle don't affect descendant compositing layers.
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Chris Marrin <cmarrin>
Status: NEW    
Severity: Normal CC: dino, julian, krit, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 68469    
Attachments:
Description Flags
Testcase
none
Test case: two boxes with filter: url() and an SVG blur; the child of the right box has will-change: opacity
none
The test case in Safari 27.2, Safari Technology Preview 27.0 and Chrome 158, with the measured sigma
none
Test page for the measurements: one box, the case is set in the URL (?case=N) none

Simon Fraser (smfr)
Reported 2012-01-14 08:26:54 PST
Created attachment 122547 [details] Testcase A filter on a compositing layer doesn't affect child compositing layers, and should.
Attachments
Testcase (504 bytes, text/html)
2012-01-14 08:26 PST, Simon Fraser (smfr)
no flags
Test case: two boxes with filter: url() and an SVG blur; the child of the right box has will-change: opacity (1.87 KB, text/html)
2026-11-29 14:28 PST, julian
no flags
The test case in Safari 27.2, Safari Technology Preview 27.0 and Chrome 158, with the measured sigma (122.98 KB, image/png)
2026-11-29 14:29 PST, julian
no flags
Test page for the measurements: one box, the case is set in the URL (?case=N) (14.04 KB, text/html)
2026-11-29 14:29 PST, julian
no flags
Radar WebKit Bug Importer
Comment 1 2012-01-14 08:27:22 PST
julian
Comment 2 2026-11-29 14:28:53 PST

Created attachment 482640 [details]
Test case: two boxes with filter: url() and an SVG blur; the child of the right box has will-change: opacity

This still happens in Safari 27.2 (22625.2.8.11.9) and in Safari Technology Preview 27.0 (22627.1.8.19.1) on macOS 27.2.1, with an SVG filter that is applied with "filter: url()". Such a filter is not composited (see below), so I think it is the case that this bug describes.

TEST CASE (attachment blur-svg-child-layer.html, no script)
Two boxes with the same size and the same "filter: url(#blur)". The filter is an SVG filter with <feGaussianBlur stdDeviation="20">. The only difference: the child of the right box has "will-change: opacity".
Expected: both boxes have the same soft edges. Chrome 158 draws them like this.
Actual: the right box is sharp. The filter has no effect on the child (attachment blur-svg-child-layer-three-browsers.png).
Sigma on screen in CSS px from window captures: 20.1 x 20.1 for the left box and below 1 px for the right box, in Safari 27.2 and in the Technology Preview. Chrome 158: 19.9 x 20.3 and 19.9 x 20.0.

MEASUREMENTS (attachment blur-states.html; the number in the URL selects the case)
One box with "transform: scale(1.5, 2)" and "filter: url()" with <feGaussianBlur stdDeviation="40">. I fitted a box with two Gaussian edges to the brightness along both axes of the box in a window capture. Sigma on screen in CSS px, horizontal x vertical, expected 60 x 80:

  • No layer on the child (case 45): 58 x 79 in Safari 27.2 and in the Technology Preview.
  • "will-change: opacity" on the child (case 46): below 1 px in both browsers. No blur at all.
  • The same directly after load and 3.5 s later (case 47), and on a 1x and a 2x display (Safari 27.2).
  • Chrome 158: 60 x 80 without and 60 x 78 with the layer on the child.
  • Without a transform (cases 49 and 50): 39 x 39 without a layer on the child, expected 40 x 40. Below 1 px with "will-change: opacity" on the child. So the transform is not needed.
  • "transform: translateZ(0)" on the child in place of "will-change: opacity" (case 51): below 1 px.
  • "will-change: transform" on the filtered element itself and no layer on the child (case 52): 58 x 79. Then the filter works.
  • These three results are the same in both browsers.

WHAT I READ IN THE SOURCE (tag WebKit-7625.2.8.11.9, the version of Safari 27.2)

  • RenderLayerBacking::updateFilters() sets m_canCompositeFilters to false for a reference filter. So RenderLayer::shouldPaintWithFilters() stays true, and the filter is painted into the backing store of the filtered element.
  • The child has its own layer, so it is not painted into that backing store. The filter does not reach it.
  • For SVG content, RenderLayerCompositor::canBeComposited() has a test for this (isFlattenedByEnclosingSVGReferenceFilter()). I found no such test for an HTML element with a CSS reference filter.

Possibly related: bug 210587 (WPT css/filter-effects/filter-region-transformed-composited-child-001.html fails in WebKit).

Disclosure: the test pages, the capture analysis and the reading of the source code were done with an AI tool (Claude). I have read and checked this comment.

julian
Comment 3 2026-11-29 14:29:21 PST

Created attachment 482641 [details]
The test case in Safari 27.2, Safari Technology Preview 27.0 and Chrome 158, with the measured sigma

julian
Comment 4 2026-11-29 14:29:45 PST

Created attachment 482642 [details]
Test page for the measurements: one box, the case is set in the URL (?case=N)

Note You need to log in before you can comment on or make changes to this bug.