2007-03-07 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2007 01:29:17 +0000 (01:29 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2007 01:29:17 +0000 (01:29 +0000)
        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13002
          Incomplete repaint of inset outlines

        Test: fast/repaint/outline-inset.html

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

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

        Reviewed by Darin.

        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=13002
          Incomplete repaint of inset outlines

        * fast/repaint/outline-inset-expected.checksum: Added.
        * fast/repaint/outline-inset-expected.png: Added.
        * fast/repaint/outline-inset-expected.txt: Added.
        * fast/repaint/outline-inset.html: Added.

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

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

index edc10c501e98fe9ae4b770399f3fc2102dd84457..58d37133ba46268f0f8ae0716aee27f9f9109a0e 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-07  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=13002
+          Incomplete repaint of inset outlines
+
+        * fast/repaint/outline-inset-expected.checksum: Added.
+        * fast/repaint/outline-inset-expected.png: Added.
+        * fast/repaint/outline-inset-expected.txt: Added.
+        * fast/repaint/outline-inset.html: Added.
+
 2007-03-07  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/repaint/outline-inset-expected.checksum b/LayoutTests/fast/repaint/outline-inset-expected.checksum
new file mode 100644 (file)
index 0000000..f59f336
--- /dev/null
@@ -0,0 +1 @@
+3b8b6f6d6f2d760bcae3168c989dbd76
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/outline-inset-expected.png b/LayoutTests/fast/repaint/outline-inset-expected.png
new file mode 100644 (file)
index 0000000..45d6373
Binary files /dev/null and b/LayoutTests/fast/repaint/outline-inset-expected.png differ
diff --git a/LayoutTests/fast/repaint/outline-inset-expected.txt b/LayoutTests/fast/repaint/outline-inset-expected.txt
new file mode 100644 (file)
index 0000000..abd101d
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x318
+  RenderBlock {HTML} at (0,0) size 800x318
+    RenderBody {BODY} at (8,8) size 784x302
+      RenderBlock {DIV} at (0,0) size 222x142 [border: (1px solid #0000FF)]
+        RenderBlock {DIV} at (11,21) size 200x40 [bgcolor=#008080]
+          RenderBlock {DIV} at (10,0) size 180x40 [bgcolor=#C0C0C0]
+      RenderBlock (anonymous) at (0,142) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,160) size 222x142 [border: (1px solid #0000FF)]
+        RenderBlock {DIV} at (11,21) size 200x60 [bgcolor=#008080]
+          RenderBlock {DIV} at (10,0) size 180x60 [bgcolor=#C0C0C0]
diff --git a/LayoutTests/fast/repaint/outline-inset.html b/LayoutTests/fast/repaint/outline-inset.html
new file mode 100644 (file)
index 0000000..6628cfb
--- /dev/null
@@ -0,0 +1,30 @@
+<!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>
+    <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();">
+<div class="test">
+    <div style="background: teal; padding: 0; outline: solid red 4px; outline-offset: -5px;">
+        <div id="a" style="height: 60px; margin: 10px; background:silver;"></div>
+    </div>
+</div>
+<br>
+<div class="test">
+    <div style="background: teal; padding: 0; outline: solid red 4px; outline-offset: -5px;">
+        <div id="b" style="height: 40px; margin: 10px; background:silver;"></div>
+    </div>
+</div>
+</body>
+</html>
index 20f351c251426b181dad3d8ac67180589a7d5237..7971bd9904a14a71bea497839af9355f0be8db77 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-07  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=13002
+          Incomplete repaint of inset outlines
+
+        Test: fast/repaint/outline-inset.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+
 2007-03-07  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Antti.
index 3de3ae5fe98bfb095298d3770904adabf22b7bae..1616546ea2369dcdfa0f1d6bdc9f744ba4ebdec2 100644 (file)
@@ -1791,7 +1791,7 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const In
     int ow = style() ? style()->outlineSize() : 0;
     int width = abs(newOutlineBox.width() - oldOutlineBox.width());
     if (width) {
-        int borderWidth = max(borderRight(), max(style()->borderTopRightRadius().width(), style()->borderBottomRightRadius().width())) + ow;
+        int borderWidth = max(-style()->outlineOffset(), max(borderRight(), max(style()->borderTopRightRadius().width(), style()->borderBottomRightRadius().width()))) + ow;
         IntRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth,
             newOutlineBox.y(),
             width + borderWidth,
@@ -1804,7 +1804,7 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const In
     }
     int height = abs(newOutlineBox.height() - oldOutlineBox.height());
     if (height) {
-        int borderHeight = max(borderBottom(), max(style()->borderBottomLeftRadius().height(), style()->borderBottomRightRadius().height())) + ow;
+        int borderHeight = max(-style()->outlineOffset(), max(borderBottom(), max(style()->borderBottomLeftRadius().height(), style()->borderBottomRightRadius().height()))) + ow;
         IntRect bottomRect(newOutlineBox.x(),
             min(newOutlineBox.bottom(), oldOutlineBox.bottom()) - borderHeight,
             max(newOutlineBox.width(), oldOutlineBox.width()),