Open
Bug 150337
Opened 22 years ago
Updated 4 years ago
[FIX] Previous button doubles factor
Categories
(SeaMonkey :: Search, defect)
SeaMonkey
Search
Tracking
(Not tracked)
NEW
People
(Reporter: mmcguigan, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
caillon
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020605
BuildID: 2002060511
Previous button doubles factor and sends user back two pages in results instead
of the previous results page.
Reproducible: Always
Steps to Reproduce:
1.Use any search plugin that has both the Next and Previous buttons enabled
using a factor. Most of them use a factor.
2.Search for something that will return several pages of results.
3.Use the Next button to go forward more than one page in the results.
4.Use the Previous button.
Actual Results: Using Previous button displays the results from the page prior
to the previous page.
Expected Results: Previous button should go back one page in the results.
Updated•22 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•22 years ago
|
||
This problem of moving double the factor when pressing the previous button
should probably be listed as a seperate bug, but I believe I've found it's
cause.
The "showMoreResults" function in search-panel.js:
http://lxr.mozilla.org/seamonkey/source/xpfe/components/search/resources/search-
panel.js#996
And the "computeIndex" function in nsInternetSearchService.cpp:
http://lxr.mozilla.org/seamonkey/source/xpfe/components/search/src/nsInternetSea
rchService.cpp#4482
Both decrement the "page" index by one when hitting "previous". "page" is then
multiplied by "factor".
This side-effect of computeIndex is well-hidden by the fact that computeIndex
is called via "getInputs" in InternetSearchService.cpp (line 4475). getInputs
is called by "GetInternetSearchURL" in InternetSearchService.cpp, which is the
function that is called from search-panel.js.
getInputs doesn't increment the page number when asked for the _next_ index, so
it is somewhat inconsistent. Either the SearchService or the search-panel
should be responsible for tracking the current index, not both.
Anyways, that's my interpretation of that oddity. It can be solved by removing
lines 4659 to 4664 in nsInternetSearchService.cpp, but there might be other
things that rely on this side-effect. It can also be solved by removing lines1
011 and 1012 in search-panel.js, but that would probably be bad "practice" to
rely on an undocumented side-effect of a function buried three calls deep.
Sam
Updated•22 years ago
|
Comment 2•21 years ago
|
||
I have found independently the same solution as Sam Schinke.
The page number is incrementing and decrementing in search-panel.js, so the
other decrementing of page in nsInternetSearchService.cpp is wrong.
I have looked for any possible interferences and there is no problem.
Comment 3•21 years ago
|
||
Adding a patch. Can someone review it?
Comment 4•21 years ago
|
||
Comment on attachment 127433 [details] [diff] [review]
patch removing wrong page decreasing
Samir, can you please review this attachment?
Attachment #127433 -
Flags: review?(sgehani)
Updated•21 years ago
|
Blocks: 123569
Summary: Previous button doubles factor. → [FIX] Previous button doubles factor
Comment 5•21 years ago
|
||
Removing blocking 123569 since this bug has not been pushed out or futured.
Let's wait for Samirs review and try to get a super-review first.
No longer blocks: 123569
Comment 6•21 years ago
|
||
The same patch as attachment 127433 [details] [diff] [review], but better formed and make against actual
file version in CVS.
Updated•21 years ago
|
Attachment #127433 -
Attachment is obsolete: true
Updated•21 years ago
|
Attachment #137570 -
Flags: review?(sgehani)
Comment 7•20 years ago
|
||
Update to the previous patch which appears to have bit rotten. Thanks.
Attachment #137570 -
Attachment is obsolete: true
Attachment #174554 -
Flags: superreview?(alecf)
Attachment #174554 -
Flags: review?(caillon)
Comment 8•20 years ago
|
||
I have included this patch in the patch for bug 150333 since they both affect
the same file and are both simple patches.
Comment 9•20 years ago
|
||
This removes the page decrement as the earlier patch did and also removes the
direction arg which was used for the decrement and is no longer needed. I
checked lxr for other consumers and did not find any.
Assignee: samir_bugzilla → moz_bugzilla
Attachment #174554 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #174866 -
Flags: superreview?(alecf)
Attachment #174866 -
Flags: review?(caillon)
Updated•20 years ago
|
Attachment #174554 -
Flags: superreview?(alecf)
Attachment #174554 -
Flags: review?(caillon)
Comment 10•20 years ago
|
||
*** Bug 285539 has been marked as a duplicate of this bug. ***
Comment 11•20 years ago
|
||
Comment on attachment 127433 [details] [diff] [review]
patch removing wrong page decreasing
clearing stale requests
Attachment #127433 -
Flags: review?(samir_bugzilla)
Updated•20 years ago
|
Attachment #137570 -
Flags: review?(samir_bugzilla)
Updated•20 years ago
|
Attachment #174866 -
Flags: superreview?(alecf) → superreview+
Updated•20 years ago
|
Attachment #174866 -
Flags: review?(caillon) → review+
Updated•19 years ago
|
Assignee: rob_strong → search
Status: ASSIGNED → NEW
QA Contact: claudius
Updated•16 years ago
|
Product: Core → SeaMonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•