LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 20:29:41 +0000 (20:29 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 20:29:41 +0000 (20:29 +0000)
        Reviewed by Darin.

        - test for http://bugs.webkit.org/show_bug.cgi?id=10692
          REGRESSION (r14847): Unnecessary scrollbars with position:relative; and overflow:auto;

        * fast/overflow/position-relative-expected.checksum: Added.
        * fast/overflow/position-relative-expected.png: Added.
        * fast/overflow/position-relative-expected.txt: Added.
        * fast/overflow/position-relative.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=10692
          REGRESSION (r14847): Unnecessary scrollbars with position:relative; and overflow:auto;

        Test: fast/overflow/position-relative.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::lowestPosition): Add the relative position offset only
        if 'includeSelf' is true.
        (WebCore::RenderBox::rightmostPosition): Ditto.
        (WebCore::RenderBox::leftmostPosition): Ditto.
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::lowestPosition): Ditto.
        (WebCore::RenderFlow::rightmostPosition): Ditto.
        (WebCore::RenderFlow::leftmostPosition): Ditto.

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

LayoutTests/ChangeLog
LayoutTests/fast/overflow/position-relative-expected.checksum [new file with mode: 0644]
LayoutTests/fast/overflow/position-relative-expected.png [new file with mode: 0644]
LayoutTests/fast/overflow/position-relative-expected.txt [new file with mode: 0644]
LayoutTests/fast/overflow/position-relative.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderFlow.cpp

index 557a9f9..cdc7403 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Darin.
 
+        - test for http://bugs.webkit.org/show_bug.cgi?id=10692
+          REGRESSION (r14847): Unnecessary scrollbars with position:relative; and overflow:auto;
+
+        * fast/overflow/position-relative-expected.checksum: Added.
+        * fast/overflow/position-relative-expected.png: Added.
+        * fast/overflow/position-relative-expected.txt: Added.
+        * fast/overflow/position-relative.html: Added.
+
+2007-01-21  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
         - test for http://bugs.webkit.org/show_bug.cgi?id=10472
           REGRESSION: "add" method of <select> object does not put the <option> object in the correct position
 
diff --git a/LayoutTests/fast/overflow/position-relative-expected.checksum b/LayoutTests/fast/overflow/position-relative-expected.checksum
new file mode 100644 (file)
index 0000000..5711597
--- /dev/null
@@ -0,0 +1 @@
+6b0ecc73552409651fdf34f695a73063
\ No newline at end of file
diff --git a/LayoutTests/fast/overflow/position-relative-expected.png b/LayoutTests/fast/overflow/position-relative-expected.png
new file mode 100644 (file)
index 0000000..fc96c0b
Binary files /dev/null and b/LayoutTests/fast/overflow/position-relative-expected.png differ
diff --git a/LayoutTests/fast/overflow/position-relative-expected.txt b/LayoutTests/fast/overflow/position-relative-expected.txt
new file mode 100644 (file)
index 0000000..6b3c01f
--- /dev/null
@@ -0,0 +1,10 @@
+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
+layer at (-92,8) size 784x100 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
+  RenderBlock (relative positioned) {DIV} at (0,0) size 784x100
+layer at (8,8) size 100x100
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+    RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/fast/overflow/position-relative.html b/LayoutTests/fast/overflow/position-relative.html
new file mode 100644 (file)
index 0000000..f5fd161
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=10692</title>
+</head>
+<body>
+    <div style="position: relative; left: -100px;">
+        <div id="target" style="position: relative; left: 100px; width: 100px; overflow: auto; background-color: red;">
+            <div style="width: 100px; height: 100px; background-color: green;"></div>
+        </div>
+    </div>
+    <script>
+        document.getElementById("target").scrollLeft = "100";
+    </script>
+</body>
+</html>
index d847c1b..802d3f7 100644 (file)
@@ -2,6 +2,25 @@
 
         Reviewed by Darin.
 
+        - fix http://bugs.webkit.org/show_bug.cgi?id=10692
+          REGRESSION (r14847): Unnecessary scrollbars with position:relative; and overflow:auto;
+
+        Test: fast/overflow/position-relative.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::lowestPosition): Add the relative position offset only
+        if 'includeSelf' is true.
+        (WebCore::RenderBox::rightmostPosition): Ditto.
+        (WebCore::RenderBox::leftmostPosition): Ditto.
+        * rendering/RenderFlow.cpp:
+        (WebCore::RenderFlow::lowestPosition): Ditto.
+        (WebCore::RenderFlow::rightmostPosition): Ditto.
+        (WebCore::RenderFlow::leftmostPosition): Ditto.
+
+2007-01-21  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
         - fix http://bugs.webkit.org/show_bug.cgi?id=10472
           REGRESSION: "add" method of <select> object does not put the <option> object in the correct position
 
index de54211..e9cef74 100644 (file)
@@ -2410,7 +2410,7 @@ int RenderBox::lowestPosition(bool includeOverflowInterior, bool includeSelf) co
     if (!includeSelf || !m_width)
         return 0;
     int bottom = m_height;
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         bottom += relativePositionOffsetY();
     return bottom;
 }
@@ -2420,7 +2420,7 @@ int RenderBox::rightmostPosition(bool includeOverflowInterior, bool includeSelf)
     if (!includeSelf || !m_height)
         return 0;
     int right = m_width;
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         right += relativePositionOffsetX();
     return right;
 }
@@ -2430,7 +2430,7 @@ int RenderBox::leftmostPosition(bool includeOverflowInterior, bool includeSelf)
     if (!includeSelf || !m_height)
         return m_width;
     int left = 0;
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         left += relativePositionOffsetX();
     return left;
 }
index 61e6b6b..4fc2262 100644 (file)
@@ -522,7 +522,7 @@ int RenderFlow::lowestPosition(bool includeOverflowInterior, bool includeSelf) c
         }
     }
 
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         bottom += relativePositionOffsetY();         
 
     return bottom;
@@ -546,7 +546,7 @@ int RenderFlow::rightmostPosition(bool includeOverflowInterior, bool includeSelf
         }
     }
 
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         right += relativePositionOffsetX();
 
     return right;
@@ -570,7 +570,7 @@ int RenderFlow::leftmostPosition(bool includeOverflowInterior, bool includeSelf)
         }
     }
 
-    if (isRelPositioned())
+    if (includeSelf && isRelPositioned())
         left += relativePositionOffsetX(); 
 
     return left;