https://bugs.webkit.org/show_bug.cgi?id=60421
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 May 2011 00:52:30 +0000 (00:52 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 May 2011 00:52:30 +0000 (00:52 +0000)
Custom scrollbars nested inside an overlay scrollbar overflow region end up
painting twice
-and corresponding-
<rdar://problem/9389072>

Reviewed by Darin Adler.

Source/WebCore:

Be sure not to paint custom css scrollbars during the special overlay-scrollbar
painting pass.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintOverflowControls):

LayoutTests:

* platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png: Added.
* platform/mac/scrollbars/scrollbars-on-positioned-content-expected.txt: Added.
* scrollbars/scrollbars-on-positioned-content.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.txt [new file with mode: 0644]
LayoutTests/scrollbars/scrollbars-on-positioned-content.html [new file with mode: 0755]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp

index c46807e..dc670cb 100644 (file)
@@ -1,3 +1,17 @@
+2011-05-06  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=60421
+        Custom scrollbars nested inside an overlay scrollbar overflow region end up 
+        painting twice
+        -and corresponding-
+        <rdar://problem/9389072>
+
+        * platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png: Added.
+        * platform/mac/scrollbars/scrollbars-on-positioned-content-expected.txt: Added.
+        * scrollbars/scrollbars-on-positioned-content.html: Added.
+
 2011-05-06  Abhishek Arya  <inferno@chromium.org>
 
         Unreviewed.
 2011-05-06  Abhishek Arya  <inferno@chromium.org>
 
         Unreviewed.
diff --git a/LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png b/LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png
new file mode 100644 (file)
index 0000000..e341bda
Binary files /dev/null and b/LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.png differ
diff --git a/LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.txt b/LayoutTests/platform/mac/scrollbars/scrollbars-on-positioned-content-expected.txt
new file mode 100644 (file)
index 0000000..1dc5601
--- /dev/null
@@ -0,0 +1,14 @@
+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 784x576
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 657x18
+          text run at (0,0) width 657: "This test passes if the custom scrollbar paints in the corrext spot, which is at the bottom of the purple div."
+layer at (8,50) size 304x550 clip at (9,51) size 287x533 scrollWidth 302 scrollHeight 1311
+  RenderBlock (positioned) {DIV} at (8,50) size 304x550 [border: (1px solid #FF0000)]
+    RenderBlock {DIV} at (1,412) size 15x900 [bgcolor=#008000]
+layer at (9,51) size 302x411 backgroundClip at (9,51) size 287x411 clip at (10,52) size 286x400 outlineClip at (9,51) size 287x533 scrollWidth 500
+  RenderBlock {DIV} at (1,1) size 302x411 [border: (1px solid #0000FF)]
+    RenderBlock {DIV} at (1,1) size 500x400 [bgcolor=#800080]
diff --git a/LayoutTests/scrollbars/scrollbars-on-positioned-content.html b/LayoutTests/scrollbars/scrollbars-on-positioned-content.html
new file mode 100755 (executable)
index 0000000..720c15e
--- /dev/null
@@ -0,0 +1,54 @@
+<html>
+       <head>
+               <style type="text/css">
+               .tables
+               {
+                       border: 1px solid red;
+                       overflow-y: auto;
+                       top: 50px;
+                       bottom: 0px;
+                       position: absolute;
+               }
+               
+               .wrapper
+               {
+                       border: 1px solid blue;
+                       overflow-x: auto;
+                       width: 300px;
+               }
+
+               .wrapper::-webkit-scrollbar
+               {
+                       height: 9px;
+               }
+
+               .wrapper::-webkit-scrollbar-track
+               {
+                       background-color: #E3E3E3;
+               }
+
+               .wrapper::-webkit-scrollbar-thumb
+               {
+                       background: #CCCCCC;
+                       border: 1px solid #ADADAD;
+               }
+               </style>
+       </head>
+       
+       <body>
+               
+               <p>This test passes if the custom scrollbar paints in the corrext spot, which is at the bottom of the purple div.</p>
+
+               <div class="tables">
+               <div class="wrapper">
+       
+                       <div style="background-color:purple; width:500px; height:400px;"></div>
+
+               </div>
+               
+        <div style="background-color:green; width:15px; height:900px;"></div>
+        
+        </div>
+        
+       </body>
+</html>
index 19c0391..a68a1f9 100644 (file)
@@ -1,3 +1,18 @@
+2011-05-06  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=60421
+        Custom scrollbars nested inside an overlay scrollbar overflow region end up 
+        painting twice
+        -and corresponding-
+        <rdar://problem/9389072>
+
+        Be sure not to paint custom css scrollbars during the special overlay-scrollbar 
+        painting pass.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintOverflowControls):
+
 2011-05-06  Cary Clark  <caryclark@google.com>
 
         Reviewed by Eric Seidel.
 2011-05-06  Cary Clark  <caryclark@google.com>
 
         Reviewed by Eric Seidel.
index 9912d07..6c75f6c 100644 (file)
@@ -2251,6 +2251,10 @@ void RenderLayer::paintOverflowControls(GraphicsContext* context, int tx, int ty
         return;
     }
 
         return;
     }
 
+    // This check is required to avoid painting custom CSS scrollbars twice.
+    if (paintingOverlayControls && !hasOverlayScrollbars())
+        return;
+
     int offsetX = tx;
     int offsetY = ty;
     if (paintingOverlayControls) {
     int offsetX = tx;
     int offsetY = ty;
     if (paintingOverlayControls) {