Reviewed by Darin, landed by ap.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2006 14:42:23 +0000 (14:42 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2006 14:42:23 +0000 (14:42 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6301
          REGRESSION: Border repaint glitch

        * khtml/rendering/render_object.cpp:
        (RenderObject::repaintAfterLayoutIfNeeded): Repaint parts of the
        border that moved.
        * manual-tests/border-repaint-glitch.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@11872 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/khtml/rendering/render_object.cpp
WebCore/manual-tests/border-repaint-glitch.html [new file with mode: 0644]

index da155e8d72c2cfd8cfc163c07368810b38bc88b6..055b834b343cbbab2d21f079342c28b8c992e948 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-04  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin, landed by ap.
+        
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6301
+          REGRESSION: Border repaint glitch
+
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::repaintAfterLayoutIfNeeded): Repaint parts of the
+        border that moved.
+        * manual-tests/border-repaint-glitch.html: Added.
+
 2005-12-30  Kimmo Kinnunen  <kimmo.kinnunen@nokia.com>
 
         Reviewed by eseidel.
 2005-12-30  Kimmo Kinnunen  <kimmo.kinnunen@nokia.com>
 
         Reviewed by eseidel.
index d6a3cf9cabae3e08c5147d0ba0985a9c16f34d4b..fbe8f1f35f09f58279bca3048abf365f83dc7c86 100644 (file)
@@ -1442,16 +1442,16 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const QRect& oldBounds, const QRec
         // two rectangles (but typically only one).
         int width = abs(newBounds.width() - oldBounds.width());
         if (width)
         // two rectangles (but typically only one).
         int width = abs(newBounds.width() - oldBounds.width());
         if (width)
-            c->repaintViewRectangle(QRect(kMin(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()),
+            c->repaintViewRectangle(QRect(kMin(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight(),
                                     newBounds.y(), 
                                     newBounds.y(), 
-                                    width,
+                                    width + borderRight(),
                                     kMax(newBounds.height(), oldBounds.height())));
         int height = abs(newBounds.height() - oldBounds.height());
         if (height)
             c->repaintViewRectangle(QRect(newBounds.x(),
                                     kMax(newBounds.height(), oldBounds.height())));
         int height = abs(newBounds.height() - oldBounds.height());
         if (height)
             c->repaintViewRectangle(QRect(newBounds.x(),
-                                          kMin(newBounds.y() + newBounds.height(), oldBounds.y() + oldBounds.height()),
+                                          kMin(newBounds.y() + newBounds.height(), oldBounds.y() + oldBounds.height()) - borderBottom(),
                                           kMax(newBounds.width(), oldBounds.width()),
                                           kMax(newBounds.width(), oldBounds.width()),
-                                          height));
+                                          height + borderBottom()));
         return false;
     }
     return true;
         return false;
     }
     return true;
diff --git a/WebCore/manual-tests/border-repaint-glitch.html b/WebCore/manual-tests/border-repaint-glitch.html
new file mode 100644 (file)
index 0000000..a567af4
--- /dev/null
@@ -0,0 +1,42 @@
+<!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=6301">Bugzilla bug 6301</a> REGRESSION: Border repaint glitch</p>
+
+<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 borders.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
+The boxes will resize, but the borders will break. The first box will be missing
+small segments from either side of its bottom border. The second box will have
+small red horizontal segments protruding inwards from both sides of the border,
+where the bottom border was before.
+</p>
+
+<div class="test">
+    <button onclick="document.getElementById('a').style.height = '40px'">Test</button>
+    <div style="background: teal; padding: 0; border: 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; border: solid red 4px;">
+        <div id="b" style="height: 40px; margin: 10px; background:silver;"></div>
+    </div>
+</div>
+
+</body>
+</html>