REGRESSION (143483): overflow:hidden doesn't quash big repaints from text-indent: -9999px

https://bugs.webkit.org/show_bug.cgi?id=121137

Source/WebCore:

Reviewed by Ryosuke Niwa.

The change in r143483 made it so that negative text-indent gets added
to visual oveflow even when we have overflow:hidden, which is really bad
because it causes large repaints (and large layers) for a common-on-the-web
pattern.

Revert the change, and add a new test to make sure it doesn't regress.

I can't reproduce the bug it was trying to fix with the change reverted.

Tests: compositing/geometry/negative-text-indent-with-overflow-hidden-layer.html
       fast/repaint/negative-text-indent-with-overflow-hidden.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):

LayoutTests:

Reviewed by Ryosuke Niwa.

Text-based repaint test, and test for compositing layer geometry.

* compositing/geometry/negative-text-indent-with-overflow-hidden-layer-expected.txt: Added.
* compositing/geometry/negative-text-indent-with-overflow-hidden-layer.html: Added.
* fast/repaint/negative-text-indent-with-overflow-hidden-expected.txt: Added.
* fast/repaint/negative-text-indent-with-overflow-hidden.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 082bd052
2013-09-10 Simon Fraser <simon.fraser@apple.com>
REGRESSION (143483): overflow:hidden doesn't quash big repaints from text-indent: -9999px
https://bugs.webkit.org/show_bug.cgi?id=121137
Reviewed by Ryosuke Niwa.
Text-based repaint test, and test for compositing layer geometry.
* compositing/geometry/negative-text-indent-with-overflow-hidden-layer-expected.txt: Added.
* compositing/geometry/negative-text-indent-with-overflow-hidden-layer.html: Added.
* fast/repaint/negative-text-indent-with-overflow-hidden-expected.txt: Added.
* fast/repaint/negative-text-indent-with-overflow-hidden.html: Added.
2013-09-11 Chris Fleizach <cfleizach@apple.com>
AX: WebKit exposes AXTitleUIElement incorrectly on checkboxes and radio buttons
CONSOLE MESSAGE: line 38: ReferenceError: Can't find variable: runRepaintTest
Hidden Text
Hidden Text
(GraphicsLayer
(bounds 800.00 600.00)
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(children 2
(GraphicsLayer
(position 568.00 10.00)
(bounds 200.00 50.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 568.00 220.00)
(bounds 200.00 200.00)
(contentsOpaque 1)
(drawsContent 1)
)
)
)
)
)
<!DOCTYPE html>
<html>
<head>
<style>
.container {
position: relative;
margin: 10px;
left: 550px;
height: 200px;
width: 200px;
background-color: silver;
}
#target {
text-indent: -300px;
width: 200px;
height: 50px;
overflow: hidden;
background-color: green;
}
.composited {
-webkit-transform: translateZ(0);
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText(true);
function dumpLayers()
{
if (window.testRunner)
document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
}
window.addEventListener('load', dumpLayers, false);
</script>
</head>
<body onload="runRepaintTest();">
<div class="container">
<div class="composited" id="target">Hidden Text</div>
</div>
<div class="container composited">
<div id="target">Hidden Text</div>
</div>
<pre id="layers"></pre>
</body>
</html>
Hidden Text
(repaint rects
(rect 550 8 200 50)
(rect 550 8 200 50)
(rect 550 8 200 50)
)
<!DOCTYPE html>
<html>
<head>
<style>
.container {
position: absolute;
left: 550px;
height: 200px;
width: 200px;
background-color: silver;
}
#target {
text-indent: -300px;
width: 200px;
height: 50px;
overflow: hidden;
background-color: green;
}
#target.changed, #target:hover {
background-color: blue;
}
</style>
<script src="resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
document.getElementById('target').classList.add('changed');
}
</script>
</head>
<body onload="runRepaintTest();">
<div class="container">
<div id="target">Hidden Text</div>
</div>
</body>
</html>
2013-09-10 Simon Fraser <simon.fraser@apple.com>
REGRESSION (143483): overflow:hidden doesn't quash big repaints from text-indent: -9999px
https://bugs.webkit.org/show_bug.cgi?id=121137
Reviewed by Ryosuke Niwa.
The change in r143483 made it so that negative text-indent gets added
to visual oveflow even when we have overflow:hidden, which is really bad
because it causes large repaints (and large layers) for a common-on-the-web
pattern.
Revert the change, and add a new test to make sure it doesn't regress.
I can't reproduce the bug it was trying to fix with the change reverted.
Tests: compositing/geometry/negative-text-indent-with-overflow-hidden-layer.html
fast/repaint/negative-text-indent-with-overflow-hidden.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):
2013-09-10 Simon Fraser <simon.fraser@apple.com>
Optionally show visual and layout overflow rects in layer tree dumps
......@@ -1682,14 +1682,6 @@ void RenderBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeF
m_overflow->setLayoutClientAfterEdge(oldClientAfterEdge);
}
// Allow our overflow to catch cases where the caret in an empty editable element with negative text indent needs to get painted.
LayoutUnit textIndent = textIndentOffset();
if (textIndent < 0) {
LayoutRect clientRect(clientBoxRect());
LayoutRect rectToApply = LayoutRect(clientRect.x() + textIndent, clientRect.y(), clientRect.width() - min<LayoutUnit>(0, textIndent), clientRect.height());
addVisualOverflow(rectToApply);
}
// Add visual overflow from box-shadow and border-image-outset.
addVisualEffectOverflow();
......
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