Closed Bug 896986 Opened 11 years ago Closed 11 years ago

Recent closed tab history middle click only opens top entry

Categories

(Firefox :: Menus, defect)

25 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 26
Tracking Status
firefox24 --- unaffected
firefox25 + disabled
firefox26 --- fixed

People

(Reporter: jmjjeffery, Assigned: jaws)

References

Details

(Keywords: regression)

Attachments

(1 file, 3 obsolete files)

Looks like the issue with Recently Closed tabs has returned.

STR:
Click App-button
Click Recent Closed tabs
Try to open any tab in the closed tab list - using middle-click
NOTE: that the Top tab in the 'recent closed' list is the only one that will open.


Seems to fail if link is opened with middle-click - normal click on recent closed will open the tab...
Also happens in a new profile - no addons

cset af4e3ce8c487 ok
cset 0d0263a58f06 bad

http://hg.mozilla.org/mozilla-central/p ... 0263a58f06 regression range <- 223 cset's

need help finding the m-i regressor
Forgot to add that left-clicking opens the link in a 'New Tab' unlike the old way of opening it on the 'active' tab, that's why using middle-click is desired if you want to reopen it in a new tab rather than the currently displayed 'active' tab.
while the code lives in the history menu, it's not related to Bookmarks & History functionality, moving to menus.
Component: Bookmarks & History → Menus
Blocks: 887515
Severity: major → normal
Version: Trunk → 25 Branch
This may have possibly came as a result in the change of behavior with undoCloseTab.
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Attached patch Patch (obsolete) — Splinter Review
HistoryMenu._undoCloseMiddleClick called undoCloseTab with the index as a String, and undoCloseTab was only accepting Number arguments. It's more important to fix undoCloseTab since there may be other callers that are passing a string as the argument.
Attachment #790371 - Flags: review?(dao)
If you're getting rid of the restriction that it has to be passed a number, shouldn't you remove the isInteger check entirely and just always coerce? Or does it still need to distinguish undefined, in which case an explicit check would probably be better...
Attached patch Patch v2 (aurora) (obsolete) — Splinter Review
Good point. The previous patch actually had a bug with this in that it entered the code path for restoring multiple tabs. This is now fixed.
Attachment #790371 - Attachment is obsolete: true
Attachment #790371 - Flags: review?(dao)
Attachment #790447 - Flags: review?(gavin.sharp)
Attached patch alternate patch (obsolete) — Splinter Review
Your patch works, but I took this opportunity to clean up a bit:
- use explicit vs. implicit conversion (Number() vs. +)
- adjust the bounds checking code to be more readable, the old code was hard to follow
Attachment #790447 - Attachment is obsolete: true
Attachment #790447 - Flags: review?(gavin.sharp)
Attachment #790464 - Flags: review+
Attachment #790464 - Flags: feedback?(jaws)
For aurora uplift, I'm fine just taking your patch FWIW.
Comment on attachment 790464 [details] [diff] [review]
alternate patch

Review of attachment 790464 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/browser.js
@@ +6208,3 @@
>    }
>  
>    while (numberOfTabsToUndoClose > 0 &&

Please move the declaration of |tab| to before the while loop since it is now not referenced until later.
Attachment #790464 - Flags: feedback?(jaws) → feedback+
Comment on attachment 790447 [details] [diff] [review]
Patch v2 (aurora)

Marking r+ based on https://bugzilla.mozilla.org/show_bug.cgi?id=896986#c8.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 887515
User impact if declined: The "Recently Closed Tabs" menu is broken.
Testing completed (on m-c, etc.): locally
Risk to taking this patch (and alternatives if risky): none expected
String or IDL/UUID changes made by this patch: none
Attachment #790447 - Attachment description: Patch v2 → Patch v2 (aurora)
Attachment #790447 - Attachment is obsolete: false
Attachment #790447 - Flags: review+
Attachment #790447 - Flags: approval-mozilla-aurora?
Attachment #790447 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 790447 [details] [diff] [review]
Patch v2 (aurora)

This doesn't handle aIndex being 0, as far as I can see. numberOfTabsToUndoClose should be 0 in that case.
Attachment #790447 - Flags: review-
Comment on attachment 790464 [details] [diff] [review]
alternate patch

This has the same problem.
Attachment #790464 - Flags: review-
(In reply to Dão Gottwald [:dao] from comment #12)
> Comment on attachment 790447 [details] [diff] [review]
> Patch v2 (aurora)
> 
> This doesn't handle aIndex being 0, as far as I can see.
> numberOfTabsToUndoClose should be 0 in that case.

Err, numberOfTabsToUndoClose needs to be 1 of course.
I would recommend:

  if (isNaN(index)) {
    index = 0;
    numberOfTabsToUndoClose = ss.getNumberOfTabsClosedLast(window);
  } else {
    if (index < 0 || index >= ss.getClosedTabCount(window))
      return null;
    numberOfTabsToUndoClose = 1;
  }
Thanks, good catch. Somewhat embarassing!

I went with your suggestion:
https://hg.mozilla.org/integration/fx-team/rev/636e3b9d1f72

We should have a test for this...
https://hg.mozilla.org/mozilla-central/rev/636e3b9d1f72
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
So....what needs uplifting here? The Aurora patch with a+ and r- or the patch that managed to land but doesn't have approval?
Attachment #790447 - Flags: approval-mozilla-aurora+
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #19)
> So....what needs uplifting here? The Aurora patch with a+ and r- or the
> patch that managed to land but doesn't have approval?

A new patch will need to be written and I'll re-request aurora approval. The patch that made it to m-c is good.
Attached patch fixed patchSplinter Review
Let's just go with the same patch for Aurora.
Attachment #790447 - Attachment is obsolete: true
Attachment #790464 - Attachment is obsolete: true
Attachment #791445 - Flags: approval-mozilla-aurora+
Backed out of Firefox 25 since the parent bug (887515) has been backed out of Fx25.
Backed out by bug 914258.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: