Bug 24066

Summary: Chromium drop-down box: selected items don't paint correctly when scrolled
Product: WebKit Reporter: Jay Campan <jcampan>
Component: PlatformAssignee: Jay Campan <jcampan>
Status: RESOLVED FIXED    
Severity: Normal CC: fishd
Priority: P2    
Version: 420+   
Hardware: PC   
OS: Windows Vista   
Attachments:
Description Flags
FramelessScrollView::invalidateRect now invalidates in the scrolled view coordinates
fishd: review-
Updated patch that invalidates in the parent coordinates.
fishd: review+
Updated patch, evil tabs removed in ChangeLog none

Description Jay Campan 2009-02-20 12:16:18 PST
When opening a select input in Chromium and scrolling-down in the popup, the items in the list don't paint properly, several are displayed as selected.

 Chromium associated bug : http://crbug.com/6743
Comment 1 Jay Campan 2009-02-20 12:24:48 PST
Created attachment 27835 [details]
FramelessScrollView::invalidateRect now invalidates in the scrolled view coordinates

A previous patch of mine fixing a painting problem with scroll-bars changes FramelessScrollView::invalidateRect to invalidate in the host window coordinates. This caused other painting problems.
This patch reverts back that changes and fixes the painting of scroll-bars by ensuring the invalidateScrollBars method invalidates in the scrolled view coordinates.
Comment 2 Darin Fisher (:fishd, Google) 2009-02-24 15:08:51 PST
Comment on attachment 27835 [details]
FramelessScrollView::invalidateRect now invalidates in the scrolled view coordinates

>+2009-02-20  Jay Campan  <jcampan@google.com>
>+
>+        Reviewed by NOBODY (OOPS!).
>+

nit: please add a bug link here and a description of the code change.


>Index: WebCore/platform/chromium/FramelessScrollView.cpp
>===================================================================
>--- WebCore/platform/chromium/FramelessScrollView.cpp	(revision 41110)
>+++ WebCore/platform/chromium/FramelessScrollView.cpp	(working copy)
>@@ -47,7 +47,7 @@ void FramelessScrollView::invalidateScro
>     // Add in our offset within the ScrollView.
>     IntRect dirtyRect = rect;
>     dirtyRect.move(scrollbar->x(), scrollbar->y());
>-    invalidateRect(dirtyRect);
>+    invalidateRect(windowToContents(dirtyRect));

I would expect that we need to convert from the coordinates of the
Scrollbar to the coordinates of the ScrollView's content area.

That is what FrameView::invalidateScrollbarRect does, and it is what
the old code did.  So, this change seems wrong.


> bool FramelessScrollView::isActive() const
>@@ -59,7 +59,7 @@ bool FramelessScrollView::isActive() con
> void FramelessScrollView::invalidateRect(const IntRect& rect)
> {
>     if (HostWindow* h = hostWindow())
>-        h->repaint(rect, true);
>+        h->repaint(contentsToWindow(rect), true);

Same deal here.  I'm surprised to see this differ from FrameView's
invalidateRect implementation, but maybe there is something more
subtle at play?
Comment 3 Jay Campan 2009-02-25 08:39:58 PST
Created attachment 27966 [details]
Updated patch that invalidates in the parent coordinates.
Comment 4 Darin Fisher (:fishd, Google) 2009-02-25 08:50:21 PST
Comment on attachment 27966 [details]
Updated patch that invalidates in the parent coordinates.

>Index: WebCore/ChangeLog
...
>+        Reviewed by NOBODY (OOPS!).
>+
>+	https://bugs.webkit.org/show_bug.cgi?id=24066
>+
>+	Items in drop-downs were not painted correctly.
>+	Makes sure the PopupListBox invalidates in the coordinates of
>+	the window as this is FramelessScrollView::invalidateRect
>+	paints to.

the ChangeLog has tabs in it.  those should be replaced with spaces.

otherwise, looks great!
Comment 5 Jay Campan 2009-02-25 08:57:26 PST
Created attachment 27967 [details]
Updated patch, evil tabs removed in ChangeLog
Comment 6 Darin Fisher (:fishd, Google) 2009-02-25 08:59:08 PST
Landed as http://trac.webkit.org/changeset/41212