Bug 8111

Summary: REGRESSION (NativeTextField): first click in form field on weather.com leaves focus but no caret
Product: WebKit Reporter: John Sullivan <sullivan>
Component: FormsAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal Keywords: HasReduction, InRadar, Regression
Priority: P1    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.weather.com
Attachments:
Description Flags
Picture of trouble-making form fieldĀ 
none
reduction
none
patch, including detailed change log and a layout test adele: review+

John Sullivan
Reported 2006-03-31 15:50:05 PST
This bug is also in Radar as <rdar://4498729> To reproduce: 1. visit http://www.weather.com 2. click in the field nearest the top of the page that contains the text "Enter city or US zip" (note that sometimes there's a 2nd field with this same text in it lower on the page in a Flash plug-in; I'm talking about the normal form field higher on the page -- see attached picture) This click is supposed to erase the placeholder text, focus the field, and cause a caret to start blinking. The first two things happen, but there's no caret, and typing does not cause text to appear. A 2nd click in the field will set things right again.
Attachments
Picture of trouble-making form fieldĀ  (32.88 KB, image/png)
2006-03-31 15:50 PST, John Sullivan
no flags
reduction (65 bytes, text/html)
2006-04-01 00:04 PST, Darin Adler
no flags
patch, including detailed change log and a layout test (32.75 KB, patch)
2006-04-05 09:15 PDT, Darin Adler
adele: review+
John Sullivan
Comment 1 2006-03-31 15:50:56 PST
Created attachment 7425 [details] Picture of trouble-making form field
Darin Adler
Comment 2 2006-04-01 00:04:59 PST
Created attachment 7434 [details] reduction
Darin Adler
Comment 3 2006-04-01 00:07:27 PST
The cause of this is simple: The mouse event comes in and hit tests and gets an inner node, the text node inside the text field's div. Then, the script on the text field removes all the text, which makes that node get removed from the text field's div. Finally, we end up in Frame::handleMousePressEventSingleClick and we bail out because innerNode->renderer() is 0. However, it's not clear to me what the right fix is. Maybe we need to do a new hit test after processing the focus change?
Darin Adler
Comment 4 2006-04-01 00:14:43 PST
I can think of two approaches to fix this: 1) Change MouseEventWithHitTestResults to have an innerElement, and not an innerNode, so we'd never have a pointer to the text node in the first place. We'd probably want to change RenderObject::NodeInfo too if we did this. 2) Change the FrameView::handleMousePressEvent function to fix up the MouseEventWithHitTestResults after calling dispatchMouseEvent. I favor (1).
Chris Petersen
Comment 5 2006-04-01 18:48:19 PST
I'm seeing this issue at http://www.hotwire.com/index.jsp?lid=uhp.SMR06-01.jsp:topNav:loc:5:home Clicking on either From or To fields displays a focus ring but doesn't display caret until a second click.
Maciej Stachowiak
Comment 6 2006-04-02 23:25:43 PDT
These are all text field regressions so they should all be P1.
Darin Adler
Comment 7 2006-04-05 09:15:22 PDT
Created attachment 7527 [details] patch, including detailed change log and a layout test
Note You need to log in before you can comment on or make changes to this bug.