Bug 143234

Summary: [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: iOS 8.2   
Attachments:
Description Flags
Patch thorton: review+

Description Enrica Casucci 2015-03-30 12:17:44 PDT
rdar://problem/18571345
Comment 1 Enrica Casucci 2015-03-30 12:22:34 PDT
Created attachment 249754 [details]
Patch
Comment 2 Tim Horton 2015-03-30 12:27:28 PDT
Comment on attachment 249754 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:137
> +        if (compositionRange)

Maybe we should pull this code into its own function so we can early return if !compositionRange (and then later if compositionRects.isEmpty()?)

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:141
>          if (compositionRects.size() > 1)

Will the plainTextReplacingNoBreakSpace a few lines below here handle a null compositionRange correctly?
Comment 3 Enrica Casucci 2015-03-30 15:29:11 PDT
(In reply to comment #2)
> Comment on attachment 249754 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249754&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:137
> > +        if (compositionRange)
> 
> Maybe we should pull this code into its own function so we can early return
> if !compositionRange (and then later if compositionRects.isEmpty()?)
> 
> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:141
> >          if (compositionRects.size() > 1)
> 
> Will the plainTextReplacingNoBreakSpace a few lines below here handle a null
> compositionRange correctly?

Yes it does. But I agree that there is no need to do any of the rest of the composition code if compositionRange is null.
Comment 4 Enrica Casucci 2015-03-30 16:26:43 PDT
Committed revision 182162.