Closed Bug 309030 Opened 20 years ago Closed 20 years ago

Don't scroll to found link on findbar close

Categories

(Toolkit :: Find Toolbar, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8final

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: regression, verified1.8)

Attachments

(2 files)

If a link is found in FAYT mode, when Find Toolbar is closed, we set focus to found link. But in this time, if the link is not in view, contents are scrolled to found link. It should not be so. we should lock scroll when we set focus to found link.
Status: NEW → ASSIGNED
Flags: blocking1.8b5?
Priority: -- → P1
Target Milestone: --- → Firefox1.5
Summary: Don't scroll to found link at FAYT finished. → Don't scroll to found link on findbar close
Personally, I find the current behavior pretty good (for FAYT).
Oh, nvm, i see the bug.
Comment on attachment 196520 [details] [diff] [review] Patch rv1.0 >Index: toolkit/components/typeaheadfind/content/findBar.js >=================================================================== >RCS file: /cvsroot/mozilla/toolkit/components/typeaheadfind/content/findBar.js,v >retrieving revision 1.24 >diff -u -8 -p -r1.24 findBar.js >--- toolkit/components/typeaheadfind/content/findBar.js 26 Aug 2005 04:21:37 -0000 1.24 >+++ toolkit/components/typeaheadfind/content/findBar.js 18 Sep 2005 11:52:02 -0000 >@@ -392,19 +392,27 @@ function delayedCloseFindBar() > var findToolbar = document.getElementById("FindToolbar"); > var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] > .getService(Components.interfaces.nsIWindowWatcher); > > if (window == ww.activeWindow) { > var focusedElement = document.commandDispatcher.focusedElement; > if (focusedElement && (focusedElement.parentNode == findToolbar || > focusedElement.parentNode.parentNode == findField)) { >- if (gFoundLink) >+ if (gFoundLink) { >+ // Don't scroll to found link. If contents are scrolled by the user, >+ // the scrolling is always occured after FAYT's scrolling. >+ // So, we should not cancel user's operations. >+ var suppressedScroll = document.commandDispatcher.suppressFocusScroll; >+ if (!suppressedScroll) >+ document.commandDispatcher.suppressFocusScroll = true; > gFoundLink.focus(); >- else >+ if (!suppressedScroll) >+ document.commandDispatcher.suppressFocusScroll = false; >+ } else > window.content.focus(); this works, but I'd rather see the comment and style changed to the following: if (gFoundLink) { // block scrolling on focus since find already scrolls, further scrolling // is due to user action, so don't override this var suppressedScroll = document.commandDispatcher.suppressFocusScroll; document.commandDispatcher.suppressFocusScroll = true; gFoundLink.focus(); document.commandDispatcher.suppressFocusScroll = suppressedScroll; } else
Attachment #196520 - Flags: review?(mconnor) → review+
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
The risk is low. And this is regression.
Flags: blocking1.8b5? → blocking1.8b5+
Comment on attachment 196617 [details] [diff] [review] Patch for check-in Approved for 1.8b5 per bug meeting
Attachment #196617 - Flags: approval1.8b5? → approval1.8b5+
Whiteboard: [needs approval]
Keywords: fixed1.8verified1.8
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: