Closed Bug 299548 Opened 19 years ago Closed 18 years ago

Fails to focus the content area when loading homepage

Categories

(Camino Graveyard :: HTML Form Controls, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.5

People

(Reporter: taralx, Assigned: froodian)

References

()

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050701 Camino/0.9a1+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050701 Camino/0.9a1+

When Google is brought up, the search box is supposed to be given focus by an
onload routine. It's not, and running "document.f.q.focus()" by hand (url bar)
doesn't do it either.

Reproducible: Always

Steps to Reproduce:
This works fine for me in the July 3rd nightly. Does anything show up in the
Console log?
Aha, new steps:

1. Set home page to "http://www.google.com/"
2. Open new tab.
3. Hit cmd-shift-H to go to homepage.

Expected result: input field is focused.
Actual result: input field not focused.
Ah, you're right. It seems that the focus is never taken away from the URL bar
(if it's focused) when going to whatever the home page is set to.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Dropping severity.
Severity: major → normal
I think the offending line is
http://lxr.mozilla.org/mozilla/source/camino/src/browser/BrowserWindowController.mm#2162:

[mBrowserView loadURI:[[PreferenceManager sharedInstance] homePage:NO] referrer:
nil flags:NSLoadFlagsNone activate:NO allowPopups:NO];

We should probably be passing activate:YES instead, which sets the "pending
active" of mBrowserView (a BrowserWrapper).
Is this a quick fix, Wevah?
Summary: Javascript HTMLInputElement.focus() fails to focus element → Javascript HTMLInputElement.focus() fails to focus element when loading homepage
Target Milestone: --- → Camino1.1
*** Bug 314641 has been marked as a duplicate of this bug. ***
(In reply to comment #6)
> Is this a quick fix, Wevah?

I don't even know if my proposed fix works, to be honest; someone will have to check it.
Giving this a more general summary in line with comment 3 so I don't accidentally reopen bug Bug 314641 :-)

Was: Javascript HTMLInputElement.focus() fails to focus element when loading homepage

See also bug 310395 where a similar problem occurs under different circumstances.
Summary: Javascript HTMLInputElement.focus() fails to focus element when loading homepage → Fails to focus the content area when loading homepage
Depends on: 299472
Gijs: Are you sure this bug is really dependent on the other?
No longer depends on: 299472
I have a working patch for this, which I'll upload once I find a find a connection fast enough to update my source. -> me
Status: NEW → ASSIGNED
Assignee: mikepinkerton → stridey
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
This essentially just does what Wevah said.  I tested it out, and it seems to work as expected.
Attachment #222572 - Flags: review?
Attachment #222572 - Flags: review? → review?(hwaara)
Attachment #222572 - Flags: review?(hwaara) → review+
Attachment #222572 - Flags: superreview?(mikepinkerton)
The fix for this is in Bug 310395 (sorry about wasting your time with the duplicate r?'s hwaara, since you'll have to review it there)
Depends on: 310395
Attachment #222572 - Flags: superreview?(mikepinkerton)
Fixed by bug 310395.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: