Closed
Bug 252110
Opened 21 years ago
Closed 21 years ago
window.find() does not work properly without parameters
Categories
(Toolkit :: Find Toolbar, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 250409
People
(Reporter: gwagner, Assigned: bugzilla)
Details
(Keywords: testcase)
Attachments
(1 file)
|
480 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2
Given the following script/HTML:
<script type="text/javascript">
function findDialog() {
if (typeof window.find == 'function') {
window.find();
}
return false;
}
</script>
<p><a href="#" onclick="return findDialog();">Test</a></p>
<p>This is a line with some text to be found</p>
Clicking the "Test" link should make the "Find in This Page" dialog appear
(similar to CTRL+F). Entering the word "found" and clicking "Find Next" should
highlight the word "found". It does nothing.
After clicking "Cancel" in the "Find in This Page" dialog, subsequent clicks on
"Test" result in the Javascript error: "Error: findDialog is not a function".
Somehow the very act of calling window.find() is destroying the function
encapsulating the call to it (note: renaming findDialog() to something else
resolves this issue, however, why does an internal dialog overwrite a
user-defined function in the Javascript namespace?)
Reproducible: Always
Steps to Reproduce:
1. paste the provided code into an HTML document and load it into Firefox 0.9.2
2. click "Test"
3. enter "found" in the "Find what" input, click "Find Next"
Actual Results:
Nothing happens.
Expected Results:
Firefox should have highlighted the word "found".
The supplied code produces a working "Find in this page" dialog in Mozilla 1.7.1
(it highlights search terms found in the page). However, even in Mozilla 1.7.1,
subsequent clicks on "Test" result in the "findDialog is not a function". As
with Firefox, renaming "findDialog()" to something else avoids the error, but
the internal name of the "Find in this page" dialog probably shouldn't overwrite
user-defined functions.
Comment 1•21 years ago
|
||
This one sounds invalid.
It would make sense that the Find dialog has been disconnected, but not
entirely removed yet. If that is the case, there is no bug here. If that is
*not* the case, then this does seem like a bug to me. I think I'll confirm it
so someone who knows (like blake) might see it on their radar. I'll add the
testcase though (just what the reporter used for an example)
Comment 2•21 years ago
|
||
Sorry for spam. OS -> All, adding CC, confirming, testcase keyword.
Comment 3•21 years ago
|
||
It appears that the find dialog isn't supposed to come up.
*** This bug has been marked as a duplicate of 250409 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Updated•17 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•