- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8032
REGRESSION: Focus ring not completely redrawn after a Delete changes its size
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintAfterLayoutIfNeeded): When an element changes size, the
delta rectangles that need to be invalidated must be inflated by the outline size to ensure
that the previous outline is erased, and the space where the new outline is to be drawn is
also invalidated. This behaviour is identical to the behaviour of borders that was fixed in
bug 6301.
* manual-tests/outline-repaint-glitch.html: Added. Manual testcase.
This is just an outline version of border-repaint-glitch.html
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13651
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-04-02 Graham Dennis <Graham.Dennis@gmail.com>
+
+ Reviewed by Darin.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8032
+ REGRESSION: Focus ring not completely redrawn after a Delete changes its size
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::repaintAfterLayoutIfNeeded): When an element changes size, the
+ delta rectangles that need to be invalidated must be inflated by the outline size to ensure
+ that the previous outline is erased, and the space where the new outline is to be drawn is
+ also invalidated. This behaviour is identical to the behaviour of borders that was fixed in
+ bug 6301.
+ * manual-tests/outline-repaint-glitch.html: Added. Manual testcase.
+ This is just an outline version of border-repaint-glitch.html
+
2006-04-02 Trey Matteson <trey@usa.net>
Reviewed by Maciej.
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<style type="text/css">
+ div.test { width: 200px; height: 120px; border: 1px solid blue; padding: 10px; }
+</style>
+</head>
+<body>
+<p><b>BUG ID:</b> <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8032">Bugzilla bug 8032</a> REGRESSION: Focus ring not completely redrawn after a Delete changes its size</p>
+
+<p> Note that this bug (and the test) are just outline versions of <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6301">Bugzilla bug 6301</a> and test <a href="border-repaint-glitch.html">border-repaint-glitch.html</a>
+
+<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b>
+Click each Test button once.
+</p>
+
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>
+The boxes will resize, maintaining their solid red rectangular outlines.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>
+The boxes will resize, but the outlines will break. The first box will be missing
+small segments from either side of its bottom outline. The second box will have
+small red horizontal segments protruding inwards from both sides of the outline,
+where the bottom outline was before.
+</p>
+
+<div class="test">
+ <button onclick="document.getElementById('a').style.height = '40px'">Test</button>
+ <div style="background: teal; padding: 0; outline: solid red 4px;">
+ <div id="a" style="height: 60px; margin: 10px; background:silver;"></div>
+ </div>
+</div>
+<br>
+<div class="test">
+ <button onclick="document.getElementById('b').style.height = '60px'">Test</button>
+ <div style="background: teal; padding: 0; outline: solid red 4px;">
+ <div id="b" style="height: 40px; margin: 10px; background:silver;"></div>
+ </div>
+</div>
+
+</body>
+</html>
// We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
// two rectangles (but typically only one).
+ int ow = style() ? style()->outlineSize() : 0;
int width = abs(newBounds.width() - oldBounds.width());
if (width)
- c->repaintViewRectangle(IntRect(kMin(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight(),
+ c->repaintViewRectangle(IntRect(kMin(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight() - ow,
newBounds.y(),
- width + borderRight(),
+ width + borderRight() + ow,
kMax(newBounds.height(), oldBounds.height())));
int height = abs(newBounds.height() - oldBounds.height());
if (height)
c->repaintViewRectangle(IntRect(newBounds.x(),
- kMin(newBounds.bottom(), oldBounds.bottom()) - borderBottom(),
+ kMin(newBounds.bottom(), oldBounds.bottom()) - borderBottom() - ow,
kMax(newBounds.width(), oldBounds.width()),
- height + borderBottom()));
+ height + borderBottom() + ow));
return false;
}