WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
38175
REGRESSION (
r48698
): Selection drag-and-drop doesn't work for input/textarea
https://bugs.webkit.org/show_bug.cgi?id=38175
Summary
REGRESSION (r48698): Selection drag-and-drop doesn't work for input/textarea
Daniel Cheng
Reported
2010-04-26 23:38:06 PDT
In
http://crbug.com/new
, attempt to drag some text from a TEXTAREA to an empty text input. It will fail, and will raise an assert in debug builds: ASSERT(oldLength >= selectionLength); I think this is because WebCore is calculating oldLength from the wrong element; it looks like it's calculating the length of the text field being dragged to rather than the text field being dragged from. However, I'm not familiar enough with this code to say for sure.
Attachments
Patch
(6.30 KB, patch)
2010-04-27 06:12 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch (rev.2)
(6.79 KB, patch)
2010-04-27 19:05 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Kent Tamura
Comment 1
2010-04-27 06:12:49 PDT
Created
attachment 54411
[details]
Patch
Darin Adler
Comment 2
2010-04-27 13:04:19 PDT
Comment on
attachment 54411
[details]
Patch In what way is this "incorrect arithmetic"? Can we re-title the bug to be clearer? I don't understand the comment "No need to calculate the selection length in a case of selection drag-and-drop." - The comment doesn't say why focused() is a reliable way to detect the fact that selected text is being dragged within the element. - The comment doesn't say why setting selectionLength to 0 is a good way to bypass the selection check entirely. The main purpose of comments is to explain why the code exists. The code can speak for itself on *what* it does. I am not convinced that setting selectionLength to 0 is the best way to handle this.
Kent Tamura
Comment 3
2010-04-27 19:05:38 PDT
Created
attachment 54498
[details]
Patch (rev.2)
mitz
Comment 4
2010-04-27 19:09:43 PDT
This seems to be a regression from Safari 4.0.5. Any idea what caused it? I am asking because whatever it was may have had other side effects that your patch will not address.
Kent Tamura
Comment 5
2010-04-27 19:11:11 PDT
Thank you for reviewing (In reply to
comment #2
)
> I don't understand the comment "No need to calculate the selection length in a > case of selection drag-and-drop." > - The comment doesn't say why focused() is a reliable way to detect the fact > that selected text is being dragged within the element. > - The comment doesn't say why setting selectionLength to 0 is a good way to > bypass the selection check entirely. > The main purpose of comments is to explain why the code exists. The code can > speak for itself on *what* it does. > > I am not convinced that setting selectionLength to 0 is the best way to handle > this.
I updated the comments. I think the new comments explain them. And I removed the existing comment "// selection() may be a pre-edit text.". I added it when I fixed an issue for IME, but the comment is not helpful for now though it was helpful during the IME change.
mitz
Comment 6
2010-04-27 19:23:51 PDT
Caused by <
http://trac.webkit.org/changeset/48698
>.
mitz
Comment 7
2010-04-27 19:26:11 PDT
<
rdar://problem/7915903
>
Kent Tamura
Comment 8
2010-04-27 19:27:58 PDT
(In reply to
comment #6
)
> Caused by <
http://trac.webkit.org/changeset/48698
>.
Or
r48011
. The assertion has been there for a long time. The code have never considered text drag-and-drop, but it worked accidentally. It seems my change exposed the problem.
Kent Tamura
Comment 9
2010-04-29 04:27:17 PDT
Landed as
r58502
.
WebKit Review Bot
Comment 10
2010-04-29 04:50:13 PDT
http://trac.webkit.org/changeset/58502
might have broken GTK Linux 32-bit Release
Kent Tamura
Comment 11
2010-04-29 05:03:50 PDT
(In reply to
comment #10
)
>
http://trac.webkit.org/changeset/58502
might have broken GTK Linux 32-bit > Release
I'll add the test to the skipped list for GTK and Qt.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug