2007-07-06 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2007 10:05:16 +0000 (10:05 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2007 10:05:16 +0000 (10:05 +0000)
        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=14487
          Incomplete repaint of background and border of boxes with -webkit-border-fit:lines

        Test: fast/repaint/border-fit-lines.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::repaintAfterLayoutIfNeeded): Do a full repaint if
        -webkit-border-fit:lines was specified.

2007-07-06  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Maciej.

        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=14487
          Incomplete repaint of background and border of boxes with -webkit-border-fit:lines

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

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

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

index 07dd59b..2d803e0 100644 (file)
@@ -1,3 +1,15 @@
+2007-07-06  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Maciej.
+
+        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=14487
+          Incomplete repaint of background and border of boxes with -webkit-border-fit:lines
+
+        * fast/repaint/border-fit-lines-expected.checksum: Added.
+        * fast/repaint/border-fit-lines-expected.png: Added.
+        * fast/repaint/border-fit-lines-expected.txt: Added.
+        * fast/repaint/border-fit-lines.html: Added.
+
 2007-07-06  Tony Chang  <idealisms@gmail.com>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/fast/repaint/border-fit-lines-expected.checksum b/LayoutTests/fast/repaint/border-fit-lines-expected.checksum
new file mode 100644 (file)
index 0000000..db57283
--- /dev/null
@@ -0,0 +1 @@
+54588d8fd599963b94cbd2c8efc41a8f
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/border-fit-lines-expected.png b/LayoutTests/fast/repaint/border-fit-lines-expected.png
new file mode 100644 (file)
index 0000000..5120198
Binary files /dev/null and b/LayoutTests/fast/repaint/border-fit-lines-expected.png differ
diff --git a/LayoutTests/fast/repaint/border-fit-lines-expected.txt b/LayoutTests/fast/repaint/border-fit-lines-expected.txt
new file mode 100644 (file)
index 0000000..d8bda18
--- /dev/null
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 395x18
+          text run at (0,0) width 395: "This should be a 100\x{D7}100px green square with a black border:"
+      RenderBlock {DIV} at (0,18) size 784x104 [bgcolor=#008000] [border: (2px solid #000000)]
+        RenderBlock {DIV} at (2,2) size 100x10
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/repaint/border-fit-lines.html b/LayoutTests/fast/repaint/border-fit-lines.html
new file mode 100644 (file)
index 0000000..2ba2b2a
--- /dev/null
@@ -0,0 +1,18 @@
+<html>
+<head>
+    <script src="repaint.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        function repaintTest()
+        {
+            var div = document.getElementById("target");
+            div.style.width = '100px';
+        }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+    This should be a 100&times;100px green square with a black border:
+    <div style="height: 100px; -webkit-border-fit: lines; background: green; border: 2px solid black;">
+        <div id="target" style="display: inline-block; width: 10px; height: 10px;"></div>
+    </div>
+</body>
+</html>
index 08c7a7a..ff41fdc 100644 (file)
@@ -1,3 +1,16 @@
+2007-07-06  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Maciej.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=14487
+          Incomplete repaint of background and border of boxes with -webkit-border-fit:lines
+
+        Test: fast/repaint/border-fit-lines.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded): Do a full repaint if
+        -webkit-border-fit:lines was specified.
+
 2007-07-06  Tony Chang  <idealisms@gmail.com>
 
         Reviewed by Maciej.
index 8781f88..7b5ae71 100644 (file)
@@ -1782,11 +1782,12 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const In
     IntRect newOutlineBox;
 
     bool fullRepaint = selfNeedsLayout();
+    // Presumably a background or a border exists if border-fit:lines was specified.
+    if (!fullRepaint && style()->borderFit() == BorderFitLines)
+        fullRepaint = true;
     if (!fullRepaint) {
         newOutlineBox = absoluteOutlineBox();
-        if (newOutlineBox.location() != oldOutlineBox.location())
-            fullRepaint = true;
-        else if (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox))
+        if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
             fullRepaint = true;
     }
     if (fullRepaint) {