Closed Bug 567309 Opened 14 years ago Closed 14 years ago

Find does not start with / and does not start "Search for text when I start typing"

Categories

(Firefox :: General, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: alice0775, Assigned: asaf)

References

Details

(Keywords: dogfood, regression)

Attachments

(1 file, 5 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US;
rv:1.9.3a5pre) Gecko/20100520 Minefield/3.7a5pre ID:20100520065946
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US;
rv:1.9.3a5pre) Gecko/20100520 Minefield/3.7a5pre ID:20100520065946

When I use FAYT( "/" ) for the first time after the start of the browser
window, FAYT does not start.
And also "Search for text when I start typing" option fails.

However, If I used FindBar once at least, The both commands function well.

Reproducible: Always

Steps to Reproduce:
1. Start Minefield with new profile
2. Open HOME( http://www.mozilla.org/projects/minefield/ )
3. Select text on the page
4. keypush "/" and "minefield" ( without quatation marks)

Actual Results:
When I use FAYT( "/" ) for the first time after the start of the browser
window, FAYT does not start.
And also "Search for text when I start typing" option fails.

Expected Results:
FAYT and "Search for text when I start typing" option should be effective.



Regression window:

Works:
http://hg.mozilla.org/mozilla-central/rev/d5d5ed6d3e1c
Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre)
Gecko/20100518 Minefield/3.7a5pre ID:20100519083331

Fails:
http://hg.mozilla.org/mozilla-central/rev/046c2d2acd3b
Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre)
Gecko/20100518 Minefield/3.7a5pre ID:20100519101258

Push log:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=d5d5ed6d3e1c&tochange=046c2d2acd3b

Candidate:
Bug 566736  - Lazily initialize the find toolbar
Sorry, 
please ignore STEP3 of STR in comment#0


Steps to Reproduce:
1. Start Minefield with new profile
2. Open HOME( http://www.mozilla.org/projects/minefield/ )
3. 
4. keypush "/" and "minefield" ( without quotation marks)
Linux is affected as well, please change the OS part of "Platform" to "All".
OS: Windows 7 → All
Hardware: x86 → All
blocking2.0: --- → ?
Assignee: nobody → mano
Status: NEW → ASSIGNED
Priority: -- → P1
For what it's worth, I just had to downgrade my browser to an older nightly to work around this problem; it was making the browser more or less completely unusable...
Keywords: dogfood
The obvious reason is that TAF is implemented inside findbar.xml (see http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/findbar.xml#1407 for example), which means that it won't work until the binding is loaded.  I think we need to move the keypress event handler out of findbar.xml and have it initialize the findbar if needed.  We should probably let it live somewhere in toolkit.
No. My solution is to use the handler in browser.js, and initialize the findbar there for the first time.
Interestingly, if you first press <F3> on a given browser window, "/" works from then on for all tabs in that browser windows.
Attached patch patch (obsolete) — Splinter Review
Since this is dogfood, I'd like to land the test post-facto.
Attachment #447593 - Flags: review?(gavin.sharp)
Attached patch patch (obsolete) — Splinter Review
Attachment #447593 - Attachment is obsolete: true
Attachment #447601 - Flags: review?(gavin.sharp)
Attachment #447593 - Flags: review?(gavin.sharp)
Comment on attachment 447601 [details] [diff] [review]
patch

>diff -r 21ca905f5b3e browser/base/content/tabbrowser.xml

>           if (aEvent.altKey)
>             return;

>+          if (!gFindBarInitialized &&
>+              !(aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey) &&

The altKey check is redundant given the earlier one.

I still hate this patch, but I suppose I will begrudgingly r+ it if it lands with a test.
Attachment #447601 - Flags: review?(gavin.sharp) → review+
Comment on attachment 447706 [details] [diff] [review]
simple test

Many thanks.

Before sending "/", it should be checked that gFindbarInitialized is not set.
Does this patch solved "Search for text when I start typing"?
Sorry spam,
please forget comment #14
Attached patch as checked in (obsolete) — Splinter Review
Attachment #447601 - Attachment is obsolete: true
Attachment #447706 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
It'd be nice to expand the test to also check "'" (I suppose that'd require a new window), and that the find bar actually works.
Yes, it would requite a new window.

We already have some tests for the findbar itself.
I've backed this out as it was a likely cause for the revival of bug 478241.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 447713 [details] [diff] [review]
as checked in

>+          if (!gFindBarInitialized &&
>+              !(aEvent.ctrlKey || aEvent.metaKey) &&
>+              !aEvent.getPreventDefault()) {
>+            var charCode = aEvent.charCode;
>+            if (charCode) {
>+              var char = String.fromCharCode(charCode);

nit: s/var/let/

>+              if (char == "'" || char == "/" ||
>+                  gPrefService.getBoolPref("accessibility.typeaheadfind")) { 

nit: trailing space

... and I think we've consistently switched over to Services.prefs in tabbrowser.xml.
(In reply to comment #18)
> We already have some tests for the findbar itself.

Sure, but not the findbar *in Firefox*. We need tests to make sure that our hacky lazy initialization doesn't break something in the findbar widget, e.g.
Attached patch patch (obsolete) — Splinter Review
I /believe/ that the failures occur due to the new test and not due to the new code in tabbrowsr - likely because of the quick-find timer. So, I'm now calling gFindBar.close manually to avoid any automated findbar stuff.  Hopefully that helps.
Attachment #447713 - Attachment is obsolete: true
Attached patch as landedSplinter Review
To be on the safe side, I changed the test to work more like other browser-chrome tests.

http://hg.mozilla.org/mozilla-central/rev/e73cbd31c93e

Watching.
Attachment #448260 - Attachment is obsolete: true
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Blocks: 97023
Can Bug 570230 be caused by this bugfix?
Commented there.
posthumous blocking+.
blocking2.0: ? → final+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: