Bug 49209 - WebKit2 should exit auto scrolling mode when losing focus
Summary: WebKit2 should exit auto scrolling mode when losing focus
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Brian Weinstein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-08 14:18 PST by Brian Weinstein
Modified: 2010-12-17 16:34 PST (History)
4 users (show)

See Also:


Attachments
[PATCH] Fix (1.55 KB, patch)
2010-11-08 14:25 PST, Brian Weinstein
no flags Details | Formatted Diff | Diff
[PATCH] Fix in WebCore (2.13 KB, patch)
2010-12-15 18:20 PST, Brian Weinstein
jhoneycutt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Weinstein 2010-11-08 14:18:03 PST
We do not exit pan scrolling mode when switching tabs in WebKit2.

In WebKit1, this was fixed by http://trac.webkit.org/changeset/50007, but the bug still exists in WebKit2.

Steps to reproduce:
1) Open two tabs, one that can scroll
2) Start panscrolling in the tab that can scroll
3) Switch focus to the other tab.

The pan scrolling icon stays active, even though it shouldn't.
Comment 1 Brian Weinstein 2010-11-08 14:25:05 PST
Created attachment 73285 [details]
[PATCH] Fix
Comment 2 Adam Roben (:aroben) 2010-11-08 14:27:57 PST
Comment on attachment 73285 [details]
[PATCH] Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=73285&action=review

Is it possible to make a test for this using TestWebKitAPI? You'd have to add code that can simulate a middle-click, and a way to make the WebView lose focus, and a way to detect whether the autoscroll timer was stopped.

> WebKit2/WebProcess/WebPage/WebPage.cpp:671
> +    FocusController* focusController = m_page->focusController();
> +    if (!isFocused)
> +        focusController->focusedOrMainFrame()->eventHandler()->stopAutoscrollTimer();
> +    focusController->setFocused(isFocused);

Should this code be in FocusController::setFocused instead?
Comment 3 Brian Weinstein 2010-11-08 14:44:59 PST
(In reply to comment #2)
> (From update of attachment 73285 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=73285&action=review
> 
> Is it possible to make a test for this using TestWebKitAPI? You'd have to add code that can simulate a middle-click, and a way to make the WebView lose focus, and a way to detect whether the autoscroll timer was stopped.

If it was a windows specific test, I could make sure the autoscroll timer was stopped by checking the scroll position before and after the timer was supposed to be killed, but I don't know if it's possible to test the gaining and losing focus of the web view.

> 
> > WebKit2/WebProcess/WebPage/WebPage.cpp:671
> > +    FocusController* focusController = m_page->focusController();
> > +    if (!isFocused)
> > +        focusController->focusedOrMainFrame()->eventHandler()->stopAutoscrollTimer();
> > +    focusController->setFocused(isFocused);
> 
> Should this code be in FocusController::setFocused instead?

No reason it shouldn't be, then it wouldn't be something that would need to be duplicated across WebKit platforms.
Comment 4 Brian Weinstein 2010-12-15 18:20:53 PST
Created attachment 76725 [details]
[PATCH] Fix in WebCore
Comment 5 WebKit Review Bot 2010-12-16 15:37:48 PST
http://trac.webkit.org/changeset/74170 might have broken Leopard Intel Debug (Tests)
Comment 6 Eric Seidel (no email) 2010-12-17 16:34:10 PST
Looks like this was landed but not closed.