diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 665d84b41808832be1a18c9d2e12e95c83e73af4..b15301e92267c0efe8852fb0c47b4d6daaa52482 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2010-08-13 MORITA Hajime + + Reviewed by Kent Tamura. + + https://bugs.webkit.org/show_bug.cgi?id=43960 + [Chromium] styled scroll bar on the window is painted badly. + + * platform/chromium/test_expectations.txt: Skips at this time and will rebaseline shortly. + * platform/mac/Skipped: Mac doesn't suffer from the problem. + * scrollbars/custom-scrollbar-with-incomplete-style.html: Added. + 2010-08-30 Adam Barth Reviewed by Darin Adler. diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt index c6f8517ee90924e498b3d4e6ebb9a08f2c8f0044..2c74d1f62e868a07b0d162860c734f2fd461d2a9 100644 --- a/LayoutTests/platform/chromium/test_expectations.txt +++ b/LayoutTests/platform/chromium/test_expectations.txt @@ -3215,3 +3215,6 @@ BUGWK44797 : fullscreen = FAIL // Started at http://trac.webkit.org/changeset/66318/ BUG53796 : fast/js/array-splice.html = TEXT +// Need rebasline to pick the results. +BUG47946 WIN LINUX MAC : scrollbars/custom-scrollbar-with-incomplete-style.html = MISSING + diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped index 9874182247d8aafb4e5cc14ca952ef96c8e963da..b08e72e34d4efd73d594e12c4c6c148f6c302017 100644 --- a/LayoutTests/platform/mac/Skipped +++ b/LayoutTests/platform/mac/Skipped @@ -298,3 +298,7 @@ inspector/dom-breakpoints.html # https://bugs.webkit.org/show_bug.cgi?id=44566 fast/canvas/webgl/gl-teximage.html + +# Safari doesn't allow to customize outermost scrollbars. +# https://bugs.webkit.org/show_bug.cgi?id=43960 +scrollbars/custom-scrollbar-with-incomplete-style.html \ No newline at end of file diff --git a/LayoutTests/scrollbars/custom-scrollbar-with-incomplete-style.html b/LayoutTests/scrollbars/custom-scrollbar-with-incomplete-style.html new file mode 100644 index 0000000000000000000000000000000000000000..d16690b5da0eb6440e796122c433daf556cb97d4 --- /dev/null +++ b/LayoutTests/scrollbars/custom-scrollbar-with-incomplete-style.html @@ -0,0 +1,29 @@ + + +Incomplete scrollbar + + + +

It's OK if nothing drawn for a scrollbar (for an outermost frame and an element with overlow)

+

Note that Safari doesn't allow to customize the outermost scdrollbars and just show Cocoa's.

+
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
+
+

+

+
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 665823cebebc1d9cd2e7013727301ae73ea781b3..5df309da5f66deb5c8ee746df3b54eda3803a643 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-08-13  MORITA Hajime  
+
+        Reviewed by Kent Tamura.
+
+        https://bugs.webkit.org/show_bug.cgi?id=43960
+        [Chromium] styled scroll bar on the window is painted badly.
+
+        WebKit assumes outermost scrollbar always painted. 
+        So force their style to have the  background color if it isn't 
+        given by the stylesheet.
+        
+        Test: scrollbars/custom-scrollbar-with-incomplete-style.html
+
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::hasBackground): Extracted body to RenderStyle for sharing.
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::getScrollbarPseudoStyle): Added the workaround as mentioned above.
+        * rendering/RenderScrollbar.h:
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::hasBackground): Extracted from RenderObject.
+
 2010-08-30  Adam Barth  
 
         Reviewed by Darin Adler.
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index d2046cfd517b530c2674d3cf3b0ae3f6176d1c2c..34eba6d8f487e4e840745aee33507ef3176e446c 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -383,14 +383,7 @@ public:
     
     bool hasBoxDecorations() const { return m_paintBackground; }
     bool mustRepaintBackgroundOrBorder() const;
-    bool hasBackground() const
-    {
-        Color color = style()->visitedDependentColor(CSSPropertyBackgroundColor);
-        if (color.isValid() && color.alpha() > 0)
-            return true;
-        return style()->hasBackgroundImage();
-    }
-
+    bool hasBackground() const { return style()->hasBackground(); }
     bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsPositionedMovementLayout; }
     bool selfNeedsLayout() const { return m_needsLayout; }
     bool needsPositionedMovementLayout() const { return m_needsPositionedMovementLayout; }
diff --git a/WebCore/rendering/RenderScrollbar.cpp b/WebCore/rendering/RenderScrollbar.cpp
index 73780561a44069688cd643e7ab7c4276fac271c5..e7a70a42f37ac8a8ec6c3c914793a57f93109ab2 100644
--- a/WebCore/rendering/RenderScrollbar.cpp
+++ b/WebCore/rendering/RenderScrollbar.cpp
@@ -27,6 +27,7 @@
 #include "RenderScrollbar.h"
 
 #include "Frame.h"
+#include "FrameView.h"
 #include "RenderPart.h"
 #include "RenderScrollbarPart.h"
 #include "RenderScrollbarTheme.h"
@@ -150,6 +151,14 @@ PassRefPtr RenderScrollbar::getScrollbarPseudoStyle(ScrollbarPart p
     RefPtr result = owningRenderer()->getUncachedPseudoStyle(pseudoId, owningRenderer()->style());
     s_styleResolvePart = NoPart;
     s_styleResolveScrollbar = 0;
+
+    // Scrollbars for root frames should always have background color 
+    // unless explicitly specified as transparent. So we force it.
+    // This is because WebKit assumes scrollbar to be always painted and missing background
+    // causes visual artifact like non-repainted dirty region.
+    if (result && m_owningFrame && m_owningFrame->view() && !m_owningFrame->view()->isTransparent() && !result->hasBackground())
+        result->setBackgroundColor(Color::white);
+
     return result;
 }
 
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 920e452e398466af5cc88995956e07a2c2522fae..9cda97f94f29ba963f74427d89bcb7975b3c431a 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -345,6 +345,14 @@ public:
     bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
     bool hasAppearance() const { return appearance() != NoControlPart; }
 
+    bool hasBackground() const
+    {
+        Color color = visitedDependentColor(CSSPropertyBackgroundColor);
+        if (color.isValid() && color.alpha() > 0)
+            return true;
+        return hasBackgroundImage();
+    }
+
     bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
     void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }