Skip to content

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jan 8, 2026

According to https://drafts.fxtf.org/css-masking-1/#the-mask-image, an
invalid mask image should generate a transparent black mask layer that
hides the content. However, when backdrop-filter is used with invalid
mask images, the content is still created and rendered.

This change adds AllImagesAreInvalid() checking in
PaintPropertyTreeBuilder for elements with backdrop-filter. When an
element has both mask-image and backdrop-filter specified, but all mask
images are invalid (failed loads, invalid URLs, slow-loading, etc.),
PaintPropertyTreeBuilder directly checks this condition and sets
opacity=0, correctly hiding the element and its backdrop-filter as
required by the spec for invalid mask images.

The fix is guarded by the HandleInvalidMaskImageWithBackdropFilter
runtime feature flag as a killswitch.

Bug: 441547032
Change-Id: I77cd4907beb541325894eaa2a490401fbc1c05b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7004946
Reviewed-by: Philip Rogers <[email protected]>
Reviewed-by: Fredrik Söderquist <[email protected]>
Commit-Queue: Wangsong Jin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1566394}

According to https://drafts.fxtf.org/css-masking-1/#the-mask-image, an
invalid mask image should generate a transparent black mask layer that
hides the content. However, when backdrop-filter is used with invalid
mask images, the content is still created and rendered.

This change adds AllImagesAreInvalid() checking in
PaintPropertyTreeBuilder for elements with backdrop-filter. When an
element has both mask-image and backdrop-filter specified, but all mask
images are invalid (failed loads, invalid URLs, slow-loading, etc.),
PaintPropertyTreeBuilder directly checks this condition and sets
opacity=0, correctly hiding the element and its backdrop-filter as
required by the spec for invalid mask images.

The fix is guarded by the HandleInvalidMaskImageWithBackdropFilter
runtime feature flag as a killswitch.

Bug: 441547032
Change-Id: I77cd4907beb541325894eaa2a490401fbc1c05b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7004946
Reviewed-by: Philip Rogers <[email protected]>
Reviewed-by: Fredrik Söderquist <[email protected]>
Commit-Queue: Wangsong Jin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1566394}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 778927b into master Jan 8, 2026
23 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7004946 branch January 8, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants