fune/testing/web-platform/tests/css/css-paint-api/background-repeat-x.https.html
Xida Chen 251c4ce532 Bug 1567647 [wpt PR 17948] - [OT-PW] Implement DrawPattern, a=testonly
Automatic update from web-platform-tests
[OT-PW] Implement DrawPattern

Right now when we use CSS paint to paint the background-image, and have
background-repeat specified, our implementation cannot handle that
because PaintWorkletDeferredImage doesn't implement DrawPattern.
Currently the code path goes into the GeneratedImage::DrawPattern and
that cannot handle the off-thread case.

This CL implements DrawPattern for off-thread paint worklet, and two
layout tests are passing with it. Another layout test is added for
additional testing.

Bug: 957457
Change-Id: I707b4d8e47a6bcd747156e60f1860c1ecdae22e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1691090
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684594}

--

wpt-commits: 424c4b83cbbe7dd792e83eebfcaa84d6e0c5826e
wpt-pr: 17948
2019-08-09 20:31:30 +00:00

32 lines
771 B
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<link rel="match" href="background-repeat-x-ref.html">
<style>
.container {
width: 200px;
height: 200px;
}
#foo {
background: paint(foo) top left/50% 50% repeat-x;
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="foo" class="container"></div>
<script id="code" type="text/worklet">
registerPaint('foo', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 50, 50);
}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>
</body>
</html>