LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Dec 2006 16:09:23 +0000 (16:09 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Dec 2006 16:09:23 +0000 (16:09 +0000)
        Reviewed by Darin.

        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=10699
          div with border-radius does not redraw properly if element inside div is resized

        * fast/repaint/border-radius-repaint-expected.checksum: Added.
        * fast/repaint/border-radius-repaint-expected.png: Added.
        * fast/repaint/border-radius-repaint-expected.txt: Added.
        * fast/repaint/border-radius-repaint.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=10699
          div with border-radius does not redraw properly if element inside div is resized

        Test: fast/repaint/border-radius-repaint.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/border-radius-repaint-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/border-radius-repaint-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/border-radius-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/border-radius-repaint.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index e8dcf8b..84a9b8a 100644 (file)
@@ -1,3 +1,15 @@
+2006-12-28  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=10699
+          div with border-radius does not redraw properly if element inside div is resized
+
+        * fast/repaint/border-radius-repaint-expected.checksum: Added.
+        * fast/repaint/border-radius-repaint-expected.png: Added.
+        * fast/repaint/border-radius-repaint-expected.txt: Added.
+        * fast/repaint/border-radius-repaint.html: Added.
+
 2006-12-28  Rob Buis  <buis@kde.org>
 
         Reviewed by Mitz.
 2006-12-28  Rob Buis  <buis@kde.org>
 
         Reviewed by Mitz.
diff --git a/LayoutTests/fast/repaint/border-radius-repaint-expected.checksum b/LayoutTests/fast/repaint/border-radius-repaint-expected.checksum
new file mode 100644 (file)
index 0000000..2ca1f1c
--- /dev/null
@@ -0,0 +1 @@
+0d67e4306b6fd25957e0d828f060ffcf
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/border-radius-repaint-expected.png b/LayoutTests/fast/repaint/border-radius-repaint-expected.png
new file mode 100644 (file)
index 0000000..70923a8
Binary files /dev/null and b/LayoutTests/fast/repaint/border-radius-repaint-expected.png differ
diff --git a/LayoutTests/fast/repaint/border-radius-repaint-expected.txt b/LayoutTests/fast/repaint/border-radius-repaint-expected.txt
new file mode 100644 (file)
index 0000000..9dbf24d
--- /dev/null
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x378
+  RenderBlock {HTML} at (0,0) size 800x378
+    RenderBody {BODY} at (8,16) size 784x354
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 100x18
+          text run at (0,0) width 100: "Repaint test for "
+        RenderInline {I} at (0,0) size 777x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (100,0) size 301x18
+              text run at (100,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=10699"
+          RenderText {#text} at (401,0) size 777x36
+            text run at (401,0) width 4: " "
+            text run at (405,0) width 372: "div with border-radius does not redraw properly if element"
+            text run at (0,18) width 122: "inside div is resized"
+        RenderText {#text} at (122,18) size 4x18
+          text run at (122,18) width 4: "."
+      RenderBlock {DIV} at (0,52) size 222x142 [border: (1px solid #0000FF)]
+        RenderBlock {DIV} at (11,11) size 200x68 [bgcolor=#008080] [border: (4px solid #FF0000)]
+          RenderBlock {DIV} at (14,14) size 172x40 [bgcolor=#C0C0C0]
+      RenderBlock (anonymous) at (0,194) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,212) size 222x142 [border: (1px solid #0000FF)]
+        RenderBlock {DIV} at (11,11) size 200x88 [bgcolor=#008080] [border: (4px solid #FF0000)]
+          RenderBlock {DIV} at (14,14) size 172x60 [bgcolor=#C0C0C0]
diff --git a/LayoutTests/fast/repaint/border-radius-repaint.html b/LayoutTests/fast/repaint/border-radius-repaint.html
new file mode 100644 (file)
index 0000000..103180d
--- /dev/null
@@ -0,0 +1,34 @@
+<!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 { vertical-align: top; width: 200px; height: 120px; border: 1px solid blue; padding: 10px; }
+</style>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+       function repaintTest()
+       {
+           document.getElementById('a').style.height = '40px';
+           document.getElementById('b').style.height = '60px';
+       }
+    </script>
+</head>
+<body onload="runRepaintTest();">
+<p>
+    Repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=10699">http://bugs.webkit.org/show_bug.cgi?id=10699</a>
+    div with border-radius does not redraw properly if element inside div is resized</i>.
+</p>
+<div class="test">
+    <div style="background: teal; padding: 0; border: solid red 4px; -webkit-border-radius: 12px;">
+        <div id="a" style="height: 60px; margin: 10px; background:silver;"></div>
+    </div>
+</div>
+<br>
+<div class="test">
+    <div style="background: teal; padding: 0; border: solid red 4px; -webkit-border-radius: 12px;">
+        <div id="b" style="height: 40px; margin: 10px; background:silver;"></div>
+    </div>
+</div>
+</body>
+</html>
index 814ce05..3abfa0c 100644 (file)
@@ -1,3 +1,15 @@
+2006-12-28  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=10699
+          div with border-radius does not redraw properly if element inside div is resized
+
+        Test: fast/repaint/border-radius-repaint.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+
 2006-12-28  Darin Adler  <darin@apple.com>
 
         * loader/CachedImage.cpp: (WebCore::CachedImage::createImage):
 2006-12-28  Darin Adler  <darin@apple.com>
 
         * loader/CachedImage.cpp: (WebCore::CachedImage::createImage):
index ddf272b..316d6e5 100644 (file)
@@ -1765,17 +1765,21 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const In
     // two rectangles (but typically only one).
     int ow = style() ? style()->outlineSize() : 0;
     int width = abs(newBounds.width() - oldBounds.width());
     // two rectangles (but typically only one).
     int ow = style() ? style()->outlineSize() : 0;
     int width = abs(newBounds.width() - oldBounds.width());
-    if (width)
-        v->repaintViewRectangle(IntRect(min(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight() - ow,
+    if (width) {
+        int borderWidth = max(borderRight(), max(style()->borderTopRightRadius().width(), style()->borderBottomRightRadius().width())) + ow;
+        v->repaintViewRectangle(IntRect(newBounds.x() + min(newBounds.width(), oldBounds.width()) - borderWidth,
             newBounds.y(),
             newBounds.y(),
-            width + borderRight() + ow,
+            width + borderWidth,
             max(newBounds.height(), oldBounds.height())));
             max(newBounds.height(), oldBounds.height())));
+    }
     int height = abs(newBounds.height() - oldBounds.height());
     int height = abs(newBounds.height() - oldBounds.height());
-    if (height)
+    if (height) {
+        int borderHeight = max(borderBottom(), max(style()->borderBottomLeftRadius().height(), style()->borderBottomRightRadius().height())) + ow;
         v->repaintViewRectangle(IntRect(newBounds.x(),
         v->repaintViewRectangle(IntRect(newBounds.x(),
-            min(newBounds.bottom(), oldBounds.bottom()) - borderBottom() - ow,
+            min(newBounds.bottom(), oldBounds.bottom()) - borderHeight,
             max(newBounds.width(), oldBounds.width()),
             max(newBounds.width(), oldBounds.width()),
-            height + borderBottom() + ow));
+            height + borderHeight));
+    }
     return false;
 }
 
     return false;
 }