haikuwebkit/LayoutTests/fast/repaint/iframe-on-subpixel-position...

54 lines
1.2 KiB
HTML
Raw Permalink Normal View History

Repaint issues when the login field collapses on music.apple.com https://bugs.webkit.org/show_bug.cgi?id=212101 <rdar://problem/62874369> Reviewed by Simon Fraser. Source/WebCore: RenderWidgets (e.g iframe) are painted on integral pixel boundaries. When we issue the repaints on such renderers, we need to make sure that the repaint rectangles are also snapped to integral pixel values. Currently trunk only covers the case when the renderer itself is positioned on a subpixel position (e.g when the containing block's content box has a non-integral position value). This patch ensures that we repaint the RenderWidgets properly when a non-direct ancestor puts the renderer on a subpixel position. Test: fast/repaint/iframe-on-subpixel-position.html * page/FrameView.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::computeVisibleRectInContainer const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::setContentsNeedDisplay): (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): * rendering/RenderObject.h: * testing/Internals.cpp: (WebCore::Internals::enableSubframeRepaintTracking): add subframe repaint tracking (WebCore::Internals::disableSubframeRepaintTracking): * testing/Internals.h: * testing/Internals.idl: LayoutTests: * fast/repaint/iframe-on-subpixel-position-expected.txt: Added. * fast/repaint/iframe-on-subpixel-position.html: Added. Canonical link: https://commits.webkit.org/225051@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-21 01:44:12 +00:00
<script>
function runRepaintTest() {
if (window.testRunner)
testRunner.waitUntilDone();
setTimeout(function() {
let shrink = document.getElementById("subpixel_iframe").contentDocument.getElementById("shrink");
if (!window.testRunner) {
setTimeout('shrink.style.height = "0px"', 100);
return;
}
testRunner.dumpAsText();
document.body.offsetTop;
internals.startTrackingRepaints();
shrink.style.height = "0px";
document.getElementById("subpixel_iframe").contentDocument.body.offsetHeight;
let layerTreeAsText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
internals.stopTrackingRepaints();
let pre = document.createElement('pre');
document.body.appendChild(pre);
pre.innerHTML = layerTreeAsText;
testRunner.notifyDone();
}, 0);
}
</script>
<style>
.container {
position: fixed;
left: 0px;
top: 0px;
padding: 0.5px;
}
</style>
<body>
<div class=container><div><iframe onload="runRepaintTest()" id=subpixel_iframe frameborder=no srcdoc="
<style>
body {
margin:0px;
}
div {
background-color: green;
height: 100px;
width: 100px;
}
</style>
<div id=shrink></div>">
</body>