Closed Bug 604532 Opened 14 years ago Closed 14 years ago

Copying from location bar copies the old URL (?)

Categories

(Core :: DOM: Editor, defect)

x86
macOS
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- final+

People

(Reporter: jruderman, Assigned: ehsan.akhgari)

References

Details

(Keywords: regression)

Attachments

(1 file)

Using: Firefox trunk on Mac, local build

Steps to reproduce:
1. Cmd+L
2. Right
3. Type "xxx"
4. Cmd+A
5. Cmd+X

Result: the "xxx" part of the URL is not moved to the clipboard.

I've been hitting this bug frequently, with slightly different steps, while trying to copy URLs from Firefox into IRC.

I don't know if this is a Location Bar bug or an Editor bug.
blocking2.0: --- → ?
I'm pretty sure that this is the editor...
Assignee: nobody → ehsan
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Meant to set the status to ASSIGNED...
Status: RESOLVED → UNCONFIRMED
Ever confirmed: false
Resolution: FIXED → ---
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
The location bar has its own controller for copy and cut operations.  Here is the code responsible for grabbing the selected part of the text from the location bar:

<http://mxr.mozilla.org/mozilla-central/source/browser/base/content/urlbarBindings.xml#425>

What's incorrect here is the value returned by selectionEnd.  The reason that this happens is that appending the text as done in comment 0 causes us to create a new textframe, and selectionEnd fails to handle that correctly.
Attached patch Patch (v1)Splinter Review
Attachment #483527 - Flags: review?(roc)
Attachment #483527 - Flags: approval2.0?
Blocks: 240933
Component: Location Bar → Editor
Product: Firefox → Core
QA Contact: location.bar → editor
Comment on attachment 483527 [details] [diff] [review]
Patch (v1)

Don't we need to fix urlBindings.xml as well? It shouldn't be depending on this.
Attachment #483527 - Flags: review?(roc)
Attachment #483527 - Flags: review+
Attachment #483527 - Flags: approval2.0?
Attachment #483527 - Flags: approval2.0+
(In reply to comment #5)
> Comment on attachment 483527 [details] [diff] [review]
>   --> https://bugzilla.mozilla.org/attachment.cgi?id=483527
> Patch (v1)
> 
> Don't we need to fix urlBindings.xml as well? It shouldn't be depending on
> this.

I don't think there's anything wrong with urlbarBindings.xml.  It's realying on selectionStart and selectionEnd, which are APIs that we expose to content.  I don't see what's wrong with depending on those APIs.
Whiteboard: [needs landing]
roc: see comment 6 please.
http://hg.mozilla.org/mozilla-central/rev/ec9b314fdb5f
Flags: in-testsuite+
Whiteboard: [needs landing]
Target Milestone: --- → mozilla2.0b8
Status: ASSIGNED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: