-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toggling visibility:hidden on the parent of a <canvas> can cause the …
…previous frame's contents to be shown. https://bugs.webkit.org/show_bug.cgi?id=274262 <rdar://128226178> Reviewed by Simon Fraser. We should only try to use 'copy' compositing mode to transfer the canvas buffer into the layer (and thus omit any pixel clearing) if there is visible content to copy. * LayoutTests/compositing/canvas/copy-backing-store-visibility-hidden-expected.html: Added. * LayoutTests/compositing/canvas/copy-backing-store-visibility-hidden.html: Added. * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Canonical link: https://commits.webkit.org/279302@main
- Loading branch information
1 parent
be37d4d
commit d611425
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
LayoutTests/compositing/canvas/copy-backing-store-visibility-hidden-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
43 changes: 43 additions & 0 deletions
43
LayoutTests/compositing/canvas/copy-backing-store-visibility-hidden.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<script> | ||
|
||
if (window.testRunner) { | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
async function doTest() { | ||
var canvasElement = document.getElementById("canvas"); | ||
|
||
let ctx = canvas.getContext('2d'); | ||
|
||
ctx.fillStyle = 'green'; | ||
ctx.fillRect(0, 0, 100, 100); | ||
|
||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
|
||
ctx.fillStyle = 'green'; | ||
ctx.fillRect(0, 0, 100, 100); | ||
|
||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
|
||
document.getElementById("parent").style.visibility = "hidden"; | ||
|
||
if (window.testRunner) { | ||
testRunner.notifyDone(); | ||
} | ||
} | ||
|
||
window.addEventListener('load', doTest, false); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div id="parent"> | ||
<canvas id="canvas"></canvas> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters