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

        Reviewed by Darin Adler.

        Calling layoutTestController.layerTreeAsText() should update layout
        https://bugs.webkit.org/show_bug.cgi?id=41818

        Need to call updateLayout() before we check for any layers, not after,
        since layout will update compositing, and may create layers.

        * page/Frame.cpp:
        (WebCore::Frame::layerTreeAsText):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90e73d79
2010-07-09 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler.
Calling layoutTestController.layerTreeAsText() should update layout
https://bugs.webkit.org/show_bug.cgi?id=41818
Test cleanup to remove as many setTimeout() calls as possible, replacing them with
calls to display(), which is required for painting to happen, and therefore FrameView::setIsOverlapped()
to get called.
Remove some logic that checked whether both iframe and parent document is loaded, since the load event
fires only once the iframes are loaded.
* compositing/iframes/composited-parent-iframe.html:
* compositing/iframes/connect-compositing-iframe-delayed.html:
* compositing/iframes/connect-compositing-iframe.html:
* compositing/iframes/connect-compositing-iframe2.html:
* compositing/iframes/connect-compositing-iframe3.html:
* compositing/iframes/enter-compositing-iframe.html:
* compositing/iframes/iframe-copy-on-scroll.html:
* compositing/iframes/iframe-resize.html:
* compositing/iframes/iframe-src-change.html:
* compositing/iframes/leave-compositing-iframe.html:
* compositing/iframes/overlapped-iframe.html:
* compositing/iframes/scrolling-iframe.html:
2010-07-09 Kenneth Russell <kbr@google.com>
Reviewed by Nate Chapin.
......@@ -32,7 +32,7 @@
<body>
<!-- The parent document should be thrown into compositing mode by the iframe. -->
<iframe id="parent-iframe" src="resources/composited-subframe.html"></iframe>
<iframe src="resources/composited-subframe.html"></iframe>
<pre id="layers">Layer tree appears here in DRT.</pre>
</body>
......
......@@ -31,15 +31,15 @@
function doTest()
{
// Wait for a layer update.
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('box').className = 'composited';
if (window.layoutTestController) {
document.getElementById('iframe').contentDocument.body.offsetWidth; // update iframe layout
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 0);
}
window.addEventListener('load', doTest, false);
......
......@@ -32,8 +32,12 @@
// Called from subframe.
function testDone()
{
document.getElementById('parent-iframe').contentDocument.body.offsetWidth; // work around bug 41999.
if (window.layoutTestController)
layoutTestController.display();
if (window.layoutTestController) {
document.getElementById('parent-iframe').contentDocument.body.offsetWidth; // update iframe layout
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
......
......@@ -31,10 +31,12 @@
function doTest()
{
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('iframe').className = 'composited';
if (window.layoutTestController) {
document.getElementById('iframe').contentDocument.body.offsetWidth; // update iframe layout
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
......
......@@ -25,10 +25,12 @@
function doTest()
{
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('iframe').className = 'composited';
if (window.layoutTestController) {
document.getElementById('iframe').contentDocument.body.offsetWidth; // update iframe layout
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
......
......@@ -31,13 +31,12 @@
// Called from subframe.
function testDone()
{
// Wait for a layer update.
window.setTimeout(function() {
if (window.layoutTestController) {
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 0);
document.getElementById('parent-iframe').contentDocument.body.offsetWidth; // work around bug 41999.
if (window.layoutTestController) {
layoutTestController.display();
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}
</script>
</head>
......
......@@ -16,20 +16,6 @@
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var loadedCount = 0;
function frameLoaded()
{
if (++loadedCount == 2)
doTest();
}
function pageLoaded()
{
if (++loadedCount == 2)
doTest();
}
function doTest()
{
// Need to wait for compositing layers to be updated.
......@@ -40,13 +26,13 @@
}, 0);
}
window.addEventListener('load', pageLoaded, false);
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<p>In pixel results, the blue box should be scrolled out of view.</p>
<div class="container">
<iframe id="iframe" src="resources/subframe.html" style="width: 300px; height: 200px;" onload="frameLoaded()"></iframe>
<iframe id="iframe" src="resources/subframe.html" style="width: 300px; height: 200px;"></iframe>
</div>
<div class="composited">
</div>
......
......@@ -35,15 +35,18 @@
function doTest()
{
// Need to wait for compositing layers to be updated.
// For some reason this delay is required for AppKit to not short-circuit the display.
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('parent-iframe').className = 'bigger';
if (window.layoutTestController) {
document.body.offsetWidth; // force layout, because layerTreeAsText() doesn't.
layoutTestController.display();
document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 10);
}, 0);
}
window.addEventListener('load', doTest, false);
......
......@@ -30,16 +30,14 @@
function doTest()
{
// Wait for a layer update.
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('parent-iframe').src = "about:blank";
window.setTimeout(function() {
if (window.layoutTestController) {
if (window.layoutTestController) {
document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 0);
}, 50);
}
}
window.addEventListener('load', doTest, false);
......
......@@ -31,13 +31,14 @@
// Called from subframe.
function testDone()
{
// Wait for a layer update.
window.setTimeout(function() {
if (window.layoutTestController) {
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 0);
document.getElementById('parent-iframe').contentDocument.body.offsetWidth; // work around bug 41999.
if (window.layoutTestController)
layoutTestController.display();
if (window.layoutTestController) {
document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}
</script>
</head>
......
......@@ -30,8 +30,10 @@
function doTest()
{
// For some reason this delay is required for AppKit to not short-circuit the display.
window.setTimeout(function() {
if (window.layoutTestController) {
layoutTestController.display();
document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
......
......@@ -28,39 +28,28 @@
layoutTestController.waitUntilDone();
}
var loadedCount = 0;
function frameLoaded()
{
if (++loadedCount == 2)
doTest();
}
function pageLoaded()
{
if (++loadedCount == 2)
doTest();
}
function doTest()
{
// Need to wait for compositing layers to be updated.
// For some reason this delay is required for AppKit to not short-circuit the display.
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.display();
document.getElementById('parent-iframe').contentWindow.scrollTo(80, 80);
if (window.layoutTestController) {
document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
layoutTestController.notifyDone();
}
}, 10);
}, 0);
}
window.addEventListener('load', pageLoaded, false);
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<!-- Test scrolling in the iframe -->
<iframe id="parent-iframe" src="resources/large-composited-subframe.html" onload="frameLoaded()"></iframe>
<iframe id="parent-iframe" src="resources/large-composited-subframe.html"></iframe>
<div class="overlay">
</div>
......
2010-07-09 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler.
Calling layoutTestController.layerTreeAsText() should update layout
https://bugs.webkit.org/show_bug.cgi?id=41818
Need to call updateLayout() before we check for any layers, not after,
since layout will update compositing, and may create layers.
* page/Frame.cpp:
(WebCore::Frame::layerTreeAsText):
2010-07-09 Kenneth Russell <kbr@google.com>
Reviewed by Nate Chapin.
......@@ -1602,6 +1602,8 @@ IntRect Frame::tiledBackingStoreVisibleRect()
String Frame::layerTreeAsText() const
{
#if USE(ACCELERATED_COMPOSITING)
document()->updateLayout();
if (!contentRenderer())
return String();
......@@ -1609,8 +1611,6 @@ String Frame::layerTreeAsText() const
if (!rootLayer)
return String();
document()->updateLayout();
return rootLayer->layerTreeAsText();
#else
return String();
......
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