Closed
Bug 285647
Opened 19 years ago
Closed 19 years ago
The maximum number of entries in the forward button dropdown list is only 14, in the back button dropdown list are up to 15 Elements
Categories
(Firefox :: Bookmarks & History, defect)
Firefox
Bookmarks & History
Tracking
()
RESOLVED
FIXED
Firefox1.5
People
(Reporter: juergenbinder, Assigned: csthomas)
Details
Attachments
(2 files, 1 obsolete file)
2.04 KB,
patch
|
mconnor
:
review+
asa
:
approval-aviary1.1a1+
|
Details | Diff | Splinter Review |
2.34 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050310 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050310 Firefox/1.0+ The back button dropdown list has 15 or less entries, but the forward button dropdown list has only 14 or less entries. Fixing: Add in the line 2446 "+ 1" before the colon: "? index + MAX_HISTORY_MENU_ITEMS + 1 :" fixes the bug. http://lxr.mozilla.org/aviary101branch/source/browser/base/content/browser.js#2446 Reproducible: Always Steps to Reproduce: 1. Have enough pages in forward and back history 2. click the buttons 3. count Actual Results: The back button dropdown list has 15 or less entries, but the forward button dropdown list has only 14 or less entries. Expected Results: Both dropdown list should have 15 entries
Updated•19 years ago
|
Assignee: nobody → bugs
Status: UNCONFIRMED → NEW
Component: History: Session → History
Ever confirmed: true
Product: Core → Firefox
QA Contact: history.session → mozilla
Comment 1•19 years ago
|
||
That fix doesn't look "the right one", see this: for (j = index - 1; j >= end; j--) vs. for (j = index + 1; j < end; j++) If we chang end by your fix, we might end up with another bug.
Reporter | ||
Comment 2•19 years ago
|
||
I don't get your point. You should add the "+1" only in the forward case, of course, as the back case works right. And there it works right. If (count - index) is less than or equal than MAX_HISTORY_MENU_ITEMS, you get end = count, so just all available forward item are added. If (count - index) is greater than MAX_HISTORY_MENU_ITEMS, you should add MAX_HISTORY_MENU_ITEMS items to the dropdown list. But if end = index + MAX_HISTORY_MENU_ITEMS, you add only MAX_HISTORY_MENU_ITEMS - 1 items, as the for-loop goes from index + 1 only until (index + MAX_HISTORY_MENU_ITEMS - 1) < end [=index + MAX_HISTORY_MENU_ITEMS]. If you set end = index + MAX_HISTORY_MENU_ITEMS + 1, the for loop goes form index + 1 until index + MAX_HISTORY_MENU_ITEMS < end and adds so MAX_HISTORY_MENU_ITEMS. I fix it in this manner in my Extension, so you can test it, that it works so. http://browseimages.mozdev.org
Updated•19 years ago
|
Status: NEW → ASSIGNED
Updated•19 years ago
|
Assignee: bugs → garyvdm
Status: ASSIGNED → NEW
Flags: blocking-aviary1.1?
Comment 3•19 years ago
|
||
Attachment #179519 -
Flags: review?(bugs)
Comment 4•19 years ago
|
||
Comment on attachment 179519 [details] [diff] [review] Patch according to reporter. This is wrong, and a silly hack, as comment 2 pointed out. Changing j < end to j =< end to match the back syntax is the right fix for consistency if we're trying for 15. whoever attaches a correct fix, please fix http://lxr.mozilla.org/mozilla/source/toolkit/components/help/content/help.js#4 20 in the same patch.
Attachment #179519 -
Flags: review?(bugs) → review-
Assignee | ||
Updated•19 years ago
|
Assignee: garyvdm → cst
Severity: minor → trivial
Flags: blocking-aviary1.1?
Target Milestone: --- → Firefox1.1
Assignee | ||
Comment 5•19 years ago
|
||
Attachment #179519 -
Attachment is obsolete: true
Attachment #180242 -
Flags: review?(mconnor)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [cst: r?]
Reporter | ||
Comment 6•19 years ago
|
||
Now you get an uncaught exception in the case end == count. In this case in the last cycle of the for-loop is j == count == sessionHistory.count. That's an invalid index for sessionHistory.getEntryAtIndex(j, false).
Updated•19 years ago
|
Attachment #180242 -
Flags: review?(mconnor) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #180242 -
Flags: approval-aviary1.1a?
Assignee | ||
Updated•19 years ago
|
Whiteboard: [cst: r?] → [cst: a?]
Comment 7•19 years ago
|
||
Comment on attachment 180242 [details] [diff] [review] patch a=asa
Attachment #180242 -
Flags: approval-aviary1.1a? → approval-aviary1.1a+
Assignee | ||
Updated•19 years ago
|
Whiteboard: [cst: a?] → checkin
Assignee | ||
Comment 8•19 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: checkin
Comment 9•19 years ago
|
||
(In reply to comment #6) > Now you get an uncaught exception in the case end == count. In this case in the > last cycle of the for-loop is j == count == sessionHistory.count. That's an > invalid index for sessionHistory.getEntryAtIndex(j, false). they need to fix it by change this end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; with end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count-1;
Comment 10•19 years ago
|
||
fix: case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count-1; if ((index + 1) > end) return false; for (j = index + 1; j <= end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break;
Comment 11•19 years ago
|
||
Comment 12•19 years ago
|
||
(In reply to comment #10) > fix: > case "forward": > end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + > MAX_HISTORY_MENU_ITEMS : count-1; > if ((index + 1) > end) return false; > for (j = index + 1; j <= end; j++) > { > entry = sessionHistory.getEntryAtIndex(j, false); > if (entry) > createMenuItem(aParent, j, entry.title); > } > break; -> Bug 296275
Component: History → Bookmarks & History
QA Contact: mozilla → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•