Fix backdrop-filter with invalid mask image issue #57084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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}