haikuwebkit/LayoutTests/tiled-drawing/fixed-background-scroll-rep...

55 lines
1.4 KiB
HTML
Raw Permalink Normal View History

Too much repainting on scrolling with fixed backgrounds https://bugs.webkit.org/show_bug.cgi?id=143637 rdar://problem/20245243 Reviewed by Darin Adler. Source/WebCore: FrameView::scrollContentsSlowPath() would repaint the entire viewport if there were any slow-repaint objects (those with background-attachment: fixed) and the contents were using compositing for scrolling. This is wrong; we only need to issue repaint for the slow-repaint renderers, and, if the frame is hosted in a compositing layer and not using compositing for scrolling, repaint that hosting layer. Tests: compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html compositing/repaint/iframes/compositing-iframe-scroll-repaint.html compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html * page/FrameView.cpp: (WebCore::FrameView::scrollContentsSlowPath): LayoutTests: Tests with various configurations of iframes and compositing, which dump layer trees with repaint rectangles. Also tiled-scrolling test that exercises the simple case. Put WebKit1-specific results in platform/mac-wk1, since they are very different from WK2 and other platforms, due to WK1-specific layer hosting and repaint behaviors. * compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt: Added. * compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html: Added. * compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: Added. * compositing/repaint/iframes/compositing-iframe-scroll-repaint.html: Added. * compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: Added. * compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html: Added. * compositing/repaint/iframes/resources/compositing-document.html: Added. * compositing/repaint/iframes/resources/compositing-fixed-background-document.html: Added. * compositing/repaint/iframes/resources/fixed-background-document.html: Added. * platform/mac-wk1/compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt: Added. * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: Added. * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: Added. * platform/mac-wk2/compositing/repaint/fixed-background-scroll-expected.txt: * platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint-expected.txt: Added. * platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html: Added. Canonical link: https://commits.webkit.org/161667@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-12 17:30:58 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 2000px;
}
#test {
height: 200px;
width: 250px;
border: 1px solid black;
background-image: linear-gradient(blue, green);
background-size: 100% 300px;
background-attachment: fixed;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function documentLoaded()
{
// Timeout is required to allow layers to paint before the scroll.
window.setTimeout(doTest, 0);
}
function doTest()
{
if (window.internals)
window.internals.startTrackingRepaints();
window.scrollTo(0, 100);
if (window.internals)
document.getElementById('repaintRects').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
if (window.testRunner)
testRunner.notifyDone();
}
window.addEventListener('load', documentLoaded, false);
</script>
</head>
<body>
<p>We should only repaint the bounds of the element with a fixed background.</p>
<div id="test"></div>
<pre id="repaintRects"></pre>
</body>
</html>