Bug 15117 - REGRESSION: Message text isn't focused when reply or forward is clicked
Summary: REGRESSION: Message text isn't focused when reply or forward is clicked
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 523.x (Safari 3)
Hardware: Macintosh OS X 10.4
: P1 Major
Assignee: Nobody
URL: http://mail.google.com
Keywords: GoogleBug, InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-08-30 12:47 PDT by Ruben Bakker
Modified: 2008-02-23 03:31 PST (History)
1 user (show)

See Also:


Attachments
Screenshot: Message text after reply was clicked (70.12 KB, image/png)
2007-08-30 12:54 PDT, Ruben Bakker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruben Bakker 2007-08-30 12:47:08 PDT
Click either "Reply" or "Forward" and the appearing message text isn't focused. This happens about 20% to 50% of the time. When the focus isn't set, there is no cursor shown in the message text. See attached screenshot.

This problem results in user confusion, or sometimes even to data loss: Users click the link and then start typing. If they have enabled Gmail's keyboard shortcuts, then their entries are interpreted as actions. (y will archive, x will delete etc) 

Important: The problem doesn't occur when using the keyboard, e.g. pressing 'r' for reply. Nor does it happen when you click the link and then immediately move the mouse while the message text is opened.

I have tried to debug it and found this code to be the problem (WebHtmlView.mm):

- (BOOL)acceptsFirstResponder
{
    // Don't accept first responder when we first click on this view.
    // We have to pass the event down through WebCore first to be sure we don't hit a subview.
    // Do accept first responder at any other time, for example from keyboard events,
    // or from calls back from WebCore once we begin mouse-down event handling.
    NSEvent *event = [NSApp currentEvent];
    if ([event type] == NSLeftMouseDown
            && !_private->handlingMouseDownEvent
            && NSPointInRect([event locationInWindow], [self convertRect:[self visibleRect] toView:nil])) {
        return NO; // My Workaround is to return YES here.
    }
    return YES;
}

When it doesn't work, it is because this method returns NO. If I always return YES, the error can't be duplicated.

If you enter 'r' to reply then it will return YES (keyboard event)
If you move your mouse right after the click then a NSMouseMouse Event will be generated and a YES is the result (not a mouse down event).

My findings maybe very superficial - there may be a deeper problem that I don't understand.

I marked this bug 
- REGRESSION, as it started to appear with html message text (old Safari has no problem)
- CRITICAL as people are confused by the problem (Lot's of bug reports on my side)
Comment 1 Ruben Bakker 2007-08-30 12:54:03 PDT
Created attachment 16165 [details]
Screenshot: Message text after reply was clicked
Comment 2 Ruben Bakker 2007-08-30 12:56:39 PDT
I experienced this bug with many different WebKit nightlies since about begin July.
Checked out the source code today for the debugging session (2007-08-30)
Comment 3 Mark Rowe (bdash) 2007-08-30 14:08:55 PDT
<rdar://problem/5451335>
Comment 4 Luis Roel 2008-01-22 17:32:18 PST
Confirmed using build r29711
Comment 5 Alexey Proskuryakov 2008-01-24 00:27:52 PST
Marking confirmed per the above comments.
Comment 6 David Kilzer (:ddkilzer) 2008-02-20 06:27:22 PST
Ruben do you still see this issue?

I could not reproduce it with WebKit Nightly build r30377 on Mac OS X 10.4.11 (8S165) and the new GMail v2 interface.
Comment 7 Ruben Bakker 2008-02-22 22:41:30 PST
(In reply to comment #6)
> Ruben do you still see this issue?
> 
> I could not reproduce it with WebKit Nightly build r30377 on Mac OS X 10.4.11
> (8S165) and the new GMail v2 interface.
> 
Hi David,
I have tested both the Gmail 1 and Gmail 2 interfaces and wasn't able to duplicate the problem. The seems problem seems to be resolved.
Comment 8 David Kilzer (:ddkilzer) 2008-02-23 03:31:41 PST
Marking RESOLVED/FIXED per Comment #7.