Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrong layout while animating content in regions
https://bugs.webkit.org/show_bug.cgi?id=125086 Reviewed by David Hyatt. Source/WebCore: The region to layer and regions to layer mappings should be cleared when the region chain changes. Test: fast/regions/layers/region-removed-during-animation.html * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::invalidateRegions): Clear the two maps and flag them for recomputation. (WebCore::RenderFlowThread::cachedRegionForCompositedLayer): Assert that the returned region exists. LayoutTests: Add a test verifying the layout and painting of animated content inside regions is correct. * fast/regions/layers/region-removed-during-animation-expected.html: Added. * fast/regions/layers/region-removed-during-animation.html: Added. Canonical link: https://commits.webkit.org/149006@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
LayoutTests/fast/regions/layers/region-removed-during-animation-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,19 @@ | ||
<html> | ||
<head> | ||
<style> | ||
.content { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
|
||
position: relative; | ||
left: 300px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test for the bug <a href="https://bugs.webkit.org/show_bug.cgi?id=125086">125086</a>.</p> | ||
<p>You should see a green square scaling down and back. During the animation, it should shift to the left.</p> | ||
<div class="content"></div> | ||
</body> | ||
</html> |
60 changes: 60 additions & 0 deletions
60
LayoutTests/fast/regions/layers/region-removed-during-animation.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,60 @@ | ||
<html> | ||
<head> | ||
<style> | ||
.region { | ||
-webkit-flow-from: flow; | ||
width: 100px; | ||
} | ||
.content { | ||
-webkit-flow-into: flow; | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
|
||
-webkit-animation-name: spin; | ||
-webkit-animation-duration: 0.1s; | ||
-webkit-animation-timing-function: linear; | ||
} | ||
@-webkit-keyframes spin { | ||
from { -webkit-transform: rotateX(0deg); } | ||
to { -webkit-transform: rotateX(180deg); } | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test for the bug <a href="https://bugs.webkit.org/show_bug.cgi?id=125086">125086</a>.</p> | ||
<p>You should see a green square scaling down and back. During the animation, it should shift to the left.</p> | ||
<div id="region" class="region"></div> | ||
<div id="content" class="content"></div> | ||
<script type="text/javascript"> | ||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
var r = document.getElementById("region"); | ||
function remover() { | ||
document.body.removeChild(r); | ||
setTimeout(adder, 20); | ||
} | ||
|
||
function adder() { | ||
r.style.position = "relative"; | ||
r.style.left = "300px"; | ||
document.body.appendChild(r); | ||
} | ||
|
||
function animation_end() { | ||
setTimeout(done, 50); | ||
} | ||
|
||
function done() { | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
} | ||
|
||
var content = document.getElementById("content"); | ||
content.addEventListener("webkitAnimationEnd", animation_end, false); | ||
|
||
setTimeout(remover, 20); | ||
</script> | ||
</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
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