Bug 128084

Summary: WK2: Selection in non editable content is not cleared when navigating to a different page
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch mitz: review+

Description Enrica Casucci 2014-02-02 15:07:44 PST
We need to make sure the selection code knows that we are resigning first responder.

<rdar://problem/15966166>
Comment 1 Enrica Casucci 2014-02-02 15:11:31 PST
Created attachment 222941 [details]
Patch
Comment 2 mitz 2014-02-02 15:24:05 PST
Comment on attachment 222941 [details]
Patch

Conceptually it seems wrong to do any work in our override of resignFirstResponder if the superclass implementation is going to return NO. Should we call super first and bail out if it returned NO?

This is not new to this patch, however, so r=me.
Comment 3 Enrica Casucci 2014-02-02 15:35:44 PST
(In reply to comment #2)
> (From update of attachment 222941 [details])
> Conceptually it seems wrong to do any work in our override of resignFirstResponder if the superclass implementation is going to return NO. Should we call super first and bail out if it returned NO?
> 
> This is not new to this patch, however, so r=me.

Thanks for the review!
You are probably correct about calling the super class first. I checked the implementation in UIWebDocumentview and there are tasks performed before and other performed after calling [super resignFirstResponder] but no checks are performed on the return value.
I will leave it like this for now, but I'll add a comment before landing to remind me to do further investigation.
Comment 4 Enrica Casucci 2014-02-02 15:41:31 PST
Committed revision 163273.