RESOLVED FIXED66238
Chromium Mac: Fix issue where scrollbar wouldn't be drawn until page finished loading
https://bugs.webkit.org/show_bug.cgi?id=66238
Summary Chromium Mac: Fix issue where scrollbar wouldn't be drawn until page finished...
Sailesh Agrawal
Reported 2011-08-15 10:26:01 PDT
Chromium Mac: Force scrollbar to be drawn if user scrolls page while shouldSuspendScrollAnimations() is true
Attachments
Patch (2.95 KB, patch)
2011-08-15 10:43 PDT, Sailesh Agrawal
no flags
Patch (4.07 KB, patch)
2011-08-15 20:14 PDT, Sailesh Agrawal
no flags
Patch (4.12 KB, patch)
2011-08-16 09:53 PDT, Sailesh Agrawal
no flags
Sailesh Agrawal
Comment 1 2011-08-15 10:43:38 PDT
Sailesh Agrawal
Comment 2 2011-08-15 10:44:24 PDT
Nico Weber
Comment 3 2011-08-15 10:48:41 PDT
Do you know how Safari / WebKit2 handles this (or why they're not affected by it)?
Sailesh Agrawal
Comment 4 2011-08-15 12:03:48 PDT
(In reply to comment #3) > Do you know how Safari / WebKit2 handles this (or why they're not affected by it)? The short answer is that I don't know. As far as I can tell there are two differences between Chromium Mac and Safari: 1. in Safari smooth scrolling is enabled so ScrollAnimatorMac::scroll() ends up calling -[NSScrollAnimationHelper scrollToPoint:]. Maybe this ends up changing the alpha some how? 2. In Chromium Mac I added extra code to ScrollAnimatorChromiumMac::initialScrollbarPaintTimerFired() to keep the timer alive if we still hadn't loaded the page. See bug 65586. This makes it easier to reproduce the bug since we end up disabling drawing the scrollbar for longer. So I guess another question is how Safari handles bug 65586. Theoretically any site that takes longer than 0.1 second to load should cause Safari not to flash the scrollbar on load. But this doesn't happen, Safari flashes the scrollbar correctly on all sites that I tried.
Nico Weber
Comment 5 2011-08-15 12:09:11 PDT
Can you find out?
Sailesh Agrawal
Comment 6 2011-08-15 20:14:18 PDT
Sailesh Agrawal
Comment 7 2011-08-15 20:19:40 PDT
(In reply to comment #5) > Can you find out? Thanks for asking me to find out. After I dug deeper I found a bug in my implementation of wkScrollbarPainterForceFlashScrollers(). I have a disassembly of the GM version of all the wk* functions. I went back and verified that implementation matches the disassembly so there shouldn't be any more bugs of this sort.
Nico Weber
Comment 8 2011-08-16 08:42:44 PDT
Comment on attachment 103996 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103996&action=review Say "This reverts http://trac.webkit.org/changeset/92316" somewhere in the changelog. LGTM > Source/WebCore/ChangeLog:11 > + 3. ScrollAnimatorChromiumMac::scroll() is called before the ScrollAnimatorChromiumMac::m_initialScrollbarPaintTimer is fired. 4. At this point the scrollbar painter assumes the scrollbar is already visible (because of 1.) so the scrollbar's alpha stays at 0. Thus the scrollbar isn't visible until the page finishes loading. Linebreak before "4." > Source/WebCore/ChangeLog:14 > + Also, now that wkScrollbarPainterForceFlashScrollers is working correctly I don't the extra logic I added to the initialScrollbarPainterTimer handler. That logic restarted the timer if shouldSuspendScrollAnimations() was true. But isn't necessary since calling wkScrollbarPainterForceFlashScrollers() causes -[ScrollbarPainterDelegate setUpAnimation:...] to be called which does the exact same thing. "I don't *need*", "But *it* isn't"
Nico Weber
Comment 9 2011-08-16 08:43:39 PDT
(In reply to comment #7) > I went back and verified that implementation matches the disassembly so there shouldn't be any more bugs of this sort. Does that mean this comment "// TODO(sail): This doesn't match the implementation in WebKitSystemInterface." can be deleted? (not in this bug)
Sailesh Agrawal
Comment 10 2011-08-16 09:52:20 PDT
Comment on attachment 103996 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103996&action=review >> Source/WebCore/ChangeLog:11 >> + 3. ScrollAnimatorChromiumMac::scroll() is called before the ScrollAnimatorChromiumMac::m_initialScrollbarPaintTimer is fired. 4. At this point the scrollbar painter assumes the scrollbar is already visible (because of 1.) so the scrollbar's alpha stays at 0. Thus the scrollbar isn't visible until the page finishes loading. > > Linebreak before "4." Fixed. >> Source/WebCore/ChangeLog:14 >> + Also, now that wkScrollbarPainterForceFlashScrollers is working correctly I don't the extra logic I added to the initialScrollbarPainterTimer handler. That logic restarted the timer if shouldSuspendScrollAnimations() was true. But isn't necessary since calling wkScrollbarPainterForceFlashScrollers() causes -[ScrollbarPainterDelegate setUpAnimation:...] to be called which does the exact same thing. > > "I don't *need*", "But *it* isn't" Fixed.
Sailesh Agrawal
Comment 11 2011-08-16 09:53:24 PDT
Sailesh Agrawal
Comment 12 2011-08-16 09:57:08 PDT
(In reply to comment #9) > (In reply to comment #7) > > I went back and verified that implementation matches the disassembly so there shouldn't be any more bugs of this sort. > > Does that mean this comment "// TODO(sail): This doesn't match the implementation in WebKitSystemInterface." can be deleted? (not in this bug) Oops, that still needs to be fixed. I'll work on that next. Filed bug 66311 to track this.
Nico Weber
Comment 14 2011-08-16 21:02:11 PDT
Looks great. jamesr / dglazkov, can one of you r+, please?
WebKit Review Bot
Comment 15 2011-08-17 01:28:44 PDT
Comment on attachment 104059 [details] Patch Clearing flags on attachment: 104059 Committed r93197: <http://trac.webkit.org/changeset/93197>
WebKit Review Bot
Comment 16 2011-08-17 01:28:49 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.