Title: [88877] trunk/Source/WebCore
Revision
88877
Author
bda...@apple.com
Date
2011-06-14 17:09:01 -0700 (Tue, 14 Jun 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=62678
When the window is small enough, the scrollbars are misplaced with painting 
artifacts, after changing the scrollbar appearance
-and corresponding-
<rdar://problem/9414015>

Reviewed by Dan Bernstein.

Get rid of the FrameView implementation of scrollbarStyleChanged(). Its approach 
is just not good.
* page/FrameView.cpp:
* page/FrameView.h:

Implement scrollbarStyleChanged() on ScrollView instead. And just call 
updatedScrollbars().
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarStyleChanged):
* platform/ScrollView.h:

Invalidate the old scrollbar before changing it to the new scrollbar. This way 
when the scrollbar gets smaller, the older, larger pieces still repaint properly.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88876 => 88877)


--- trunk/Source/WebCore/ChangeLog	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/ChangeLog	2011-06-15 00:09:01 UTC (rev 88877)
@@ -1,3 +1,29 @@
+2011-06-14  Beth Dakin  <bda...@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=62678
+        When the window is small enough, the scrollbars are misplaced with painting 
+        artifacts, after changing the scrollbar appearance
+        -and corresponding-
+        <rdar://problem/9414015>
+
+        Get rid of the FrameView implementation of scrollbarStyleChanged(). Its approach 
+        is just not good.
+        * page/FrameView.cpp:
+        * page/FrameView.h:
+
+        Implement scrollbarStyleChanged() on ScrollView instead. And just call 
+        updatedScrollbars().
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollbarStyleChanged):
+        * platform/ScrollView.h:
+
+        Invalidate the old scrollbar before changing it to the new scrollbar. This way 
+        when the scrollbar gets smaller, the older, larger pieces still repaint properly.
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::updateScrollerStyle):
+
 2011-06-14  Michael Saboff  <msab...@apple.com>
 
         Reviewed by Joseph Pecoraro.

Modified: trunk/Source/WebCore/page/FrameView.cpp (88876 => 88877)


--- trunk/Source/WebCore/page/FrameView.cpp	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/page/FrameView.cpp	2011-06-15 00:09:01 UTC (rev 88877)
@@ -2216,14 +2216,6 @@
     return page->chrome()->client()->didCompleteAnimatedScroll();
 }
 
-void FrameView::scrollbarStyleChanged()
-{
-    Page* page = m_frame->page();
-    if (!page)
-        return;
-    page->setNeedsRecalcStyleInAllFrames();
-}
-
 void FrameView::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
 {
     Page* page = m_frame->page();

Modified: trunk/Source/WebCore/page/FrameView.h (88876 => 88877)


--- trunk/Source/WebCore/page/FrameView.h	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/page/FrameView.h	2011-06-15 00:09:01 UTC (rev 88877)
@@ -327,7 +327,6 @@
     virtual void didCompleteRubberBand(const IntSize&) const;
     virtual void didStartAnimatedScroll() const;
     virtual void didCompleteAnimatedScroll() const;
-    virtual void scrollbarStyleChanged();
     virtual void setVisibleScrollerThumbRect(const IntRect&);
 #if USE(ACCELERATED_COMPOSITING)
     virtual GraphicsLayer* layerForHorizontalScrollbar() const;

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (88876 => 88877)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2011-06-15 00:09:01 UTC (rev 88877)
@@ -938,6 +938,11 @@
     return !scrollCornerRect().isEmpty();
 }
 
+void ScrollView::scrollbarStyleChanged()
+{
+    updateScrollbars(scrollOffset());
+}
+
 void ScrollView::updateScrollCorner()
 {
 }

Modified: trunk/Source/WebCore/platform/ScrollView.h (88876 => 88877)


--- trunk/Source/WebCore/platform/ScrollView.h	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/platform/ScrollView.h	2011-06-15 00:09:01 UTC (rev 88877)
@@ -59,6 +59,7 @@
     virtual void didCompleteRubberBand(const IntSize&) const;
     virtual void notifyPageThatContentAreaWillPaint() const;
     virtual bool isScrollCornerVisible() const;
+    virtual void scrollbarStyleChanged();
 
     // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     virtual void scrollTo(const IntSize& newOffset);

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (88876 => 88877)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2011-06-14 23:50:53 UTC (rev 88876)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2011-06-15 00:09:01 UTC (rev 88877)
@@ -1238,6 +1238,8 @@
     int newStyle = wkScrollbarPainterControllerStyle(m_scrollbarPainterController.get());
 
     if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
+        verticalScrollbar->invalidate();
+
         WKScrollbarPainterRef oldVerticalPainter = wkVerticalScrollbarPainterForController(m_scrollbarPainterController.get());
         WKScrollbarPainterRef newVerticalPainter = wkMakeScrollbarReplacementPainter(oldVerticalPainter,
                                                                                      newStyle,
@@ -1254,6 +1256,8 @@
     }
 
     if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
+        horizontalScrollbar->invalidate();
+
         WKScrollbarPainterRef oldHorizontalPainter = wkHorizontalScrollbarPainterForController(m_scrollbarPainterController.get());
         WKScrollbarPainterRef newHorizontalPainter = wkMakeScrollbarReplacementPainter(oldHorizontalPainter,
                                                                                        newStyle,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to