Bug 58382

Summary: Infinite recursion in WebHTMLView executeSavedKeypressCommands
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: HTML EditingAssignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch ap: review+

Description Enrica Casucci 2011-04-12 15:06:44 PDT
Execution of some editing commands could trigger a call to selectedRange that internally calls executeSavedKeypressCommands creating an infinite recursion.
Comment 1 Enrica Casucci 2011-04-12 15:06:57 PDT
<rdar://problem/9239370>
Comment 2 Enrica Casucci 2011-04-12 15:12:39 PDT
Created attachment 89281 [details]
Patch
Comment 3 Alexey Proskuryakov 2011-04-12 15:34:42 PDT
Comment on attachment 89281 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=89281&action=review

> Source/WebKit2/UIProcess/API/mac/WKView.mm:1183
> +    // We could be called again if the execution of one command triggers a call to selectedRange.

I would add: "In this case, the state is up to date, and we don't need to execute any more saved commands to return a result"
Comment 4 Enrica Casucci 2011-04-12 15:42:55 PDT
(In reply to comment #3)
> (From update of attachment 89281 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89281&action=review
> 
> > Source/WebKit2/UIProcess/API/mac/WKView.mm:1183
> > +    // We could be called again if the execution of one command triggers a call to selectedRange.
> 
> I would add: "In this case, the state is up to date, and we don't need to execute any more saved commands to return a result"

Will do. thank you!
Comment 5 Enrica Casucci 2011-04-12 15:49:30 PDT
http://trac.webkit.org/changeset/83655