Bug 40981 - iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
Summary: iframe and scrollbar with "overflow:auto" should support autoscroll with mous...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Antonio Gomes
URL:
Keywords:
Depends on: 121559 121777
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-22 04:38 PDT by Hajime Morrita
Modified: 2013-09-23 14:49 PDT (History)
13 users (show)

See Also:


Attachments
Test case with iframe (271 bytes, text/html)
2010-06-22 10:19 PDT, Erik Arvidsson
no flags Details
experiment for EWS (9.32 KB, patch)
2013-09-16 16:01 PDT, Antonio Gomes
no flags Details | Formatted Diff | Diff
patch (9.80 KB, patch)
2013-09-18 12:26 PDT, Antonio Gomes
no flags Details | Formatted Diff | Diff
patch - with tighten test (10.45 KB, patch)
2013-09-23 14:15 PDT, Antonio Gomes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2010-06-22 04:38:06 PDT
Not only for outermost frame, but also iframe, should support autoscroll with mousedrag

How to reproduce:
1. Open reproduction HTML.
2. Drag "Drag me" to bottom of the iframe.

Expected:
- The content of iframe start scrolling down 
Actual:
- nothing did happen.

This bug is drived from Bug 39725.
Comment 1 Erik Arvidsson 2010-06-22 10:12:21 PDT
There is a misconception here. Bug 39725 was about elements but was treated as top level browser viewport. The test case for bug 39725 uses a div which that bug was about. To keep things clear, I'll add an iframe test for this one.
Comment 2 Erik Arvidsson 2010-06-22 10:19:10 PDT
Created attachment 59386 [details]
Test case with iframe
Comment 3 Hajime Morrita 2010-06-22 17:43:45 PDT
>There is a misconception here. Bug 39725 was about elements but was treated as top level browser viewport. The test case for bug 39725 uses a div which that bug was about. To keep things clear, I'll add an iframe test for this one.
Oops, you are right. Thank you for pointing it out!
Comment 4 Antonio Gomes 2013-08-30 11:02:34 PDT
Taking. Tested on:

Safari / Chrome / Opera15 - No autoscroll
Firefox - No autoscroll
Opera 12 (pre-blink) - Autoscrolls
Comment 5 Antonio Gomes 2013-09-03 05:18:31 PDT
So, I looked at this, and there seems to be two main issues here:

1) ChromeClient::shouldAutoscrollForDragAndDrop returns  'false' unconditionally:

    // FIXME: Port should return true using heuristic based on scrollable(RenderBox).
    virtual bool shouldAutoscrollForDragAndDrop(RenderBox*) const { return false; }

2) Within DragController, drag'ing content from a Frame (main) to another (inner) is "blocked" by the SecurityOrigin policies:

bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction actionMask, DragSession& dragSession)
{
...
    if (m_dragInitiator && !m_documentUnderMouse->securityOrigin()->canReceiveDragData(m_dragInitiator->securityOrigin()))
        return false;



The one that actually concerns me is (2). Do you think we can have a way to implement this feature without breaking the SecurityOrigin contract?
Comment 6 Antonio Gomes 2013-09-03 05:31:03 PDT
Relevant changeset: http://trac.webkit.org/changeset/71925

    2010-11-11 Abhishek Arya <​inferno@chromium.org>

        Reviewed by Adam Barth.

        Not allow drag and drop across different origins.
        ​https://bugs.webkit.org/show_bug.cgi?id=49098
Comment 7 Antonio Gomes 2013-09-16 13:59:09 PDT
So, is this behavior something Safari wants?

I have a patch for this ready, but the below ChromeClient hook would have to return true for Mac, and I would like to hear from you guys.

    virtual bool shouldAutoscrollForDragAndDrop(RenderBox*) const { return false; }

For the record, Chrome/Opera/IE support autoscroll for scrollable divs and iframes. Firefox does not.

Please advice.
Comment 8 Simon Fraser (smfr) 2013-09-16 14:10:35 PDT
(In reply to comment #7)
> So, is this behavior something Safari wants?
> 
> I have a patch for this ready, but the below ChromeClient hook would have to return true for Mac, and I would like to hear from you guys.

Let's go with "no" for now to not change current behavior.
Comment 9 Antonio Gomes 2013-09-16 14:22:37 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > So, is this behavior something Safari wants?
> > 
> > I have a patch for this ready, but the below ChromeClient hook would have to return true for Mac, and I would like to hear from you guys.
> 
> Let's go with "no" for now to not change current behavior.

Sounds ok.

Would it be less aggressive better:

For example, allow autoscroll to scroll parent scrollable div's and/or non-mainframe frames? This would match autoscroll from text-selection..

Otherwise, we could instead start removing code, if it is a not desirable feature.

I appreciate the input.
Comment 10 Antonio Gomes 2013-09-16 15:58:14 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > So, is this behavior something Safari wants?
> > 
> > I have a patch for this ready, but the below ChromeClient hook would have to return true for Mac, and I would like to hear from you guys.
> 
> Let's go with "no" for now to not change current behavior.

CC'ing Carlos/Gustavo, Allan and Gyuyoung for Gtk/Qt/Efl respectively.

Guys, is this something you think "your" ports are interested? If so, I can work for that. Otherwise, it will be dead code.
Comment 11 Antonio Gomes 2013-09-16 16:01:56 PDT
Created attachment 211839 [details]
experiment for EWS
Comment 12 Gustavo Noronha (kov) 2013-09-17 07:28:41 PDT
I believe this is good to have in webkitgtk, this is indeed how things work on most gtk widgets.
Comment 13 Antonio Gomes 2013-09-18 12:26:39 PDT
Created attachment 212012 [details]
patch

QtWebKit and WebKitGtk+ are interested in this feature. As per, discussion on IRC/Bug.
Comment 14 Antonio Gomes 2013-09-20 13:47:10 PDT
Kindly ping review.
Comment 15 Antonio Gomes 2013-09-22 21:50:35 PDT
Fixed by https://trac.webkit.org/r156257
Comment 16 WebKit Commit Bot 2013-09-22 23:23:43 PDT
Re-opened since this is blocked by bug 121777
Comment 17 Alexey Proskuryakov 2013-09-22 23:28:39 PDT
The test in this patch fails: <http://build.webkit.org/results/Apple%20MountainLion%20Release%20WK2%20(Tests)/r156257%20(11977)/fast/events/drag-and-drop-autoscroll-inner-frame-pretty-diff.html>.

Antonio is not available at the moment, and there are two more unrelated regressions in the tree. Fixing everything is not an option for me, rolling out.
Comment 18 Alexey Proskuryakov 2013-09-22 23:32:32 PDT
Rolled out in <http://trac.webkit.org/changeset/156259>.
Comment 19 Antonio Gomes 2013-09-23 05:46:01 PDT
(In reply to comment #17)
> The test in this patch fails: <http://build.webkit.org/results/Apple%20MountainLion%20Release%20WK2%20(Tests)/r156257%20(11977)/fast/events/drag-and-drop-autoscroll-inner-frame-pretty-diff.html>.
> 
> Antonio is not available at the moment, and there are two more unrelated regressions in the tree. Fixing everything is not an option for me, rolling out.

Thanks.

EWS betrayed me, and it also passed locally. Will investigate..
Comment 20 Antonio Gomes 2013-09-23 14:15:36 PDT
Created attachment 212390 [details]
patch - with tighten test
Comment 21 WebKit Commit Bot 2013-09-23 14:49:08 PDT
Comment on attachment 212390 [details]
patch - with tighten test

Clearing flags on attachment: 212390

Committed r156297: <http://trac.webkit.org/changeset/156297>
Comment 22 WebKit Commit Bot 2013-09-23 14:49:14 PDT
All reviewed patches have been landed.  Closing bug.