Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Subpixel rendering: Animating HTML elements leaves trails when embedd…
…ed to a subpxiel positioned iframe. https://bugs.webkit.org/show_bug.cgi?id=139691 rdar://problem/19078958 Reviewed by Simon Fraser. This patch ensures that repaint rect and actual paint coordinate calculations are in sync. Source/WebCore: RenderWidget painting still snaps final coordinates to integral positions. We need to mimic the same snapping behaviour when the repaint rects are being calculated so that they are in sync with the final repaint rects. This is a workaround until after widgets get pushed to device pixel positions. Test: fast/repaint/hidpi-content-inside-iframe-leaves-trails.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeRectForRepaint): * rendering/RenderView.cpp: (WebCore::RenderView::repaintViewRectangle): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): LayoutTests: * fast/repaint/hidpi-content-inside-iframe-leaves-trails-expected.txt: Added. * fast/repaint/hidpi-content-inside-iframe-leaves-trails.html: Added. Canonical link: https://commits.webkit.org/157612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
109 additions
and 13 deletions.
- +13 −0 LayoutTests/ChangeLog
- +5 −0 LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails-expected.txt
- +53 −0 LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails.html
- +24 −0 Source/WebCore/ChangeLog
- +6 −2 Source/WebCore/rendering/RenderBox.cpp
- +4 −5 Source/WebCore/rendering/RenderView.cpp
- +4 −6 Source/WebCore/rendering/RenderWidget.cpp
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
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
@@ -0,0 +1,5 @@ | ||
PASS repaintRects.indexOf('rect 0 0 101 100') is not -1 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This tests that subpixel positioned iframe content's repaint rect is properly calculated.</title> | ||
<script>jsTestIsAsync = true;</script> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
<script> | ||
if (window.testRunner && window.internals) { | ||
testRunner.dumpAsText(false); | ||
internals.startTrackingRepaints(); | ||
} | ||
|
||
var repaintRects; | ||
function test() { | ||
setTimeout(function() { | ||
var iframeDocument = window.frames["embeddedFrame"].document; | ||
iframeDocument.getElementById("foo").style.left = "50px"; | ||
iframeDocument.body.offsetWidth; | ||
if (window.testRunner && window.internals) { | ||
repaintRects = internals.repaintRectsAsText(); | ||
shouldNotBe("repaintRects.indexOf('rect 0 0 101 100')", "-1"); | ||
internals.stopTrackingRepaints(); | ||
finishJSTest(); | ||
} | ||
}, 10); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<iframe onload="test()" name="embeddedFrame" style="position:absolute; top: 0px; left: 0.4px; width: 200px; height: 200px" frameBorder=0; srcdoc=' | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
div { | ||
position: absolute; | ||
background: red; | ||
height: 100px; | ||
width: 100px; | ||
top: 0px; | ||
left: 0.7px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id=foo></div> | ||
</body> | ||
</html>'> | ||
</iframe> | ||
</body> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</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
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