Fix CSS gradient invalidation when currentColor changes. #32221
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.
When checking whether to invalidate an item, we check if the old and new
backgrounds are “visually equal” by asking its type. However, gradients
would just check that all stops are specified equally, disregarding that
the old currentColor could be different from the new currentColor.
Thus, add a check that if the background depends on currentColor
(ie., it is a gradient that has currentColor as at least one stop),
and currentColor has changed, we need to invalidate the background.
Fixed: 595467
Change-Id: Ia2434aa90217352408791547f4c03a96265db909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3353486
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#955109}