Closed Bug 250274 Opened 20 years ago Closed 19 years ago

Find Toolbar: Esc doesn't focus link

Categories

(Toolkit :: Find Toolbar, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8final

People

(Reporter: jruderman, Assigned: masayuki)

References

Details

0. Load http://www.cs.hmc.edu/~jruderma/s/.
1. Press Ctrl+F.  (Don't use links-only mode.)
2. Type "ev".
3. Press Esc.

Expected: focus on the "Everything2" link so I can press Enter to follow the link.

Result: focus is on the body.  Pressing Tab at this point focuses the item
*after* the link that was found.

The Firefox Find dialog did not have this problem.  Internet Explorer's Find
dialog does have this problem, but it only takes one extra press of the Tab key
to work around it, while Firefox requires Tab followed by Shift+Tab.
-> Find Toolbar component.
Component: General → Find Toolbar / FastFind
-> FIXED

by bug 259454.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
I still see this bug using
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050707
Firefox/1.0+
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
-> INVA.

Comment 0 said:
> 1. Press Ctrl+F.  (Don't use links-only mode.)

The reason of invalid is here.
Bug 250922 comment 17.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → INVALID
The reason Ctrl+F, foo, Enter doesn't follow the link is that Enter has a
different meaning when the Find Toolbar has focus (find next).  But after you
press Esc, the Find Toolbar no longer has focus, so why not focus the found link?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
(In reply to comment #6)
> The reason Ctrl+F, foo, Enter doesn't follow the link is that Enter has a
> different meaning when the Find Toolbar has focus (find next).  But after you
> press Esc, the Find Toolbar no longer has focus, so why not focus the found link?

Currently design, *Ctrl + F does not find the link*. it finds the text.
See the source code.

http://lxr.mozilla.org/seamonkey/source/toolkit/components/typeaheadfind/content/findBar.js#555
555 function find(val)
556 {
557   if (!val)
558     val = document.getElementById("find-field").value;
559 
560   enableFindButtons(val);
561 
562   var highlightBtn = document.getElementById("highlight");
563   if (highlightBtn.checked)
564     setHighlightTimeout();
565 
566   changeSelectionColor(true);
567 
568   var fastFind = getBrowser().fastFind;
569   var res = fastFind.find(val, gFindMode == FIND_LINKS);
570   updateFoundLink(res);
571   updateStatus(res, true);
572 
573   if (gFindMode != FIND_NORMAL)
574     setFindCloseTimeout();
575 }

If we want to find the link always, #569's second param should be true.
But currently design, it is true when the FAYT's find link mode only.
We didn't find the link in Ctrl + F,
so we *cannot* set focus to any link in this time.

If you want to reopen this bug. Please file a new bug that is request for always
to find a link. And if that *enhancement* is fixed and this bug is happend, you
should reopen this bug.

OTHERWISE, PLEASE DON'T REOPEN THIS BUG.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → INVALID
Oops. Sorry.
If we fix the request, we should not change the findbar.js.
We should change following:

http://lxr.mozilla.org/seamonkey/source/toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp#431
nsTypeAheadFind::FindItNow
431       if (mFocusLinks) {
432         nsIEventStateManager *esm = presContext->EventStateManager();
433         PRBool isSelectionWithFocus;
434         esm->MoveFocusToCaret(PR_TRUE, &isSelectionWithFocus);
435         if (isSelectionWithFocus) {
436           nsCOMPtr<nsIContent> lastFocusedContent;
437           esm->GetLastFocusedContent(getter_AddRefs(lastFocusedContent));
438           nsCOMPtr<nsIDOMElement>
439             lastFocusedElement(do_QueryInterface(lastFocusedContent));
440           mFoundLink = lastFocusedElement;
441         }
442       }

We don't need #431's statement if always we should find the link instead of text.
Or we need to change following(here is better than comment #8).

http://lxr.mozilla.org/seamonkey/source/toolkit/components/typeaheadfind/content/findBar.js#748
748 function setFindMode(mode)
749 {
750   if (mode == gFindMode)
751     return;
752 
753   gFindMode = mode;
754   var fastFind = getBrowser().fastFind;
755   fastFind.focusLinks = (gFindMode != FIND_NORMAL);
756 }

#755 fastFind.focusLinks is always true.
OS: Windows XP → All
Hardware: PC → All
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Assignee: firefox → masayuki
Status: REOPENED → NEW
This is fixed by bug 296720's patch.
Status: NEW → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox1.1
*** Bug 293352 has been marked as a duplicate of this bug. ***
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.