Bug 32399

Summary: Pan Scrolling Jumps out of frames if the initial location is in a frame that can't be scrolled
Product: WebKit Reporter: Brian Weinstein <bweinstein>
Component: WebCore Misc.Assignee: Brian Weinstein <bweinstein>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, maxime.britto, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
[PATCH] Fix darin: review+, bweinstein: commit-queue-

Description Brian Weinstein 2009-12-10 16:33:03 PST
Pan Scrolling Jumps out of frames if the initial location is in a frame that can't be scrolled.

Case: Empty iFrame that can't scroll inside of a page that can scroll

Try to pan scroll - starting in the empty frame:

IE: Doesn't scroll anything
Firefox: Doesn't scroll anything
Safari: Scrolls the page.

We shouldn't scroll at all here.
Comment 1 Brian Weinstein 2009-12-10 16:34:41 PST
Additionally, we don't jump out of frames in the rest of the scrolling process, so it doesn't make sense for us to do it on the initial scroll.
Comment 2 Maxime Britto 2009-12-11 00:50:04 PST
The regular wheel scroll doesn't trigger in that case ?
Comment 3 Brian Weinstein 2009-12-11 10:58:02 PST
The scroll wheel doesn't jump out of iFrames either.

The bug here is that:

1) There's an iFrame that can scroll.
2) There's an iFrame that can't scroll.

If you start pan scrolling in (1), it will scroll the iFrame, and then NOT jump out to the main document.
If you start pan scrolling in (2), it will jump out of the document.

That behavior is inconsistent and a bug. It wasn't always like this, but was a regression from r52008. Before r52008, it would think it could pan scroll, and show the icon even if there was nothing for it to scroll inside the iFrame.
Comment 4 Adam Roben (:aroben) 2009-12-11 11:13:49 PST
(In reply to comment #3)
> The scroll wheel doesn't jump out of iFrames either.

Do you mean "pan scroll" instead of "scroll wheel"?
Comment 5 Brian Weinstein 2009-12-11 11:15:00 PST
(In reply to comment #4)
> (In reply to comment #3)
> > The scroll wheel doesn't jump out of iFrames either.
> 
> Do you mean "pan scroll" instead of "scroll wheel"?

No, Maxime asked about the scroll wheel, so I was saying that the scroll wheel doesn't jump out of frames/iFrames either.
Comment 6 Brian Weinstein 2009-12-11 11:16:56 PST
Created attachment 44698 [details]
[PATCH] Fix
Comment 7 WebKit Review Bot 2009-12-11 11:19:49 PST
style-queue ran check-webkit-style on attachment 44698 [details] without any errors.
Comment 8 Adam Roben (:aroben) 2009-12-11 11:26:11 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > The scroll wheel doesn't jump out of iFrames either.
> > 
> > Do you mean "pan scroll" instead of "scroll wheel"?
> 
> No, Maxime asked about the scroll wheel, so I was saying that the scroll wheel
> doesn't jump out of frames/iFrames either.

This does not match the behavior I see in ToT Safari. Scrolling the mouse wheel within an iframe scrolls that iframe until it can't be scrolled anymore, then scrolls the iframe's parent frame until that frame can't be scrolled, and so on.
Comment 9 Brian Weinstein 2009-12-11 11:28:01 PST
Oh, I was using a bad test case that called preventDefault on mousewheel. Sorry.
Comment 10 Darin Adler 2009-12-11 11:31:24 PST
Comment on attachment 44698 [details]
[PATCH] Fix

This looks OK and probably fixes this bug. But the existing logic doesn’t seem exactly right to me. A renderer can be an element with fixed positioning, in which case it doesn't make sense to advance to its parent when deciding what to scroll.

r=me
Comment 11 Brian Weinstein 2009-12-11 11:59:30 PST
Landed in r52012.