Closed
Bug 921308
Opened 12 years ago
Closed 12 years ago
When find toolbar auto-hides it scrolls the page to the last search result
Categories
(Toolkit :: Find Toolbar, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: bzbarsky, Assigned: mikedeboer)
References
Details
(Keywords: regression)
Attachments
(1 file, 5 obsolete files)
3.82 KB,
patch
|
evilpies
:
review+
|
Details | Diff | Splinter Review |
BUILD: 2013-09-26 nightly, but I just updated from a few weeks back, so not sure yet when this got introduced
STEPS TO REPRODUCE:
1) Load http://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.cpp
2) Wait for the page to finish loading.
3) Type '/' and then type the string "constructsele" in the find toolbar that
pops up.
4) Hit PgDown three times.
5) Wait for the find toolbar to hide itself
EXPECTED RESULTS: When find toolbar hides, the page does not scroll
ACTUAL RESULTS: When find toolbar hides, the page scrolls back up to the text that was found in step 3.
This is driving me bananas, needless to say: one moment I'm reading code, the next moment I'm 300 lines from where I used to be. ;)
![]() |
Reporter | |
Comment 1•12 years ago
|
||
Regression range on m-c nightlies: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b9029b1de410&tochange=53d5e43e23cc
![]() |
Reporter | |
Comment 2•12 years ago
|
||
Bisect says:
The first bad revision is:
changeset: 147026:3734bebc9bfb
user: Tom Schuster <evilpies@gmail.com>
date: Fri Sep 13 10:41:23 2013 -0400
summary: Bug 666816 - Support findbar in e10s. r=mikedeboer
tracking-firefox26:
--- → ?
tracking-firefox27:
--- → ?
![]() |
Reporter | |
Comment 3•12 years ago
|
||
The old code had:
- // block scrolling on focus since find already scrolls, further
- // scrolling is due to user action, so don't override this
...
- fm.setFocus(element, fm.FLAG_NOSCROLL);
which the new code has totally lost.
Blocks: 666816
Updated•12 years ago
|
Comment 4•12 years ago
|
||
I think this code is not really e10s compatible, we will have to come up with a different solution. I will try to work on this sometime next week.
Updated•12 years ago
|
Assignee: nobody → evilpies
Comment 5•12 years ago
|
||
No need to track this for 26 given that we're tracking bug 916536.
tracking-firefox26:
+ → ---
Comment 6•12 years ago
|
||
Would you mind taking a shoot at this, while I review your patch?
Assignee: evilpies → mdeboer
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #6)
> Would you mind taking a shoot at this, while I review your patch?
Aye, will do.
Assignee | ||
Updated•12 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•12 years ago
|
||
Ahum. So, since we can't use the focus-manager anymore and use the DOM .focus() method, I needed to 'invent' the handler that implements the desired behavior myself.
Introducing `focusWithoutScrolling`! It's amazing, sweeter than unicorn piss, will cure cancer and make you a barista at the same time.
(sorry about that ;) )
Tom, is this e10s-proof?
Attachment #817184 -
Flags: review?(evilpies)
Comment 9•12 years ago
|
||
I think you should try using the FocusManager like the old code: http://mxr.mozilla.org/mozilla-beta/source/toolkit/content/widgets/findbar.xml#1183.
This should be e10s safe (minus some focusing problems that are not your fault)
Comment 10•12 years ago
|
||
Especially not the NOSCROLL flag :)
Assignee | ||
Comment 11•12 years ago
|
||
Note that this also fixes bug 921338.
Try push to make sure this'll turn up green:
https://tbpl.mozilla.org/?tree=Try&rev=72a86ee19693
Attachment #817184 -
Attachment is obsolete: true
Attachment #817184 -
Flags: review?(evilpies)
Attachment #817322 -
Flags: review?(evilpies)
Assignee | ||
Comment 12•12 years ago
|
||
fixed whitespace nit.
Attachment #817322 -
Attachment is obsolete: true
Attachment #817322 -
Flags: review?(evilpies)
Attachment #817328 -
Flags: review?(evilpies)
Assignee | ||
Comment 13•12 years ago
|
||
trying to reach nirvana, ehm, no wait, I meant e10s compat.
Attachment #817328 -
Attachment is obsolete: true
Attachment #817328 -
Flags: review?(evilpies)
Attachment #817347 -
Flags: review?(evilpies)
Assignee | ||
Updated•12 years ago
|
Attachment #817347 -
Flags: review?(evilpies)
Assignee | ||
Comment 14•12 years ago
|
||
Introducing the |onFocusContent| event.
Attachment #817347 -
Attachment is obsolete: true
Attachment #817808 -
Flags: review?(evilpies)
Assignee | ||
Comment 15•12 years ago
|
||
Removed a blank (new)line. Sorry for spamming.
Attachment #817808 -
Attachment is obsolete: true
Attachment #817808 -
Flags: review?(evilpies)
Attachment #817810 -
Flags: review?(evilpies)
Comment 16•12 years ago
|
||
Comment on attachment 817810 [details] [diff] [review]
Patch v1.5: don't scroll when an element is focused on findbar close
Review of attachment 817810 [details] [diff] [review]:
-----------------------------------------------------------------
Good idea! We we can send synchronous message from the child to the parent, so this is e10s compatible.
::: toolkit/modules/Finder.jsm
@@ +113,5 @@
>
> focusContent: function() {
> + // Allow Finder listeners to cancel focusing the content.
> + for (let l of this._listeners) {
> + if (l.onFocusContent() === false)
I don't think this a good name. Maybe something like "canFocusContent" or "should"? "on" suggest something like an event listener. I am also not a big fan of === false, I would prefer if (!
::: toolkit/modules/RemoteFinder.jsm
@@ +110,5 @@
> },
>
> + //XXXmikedeboer-20131016: implement |onFocusContent| here to mitigate issues
> + // like bug 921338 and bug 921308.
> + onFocusContent: function () {},
I can implement this if you want.
Attachment #817810 -
Flags: review?(evilpies) → review+
Assignee | ||
Comment 17•12 years ago
|
||
Comment 18•12 years ago
|
||
Actually did you check if this introduces test failures? I added some tests that use browser.finder directly and those listener implementation don't have the shouldFocusContent property.
Comment 19•12 years ago
|
||
Oh sorry never mind, those tests don't use focusContent.
Comment 20•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
status-firefox27:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•