Bug 139110 - REGRESSION: Dragging selected text changes the selection
Summary: REGRESSION: Dragging selected text changes the selection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: mitz
URL:
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2014-11-30 10:12 PST by mitz
Modified: 2014-12-03 09:50 PST (History)
3 users (show)

See Also:


Attachments
Ignore mouse events received after starting a drag (6.56 KB, patch)
2014-12-02 10:59 PST, mitz
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2014-11-30 10:12:44 PST
To reproduce: select several lines of (non-editable) text. Click and hold inside the selection, then begin dragging away. The selection shouldn’t change as you begin dragging, but it does.
Comment 1 Alexey Proskuryakov 2014-11-30 16:59:10 PST
What is this a regression from? I thought that I filed a bug about this several years ago (when it was a new regression), but I couldn't find it recently.
Comment 2 mitz 2014-11-30 17:04:03 PST
(In reply to comment #1)
> What is this a regression from? I thought that I filed a bug about this
> several years ago (when it was a new regression), but I couldn't find it
> recently.

I don’t know yet exactly when the regression happened. Currently, the bug doesn’t appear to happen in Legacy WebKit.
Comment 3 mitz 2014-12-01 17:56:47 PST
This is similar to bug 58406, and can be fixed in a similar manner.
Comment 4 mitz 2014-12-02 10:59:51 PST
Created attachment 242430 [details]
Ignore mouse events received after starting a drag
Comment 5 Simon Fraser (smfr) 2014-12-02 12:19:47 PST
Comment on attachment 242430 [details]
Ignore mouse events received after starting a drag

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

> Source/WebKit2/WebProcess/WebPage/WebPage.h:700
> +    void willStartDrag() { m_isStartingDrag = true; }
> +    void didStartDrag() { m_isStartingDrag = false; }

These don't nest, so there should be an assertion that willStartDrag() isn't called twice.
Comment 6 mitz 2014-12-02 13:00:03 PST
(In reply to comment #5)
> Comment on attachment 242430 [details]
> Ignore mouse events received after starting a drag
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=242430&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.h:700
> > +    void willStartDrag() { m_isStartingDrag = true; }
> > +    void didStartDrag() { m_isStartingDrag = false; }
> 
> These don't nest, so there should be an assertion that willStartDrag() isn't
> called twice.

Added assertions and committed <http://trac.webkit.org/r176687>.
Comment 7 Mark Lam 2014-12-03 09:16:09 PST
This commit introduced the following crashes:

fast/events/clear-drag-state.html
fast/css/user-drag-none.html
editing/pasteboard/dataTransfer-setData-getData.html
editing/pasteboard/drop-text-events-sideeffect-crash.html
editing/pasteboard/drag-drop-iframe-refresh-crash.html
editing/pasteboard/drop-text-events-sideeffect.html
editing/selection/user-drag-element-and-user-select-none.html

See:
https://build.webkit.org/builders/Apple%20Mavericks%20Debug%20WK2%20%28Tests%29/builds/8311
https://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK2%20(Tests)/r176693%20(8311)/results.html

I verified this by locally building and running one of the tests.  r176686 passes, r176687 crashes.
Comment 8 mitz 2014-12-03 09:27:05 PST
(In reply to comment #7)
> This commit introduced the following crashes:
> 
> fast/events/clear-drag-state.html
> fast/css/user-drag-none.html
> editing/pasteboard/dataTransfer-setData-getData.html
> editing/pasteboard/drop-text-events-sideeffect-crash.html
> editing/pasteboard/drag-drop-iframe-refresh-crash.html
> editing/pasteboard/drop-text-events-sideeffect.html
> editing/selection/user-drag-element-and-user-select-none.html
> 
> See:
> https://build.webkit.org/builders/
> Apple%20Mavericks%20Debug%20WK2%20%28Tests%29/builds/8311
> https://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK2%20(Tests)/
> r176693%20(8311)/results.html
> 
> I verified this by locally building and running one of the tests.  r176686
> passes, r176687 crashes.

Thank you. Note that those “crashes” are failures of one of the assertions added in the last moment.
Comment 9 Mark Lam 2014-12-03 09:50:46 PST
(In reply to comment #7)
> This commit introduced the following crashes:
> 
> fast/events/clear-drag-state.html
> fast/css/user-drag-none.html
> editing/pasteboard/dataTransfer-setData-getData.html
> editing/pasteboard/drop-text-events-sideeffect-crash.html
> editing/pasteboard/drag-drop-iframe-refresh-crash.html
> editing/pasteboard/drop-text-events-sideeffect.html
> editing/selection/user-drag-element-and-user-select-none.html

Created https://bugs.webkit.org/show_bug.cgi?id=139224 to track this issue.  I also updated the TestExpectation in that bug.