Skip to content

Commit

Permalink
[composite-bgcolor-animation] Return empty result when PaintWorkletIn…
Browse files Browse the repository at this point in the history
…put not found

The root cause of the problem is that there is an early exit in the
DiscardableImageMap::GatherDiscardableImages(), happening when the
paint rect for the op is empty. This makes sense because there is
nothing to draw.

Note that this is different than the empty element case. In fact,
we already have "background-color-animation-zero-size-element.html"
under css-backgrounds/animations/ and there is no problem with that.
The bug happens when the element is not empty, but its intersection
with the SkCanvas that it draws into is empty. Please see the notes
in this doc for more details:
https://docs.google.com/document/d/1Da9d7ai5xt4nPX7NDZnqaaTSoFitRSeYxw1qxGjtdeQ/edit

The |PaintWorkletImageProvider::records_| contains the records for
all the discardable images that can draw. Meaning that the ones that
early exits won't be included in the |records_|. But, when the
PaintWorkletImageProvider::GetPaintRecordResult() is called, the
input parameter |PaintWorkletInput| would contain all possible
PaintWorkletInput that is passed from Blink to CC, which obviously
contains the ones that cannot draw. As a result, these
PaintWorkletInputs won't exists in the |records_|.

We handle these cases by returning an empty record because there
is nothing to draw (like empty container cases).

Bug: 1216210
Change-Id: I9630aa4b55fd1322f641f42b05c20aab8c7234c7
  • Loading branch information
xidachen authored and chromium-wpt-export-bot committed Jun 18, 2021
1 parent 8a1c240 commit f60fbeb
Showing 1 changed file with 16 additions and 0 deletions.
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#background-color">
<style>
@keyframes bgcolor {

0% { background: blue; }
100% { background: none; }
}
.target {
animation: bgcolor 50ms;
opacity: 0.9;
height: 0.4px;
margin: 21.6px;
}
</style>
<div class="target"></div>

0 comments on commit f60fbeb

Please sign in to comment.