Bug 12149 - REGRESSION (r18175): External CSS causes incomplete text field focus
Summary: REGRESSION (r18175): External CSS causes incomplete text field focus
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL: https://login.yahoo.com/
Keywords: HasReduction, InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-01-07 05:20 PST by David Kilzer (:ddkilzer)
Modified: 2007-02-13 03:30 PST (History)
3 users (show)

See Also:


Attachments
Reduction (309 bytes, text/html)
2007-01-07 11:46 PST, Matt Lilek
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2007-01-07 05:20:23 PST
Summary:

When loading the Yahoo! login page, the username field ("Yahoo! ID:") will get a focus ring drawn, but the text field will not get focus (no caret drawn, and characters do not appear in the field when typing).

Steps to reproduce:

1. Open WebKit nightly.
2. Open URL:  https://login.yahoo.com/

Expected results:

The username ("Yahoo! ID:") field should get full focus (focus ring, caret, typing enters characters into the field).

Actual results:

The username ("Yahoo! ID:") field gets a focus ring, but not a caret and typing does not enter characters into the field.

Regression:

This is a regression from shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037).  Tested with a locally-built debug build of WebKit r18649.

Notes:

Approximately 1 in 10 times after loading the page, the username ("Yahoo! ID:") field WILL get full focus.  The rest of the time this bug is seen.
Comment 1 David Kilzer (:ddkilzer) 2007-01-07 05:24:18 PST
(In reply to comment #0)
> Notes:
> 
> Approximately 1 in 10 times after loading the page, the username ("Yahoo! ID:")
> field WILL get full focus.  The rest of the time this bug is seen.

More accurately, it appears that the username field gets full focus the first time the page is loaded in a new window or a new tab, but on all subsequent reloads, the username field only gets a focus ring.

Comment 2 Matt Lilek 2007-01-07 10:04:25 PST
I've seen this on Facebook's login page also.
Comment 3 Matt Lilek 2007-01-07 11:44:25 PST
The issue seems to be with linked CSS and inline Javascript.

If a page links to an external CSS file, then calls focus on a form from within the <body>, it gets focus but no caret.  The external CSS file doesn't need to exist or even be specified for this to happen - just so long as <link rel="stylesheet"> or <style>@import "";</style> is there.

The focus also needs to be called from within the body, not from an event handler.  I've also verified that this is the same issue on Facebook.
Comment 4 Matt Lilek 2007-01-07 11:46:25 PST
Created attachment 12281 [details]
Reduction

The interesting thing about this reduction is that while the input gets focus from the script, when you click the "focused" input, it gets focused again.
Comment 5 David Kilzer (:ddkilzer) 2007-01-07 16:51:42 PST
Doing a binary search of WebKit nightly builds, the regression occurred between r18159 (works as expected) and r18187 (fails).

Comment 6 David Kilzer (:ddkilzer) 2007-01-07 17:04:20 PST
(In reply to comment #5)
> Doing a binary search of WebKit nightly builds, the regression occurred between
> r18159 (works as expected) and r18187 (fails).

Suspicious revisions include r18175 and r18187.

http://trac.webkit.org/projects/webkit/changeset/18175
http://trac.webkit.org/projects/webkit/changeset/18187

Comment 7 David Kilzer (:ddkilzer) 2007-01-07 18:02:26 PST
Rebuilding locally, confirmed that r18175 caused the regression.

Comment 8 Darin Adler 2007-01-11 09:13:00 PST
Another way to describe this is: "calling focus() on a text field that has no renderer causes incomplete text field focus".
Comment 9 Mark Rowe (bdash) 2007-01-16 19:45:15 PST
<rdar://problem/4928692>
Comment 10 Dave Hyatt 2007-02-12 21:43:19 PST
Fixed.
Comment 11 David Kilzer (:ddkilzer) 2007-02-13 03:30:27 PST
r19595