2010-07-12 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Dan Bernstein.

        Need to do a layout when RenderLayers come and go because of compositing
        https://bugs.webkit.org/show_bug.cgi?id=42108

        If we create or destroy RenderLayers for reasons other than style changes
        (e.g. because of composited iframes or plugins), then we need to ensure
        that we do a layout.

        Test: compositing/iframes/layout-on-compositing-change.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::adjustStyleDifference):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ecf8ab4d
2010-07-12 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
Need to do a layout when RenderLayers come and go because of compositing
https://bugs.webkit.org/show_bug.cgi?id=42108
Test that has an iframe that leaves compositing mode, then hit-tests the iframe.
* compositing/iframes/layout-on-compositing-change-expected.txt: Added.
* compositing/iframes/layout-on-compositing-change.html: Added.
* compositing/iframes/resources/leave-compositing-subframe-click.html: Added.
2010-07-12 Albert J. Wong <ajwong@chromium.org>
Unreviewed, build fix
<!DOCTYPE html>
<html>
<head>
<style type="text/css" media="screen">
body {
overflow: hidden;
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
iframe {
border: 1px solid black;
height: 100px;
width: 100px;
}
.name {
overflow: hidden;
}
.overlay {
position: absolute;
width: 80px;
height: 50px;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.2);
}
#test.bigger {
font-size: 13pt;
}
.tester {
cursor: pointer;
height: 100px;
width: 10px;
background-color: green;
font-size: 24pt;
display: inline;
}
</style>
<script type="text/javascript">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
// Called from subframe.
function testDone()
{
if (window.eventSender) {
eventSender.mouseMoveTo(82, 52);
eventSender.mouseDown();
eventSender.mouseUp();
}
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function nodeClicked(node)
{
var result = document.getElementById('result');
if (node.id == 'target')
result.innerHTML = 'PASS: hit target node in iframe';
else
result.innerHTML = 'FAIL: hit some other node in iframe';
}
function doTest()
{
// Make a layout happen while the iframe is composited.
window.setTimeout(function() {
document.getElementById('test').className = 'bigger';
}, 0);
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<span id="test">Text</span>
<iframe id="iframe" src="resources/leave-compositing-subframe-click.html" scrolling="no"></iframe>
<div class="overlay"></div>
<div id="result">FAIL: did not get clicked callback from iframe. (This test must be run in DRT.)</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style type="text/css" media="screen">
body { background-color:silver }
.box {
height: 200px;
width: 200px;
margin: 10px;
padding: 5px;
background-color: blue;
cursor: pointer;
}
.composited {
-webkit-transform: translateZ(0);
}
</style>
<script type="text/javascript">
function doTest()
{
window.setTimeout(function() {
document.getElementById('target').className = 'box';
parent.testDone();
}, 50);
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div id="target" class="composited box" onmousedown="parent.nodeClicked(this)"></div>
</body>
</html>
2010-07-12 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
Need to do a layout when RenderLayers come and go because of compositing
https://bugs.webkit.org/show_bug.cgi?id=42108
If we create or destroy RenderLayers for reasons other than style changes
(e.g. because of composited iframes or plugins), then we need to ensure
that we do a layout.
Test: compositing/iframes/layout-on-compositing-change.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustStyleDifference):
2010-07-11 Eric Seidel <eric@webkit.org>
Reviewed by Darin Adler.
......@@ -1695,6 +1695,14 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign
else if (diff < StyleDifferenceRecompositeLayer)
diff = StyleDifferenceRecompositeLayer;
}
// The answer to requiresLayer() for plugins and iframes can change outside of the style system,
// since it depends on whether we decide to composite these elements. When the layer status of
// one of these elements changes, we need to force a layout.
if (diff == StyleDifferenceEqual && style() && isBoxModelObject()) {
if (hasLayer() != toRenderBoxModelObject(this)->requiresLayer())
diff = StyleDifferenceLayout;
}
#else
UNUSED_PARAM(contextSensitiveProperties);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment