WebCore:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Jun 2006 23:17:09 +0000 (23:17 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Jun 2006 23:17:09 +0000 (23:17 +0000)
        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9388
          REGRESSION: outlines don't get erased when removed in some cases

        Test: fast/repaint/outline-shrinking.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setStyle): Always repaint with the old style if the outline is
        becoming narrower, even if we are going to relayout.

LayoutTests:

        Reviewed by Darin.

        - repaint test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9388
          REGRESSION: outlines don't get erased when removed in some cases

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

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

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

index 415024c51f4656f7f3bcdd6ae0f44815f3ba7b02..f9e1036d7a526a745740f7a1026247952ef20cb7 100644 (file)
@@ -1,3 +1,15 @@
+2006-06-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - repaint test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9388
+          REGRESSION: outlines don't get erased when removed in some cases
+
+        * fast/repaint/outline-shrinking-expected.checksum: Added.
+        * fast/repaint/outline-shrinking-expected.png: Added.
+        * fast/repaint/outline-shrinking-expected.txt: Added.
+        * fast/repaint/outline-shrinking.html: Added.
+
 2006-06-25  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/repaint/outline-shrinking-expected.checksum b/LayoutTests/fast/repaint/outline-shrinking-expected.checksum
new file mode 100644 (file)
index 0000000..98bdb79
--- /dev/null
@@ -0,0 +1,2 @@
+e87776b8c2bfc7fbeca2e5e6abbce941
+\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/outline-shrinking-expected.png b/LayoutTests/fast/repaint/outline-shrinking-expected.png
new file mode 100644 (file)
index 0000000..528641a
Binary files /dev/null and b/LayoutTests/fast/repaint/outline-shrinking-expected.png differ
diff --git a/LayoutTests/fast/repaint/outline-shrinking-expected.txt b/LayoutTests/fast/repaint/outline-shrinking-expected.txt
new file mode 100644 (file)
index 0000000..6a6db81
--- /dev/null
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x220
+  RenderBlock {HTML} at (0,0) size 800x220
+    RenderBody {BODY} at (8,16) size 784x196
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 104x18
+          text run at (0,0) width 104: "This is a test for "
+        RenderInline {I} at (0,0) size 752x36
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (104,0) size 348x18
+              text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9388"
+          RenderText {#text} at (452,0) size 752x36
+            text run at (452,0) width 4: " "
+            text run at (456,0) width 296: "REGRESSION: outlines don't get erased when"
+            text run at (0,18) width 146: "removed in some cases"
+        RenderText {#text} at (146,18) size 4x18
+          text run at (146,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 323x18
+          text run at (0,0) width 323: "There should be a green square and no trace of red."
+      RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (0,96) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/fast/repaint/outline-shrinking.html b/LayoutTests/fast/repaint/outline-shrinking.html
new file mode 100644 (file)
index 0000000..27c6705
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+       <script src="repaint.js" type="text/javascript"></script>
+       <script type="text/javascript">
+          function repaintTest()
+          {
+              var target = document.getElementById('t');
+           target.style.outline = 'none';
+           target.style.fontSize = '20px';  // make it a layout change rather than a repaint
+          }
+       </script>
+</head>
+<body onload="runRepaintTest();">
+    <p>
+        This is a test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9388">http://bugzilla.opendarwin.org/show_bug.cgi?id=9388</a>
+        REGRESSION: outlines don't get erased when removed in some cases</i>.
+    </p>
+    <p>
+        There should be a green square and no trace of red.
+    </p>
+    <hr>
+    <div id="t" style="background: green; font-size: 10px; outline: red dashed 4px; width: 100px; height: 100px;"></div>
+</body>
index 569ec33c6e7d58316d85a22811bb882095ab0abd..61632a421272a9e538047c7c90aa68db50347ce8 100644 (file)
@@ -1,3 +1,16 @@
+2006-06-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9388
+          REGRESSION: outlines don't get erased when removed in some cases
+
+        Test: fast/repaint/outline-shrinking.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::setStyle): Always repaint with the old style if the outline is
+        becoming narrower, even if we are going to relayout.
+
 2006-06-25  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
index 0ca2145bf27984ac6414852dc023a02d4fb726c7..34d948b9a860903867111d9bad3eda1cc387013e 100644 (file)
@@ -2048,8 +2048,7 @@ void RenderObject::setStyle(RenderStyle *style)
                 layer()->repaintIncludingDescendants();
                 if (!(m_style->clip() == style->clip()))
                     layer()->clearClipRects();
-            }
-            else if (d == RenderStyle::Repaint)
+            } else if (d == RenderStyle::Repaint || style->outlineSize() < m_style->outlineSize())
                 repaint();
         }