Make HasBackground/Border flags monotonic
There's currently a bug where a transition on an element with appearance can cause these flags to disappear. This is because the cascade is applied (in full) _twice_ for style resolves where the base computed style optimization is not in use: the first apply produces the base computed style, and the second apply is the same as the first apply, except that it also includes animation effects. The problem is that the second apply can reset the flags if there's a transition (for example) for the property or properties to be set in the first apply round. For example, assume there's a regular declaration background-color:green. This causes HasAuthorBackground to be set after the first apply round. Then, in the second apply round, if there's an animation effect on background-color, then CascadeResolver::AuthorFlags will not have kBackground set, since transitions are not author declarations, and therefore the flag will be set back to false. Instead this CL makes the flags monotonic, such that we're not overwriting the flags later. This fixes a regression where artifacts are shown when transitioning UI elements. Note that it may seem weird that transition/animation declarations don't count as author declarations in this context, but this was done to match the old Blink behavior where transitions/animations also had no effect on the flags. Note also that the now-removed logic regarding Find/Reject/etc. in the if-statement is no longer needed. It was there because forced colors mode used a separate StyleCascade instance previously, which made matters a bit more complicated. However, this has since been changed, so the logic can be simplified. Bug: 1086732 Change-Id: I6e588a7e1d6805ab0a59a9a92bec0eb26e7120eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214552Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#772169}
Showing
Please register or sign in to comment