Dragging & dropping text from a link into the Find text box copies link location and not text

RESOLVED WORKSFORME

Status

()

Toolkit
Find Toolbar
P5
minor
RESOLVED WORKSFORME
13 years ago
8 months ago

People

(Reporter: jorgev, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

When I drag and drop text from a link into the find bar, the URL that
corresponds to the link is copied into the textbox, instead of the selected
text. This is inconsistent with the rest of the page, where you can select any
text and drag it into the find bar, copying the actual text.

Reproducible: Always

Steps to Reproduce:
1. Go to any page with links.
2. Select all (or part) of the text in the link.
3. Open the Find bar (Ctrl+F).
4. Drag and drop the text into the Find bar.

Actual Results:  
The URL of the link is copied into the Find textbox.

Expected Results:  
The selected text is copied into the Find textbox.

Comment 1

13 years ago
I can sometimes reproduce this, but not always. If I start selecting text to the
far left of a link (with some space) I can get the text to be copied. But if I
start selecting directly next to the link then I usually get the URL.
(Reporter)

Comment 2

13 years ago
Yes, if any text besides the one in the link is selected, the text is copied. If
the selection is entirely contained in the link text, then the URL is copied
instead of the text. 
(Reporter)

Comment 3

13 years ago
Depends on Bug 296827 since it requires a DND observer.
Depends on: 296827
(Reporter)

Comment 4

13 years ago
Created attachment 186704 [details] [diff] [review]
Patch V1

This patch depends on patch 185838 which adds the DND observer, particularly
the getSupportedFlavors function. Basically I added a new flavor:
"text/unicode-2" which handles the selected text rather than the link location.
This could work for the search bar and other text fields which don't need URLs
but the selected text instead.
I haven't tested this patch since I'm unable to compile the source due to the
crappiness of my gear :(.
I cannot reproduce this issue using a current trunk build.  Is this a branch
only issue?
(Reporter)

Comment 6

13 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050619
Firefox/1.0+
No, I can reproduce this on Deer Park. Perhaps the steps to reproduce aren't clear:
1. Open any HTML page with links (<a> tags).
2. Select the text in any anchor on the page, for instance the 'reply' on the
header of this comment. Select _only_ letters in the anchor. Do not include the
[] or any other surrounding text.
3. Open the Find bar (Ctrl+F).
4. Drag and drop the text into the Find bar.

Actual Results:  
The URL of the link is copied into the Find textbox.

Expected Results:  
The selected text is copied into the Find textbox.
(In reply to comment #6)

> 4. Drag and drop the text into the Find bar.

Ah, I see the issue now.  It only fails with drag and drop.  Copy/paste works
just fine.

Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
+      // XXXBlake Workaround caret crash when you try to set the textbox's
value on dropping
+      setTimeout(function(u) { findField.value = u; find(u); }, 0, aXferData.data);
This workaround is not necessary anymore since bug 296464 got fixed.
(Reporter)

Comment 9

13 years ago
Created attachment 196462 [details] [diff] [review]
Patch V2 - Eliminated timeout workaround

As per comment #8, timeout workaround has been removed.
Attachment #186704 - Attachment is obsolete: true
(Reporter)

Comment 10

13 years ago
Created attachment 196918 [details] [diff] [review]
Patch V3 - Updated after fix of Bug 296827

With Bug 296827 fixed, I think this patch is ready for review. What's most
important to decide is the name for the new flavour. I chose "text/unicode-2",
which might not be the best name.
Attachment #196462 - Attachment is obsolete: true
Attachment #196918 - Flags: review?(mconnor)
Comment on attachment 196918 [details] [diff] [review]
Patch V3 - Updated after fix of Bug 296827

moa=me for the toolkit parts, but the widget/content stuff should be reviewed by an appropriate peer (and I'm pretty sure this isn't branch-safe_
Attachment #196918 - Flags: review?(mconnor)
(Assignee)

Updated

10 years ago
Product: Firefox → Toolkit

Comment 12

6 years ago
Since the avent of Paste & Search in the searchbar, this has become a major problem since it is now normal expected behavior to be able to drag text into the searchbar and instantly get search results.
Priority: -- → P5
No longer blocks: 1297842
(Reporter)

Comment 13

8 months ago
This seems to be fixed on Nightly now.
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.