Closed
Bug 301357
Opened 19 years ago
Closed 19 years ago
Simplify context menu selection code
Categories
(Firefox :: Menus, enhancement)
Firefox
Menus
Tracking
()
VERIFIED
FIXED
Firefox1.5
People
(Reporter: polidobj, Assigned: martijn.martijn)
Details
(Keywords: verified1.8)
Attachments
(1 file, 3 obsolete files)
|
1.78 KB,
patch
|
mconnor
:
review+
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050719 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050719 Firefox/1.0+ This can be reproduced using the 'Vote for this bug' link. The bug seems to require text before the link. For example the 'Votes' link functions properly. Reproducible: Always Steps to Reproduce: 1.Select the text of a link using the mouse from the left edge of the link. 2.Right click on the selected text. Actual Results: No copy option is present on the context menu. Expected Results: A copy menu item should be present. This also occurs when selecting a link with caret browsing with the same requirements.
| Reporter | ||
Updated•19 years ago
|
Keywords: regression
| Reporter | ||
Comment 1•19 years ago
|
||
The regression time frame for this seems to be: 6/13 OK 6/14 broken From the build thread for 6/14: http://forums.mozillazine.org/viewtopic.php?t=279117 I'd point to this bug fix: bug 293758 [Firefox]-Context menu screw-up with data and javascript protocol images [All]
| Assignee | ||
Comment 2•19 years ago
|
||
Ah! I get the same regression period, independantly. However, I think the fix for bug 280284 is more likely the cause of this bug.
Comment 3•19 years ago
|
||
Confirmed, Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050718 Firefox/1.0+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.8b4?
| Assignee | ||
Comment 4•19 years ago
|
||
Ok, this part of the patch in bug 280284 returns true: if (node.nodeType == node.TEXT_NODE && node.nodeValue.length == 0) { So when selecting from the left to the right directly before a link, you begin with an empty textnode. That doesn't seem logical in itself, but the code of that patch is also not good. Probably the collapsed property of a range object is best used here.
| Assignee | ||
Comment 5•19 years ago
|
||
Like this. This fixes it for me.
Attachment #189844 -
Flags: review?(mconnor)
| Reporter | ||
Comment 6•19 years ago
|
||
Is this possibly a dupe of bug 301466 which was just checked in? The patch is different but changes the same area.
| Assignee | ||
Comment 7•19 years ago
|
||
You're right, Brian, it is the same bug. However, I think my patch is better (imho). I'll ask in that bug.
Comment 8•19 years ago
|
||
Yes, this patch is much simpler and works better than the kludge in the other patch. Martijn, do you want to update your patch now that the other one has been checked in?
| Assignee | ||
Comment 9•19 years ago
|
||
I've diffed this locally, and again tested the patch.
Attachment #189844 -
Attachment is obsolete: true
| Assignee | ||
Updated•19 years ago
|
Attachment #189844 -
Flags: review?(mconnor)
| Assignee | ||
Comment 10•19 years ago
|
||
This is even a bit simpler (based on some sharp suggestions by Gavin). I've also tested this patch a bit, for not breaking anything (and fixing the issue).
Attachment #189940 -
Attachment is obsolete: true
Attachment #189944 -
Flags: review?(mconnor)
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b4+
Comment 11•19 years ago
|
||
Changing summary to reflect new intent of bug.
Assignee: nobody → martijn.martijn
Severity: normal → enhancement
Keywords: regression
OS: Windows XP → All
Hardware: PC → All
Summary: Copy context menu item missing when selecting a link's text → Simplify context menu selection code
Target Milestone: --- → Firefox1.1
Version: unspecified → Trunk
Comment 12•19 years ago
|
||
+ return ((selection.rangeCount >= 1) && !selection.getRangeAt(0).collapsed) Shouldn't this be true if *any* range in the selection is uncollapsed?
| Assignee | ||
Comment 13•19 years ago
|
||
Comment on attachment 189944 [details] [diff] [review] patch3 Yes, you're right. Probably I can use the isCollapsed property on the selection object to simplify this code even more: http://mozref.com/reference/objects/Selection#isCollapsed
Attachment #189944 -
Flags: review?(mconnor)
| Assignee | ||
Comment 14•19 years ago
|
||
I've tested that this works correctly. There is a potential issue where you have multiple ranges and all of the instances of the ranges are collapsed, then you get the "View Selection Source", when you probably shouldn't, but I think that is a situation that virtually never happens.
Attachment #189944 -
Attachment is obsolete: true
Attachment #191399 -
Flags: review?(mconnor)
Comment 15•19 years ago
|
||
WFM Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050806 Firefox/1.0+ ID:2005080619 Context menu: Open Link in New Window Open Link in New Tab ---------------- Bookmark This Link... Save Link As... Send Link... Copy Link Location Copy ---------------- Search Web for "" View Selection Source Properties
Updated•19 years ago
|
Whiteboard: [ETA ?]
Updated•19 years ago
|
Whiteboard: [ETA ?] → [ETA ?][needs review mconnor]
Comment 16•19 years ago
|
||
Comment on attachment 191399 [details] [diff] [review] patch4 Please get this in on the trunk, and then request branch approval after a couple of days.
Attachment #191399 -
Flags: review?(mconnor) → review+
Comment 17•19 years ago
|
||
Trunk: Checking in browser.js; /cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js new revision: 1.490; previous revision: 1.489 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [ETA ?][needs review mconnor]
Updated•19 years ago
|
Attachment #191399 -
Flags: approval1.8b4?
Comment 19•19 years ago
|
||
v.fixed with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050829 Firefox/1.6a1. I see the same context menu as in comment #15. We should get this onto the branch.
Status: RESOLVED → VERIFIED
Updated•19 years ago
|
Attachment #191399 -
Flags: approval1.8b4? → approval1.8b4+
Comment 20•19 years ago
|
||
1.8 Branch: Checking in browser.js; /cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js new revision: 1.479.2.20; previous revision: 1.479.2.19 done
Keywords: fixed1.8
Comment 21•19 years ago
|
||
verified on Firefox 1.4 -mozilla1.8 branch- Win, Lin and Mac : 2005-09-07
Keywords: fixed1.8 → verified1.8
You need to log in
before you can comment on or make changes to this bug.
Description
•