Bug 197710

Summary: Pass insertTextAsync options as a struct
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 197632    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Daniel Bates 2019-05-08 14:08:16 PDT
WebPageProxy::insertTextAsync() is becoming unwieldy to work with given the large number of optional arguments that can be passed and I am eyeing to pass another optional argument towards fixing bug #197632. Let's pass a struct of options instead.
Comment 1 Daniel Bates 2019-05-08 14:37:03 PDT
Created attachment 369424 [details]
Patch
Comment 2 Daniel Bates 2019-05-08 15:09:14 PDT
Created attachment 369427 [details]
Patch
Comment 3 Daniel Bates 2019-05-08 15:14:11 PDT
Created attachment 369431 [details]
Patch
Comment 4 Brent Fulgham 2019-05-08 15:25:30 PDT
Comment on attachment 369431 [details]
Patch

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

Looks like a nice simplification. r=me.

> Source/WebKit/Shared/Cocoa/InsertTextOptions.h:36
> +    EditingRangeIsRelativeTo editingRangeIsRelativeTo { EditingRangeIsRelativeTo::EditableRoot };

It might be more space-efficient to move the booleans to the bottom of the struct.
Comment 5 Daniel Bates 2019-05-08 15:47:39 PDT
(In reply to Brent Fulgham from comment #4)
> Comment on attachment 369431 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=369431&action=review
> 
> Looks like a nice simplification. r=me.
> 
> > Source/WebKit/Shared/Cocoa/InsertTextOptions.h:36
> > +    EditingRangeIsRelativeTo editingRangeIsRelativeTo { EditingRangeIsRelativeTo::EditableRoot };
> 
> It might be more space-efficient to move the booleans to the bottom of the
> struct.

It shouldn't make a difference. sizeof(bool) == 1 == sizeof(uint8_t).
Comment 6 Daniel Bates 2019-05-08 15:48:35 PDT
Comment on attachment 369431 [details]
Patch

Clearing flags on attachment: 369431

Committed r245073: <https://trac.webkit.org/changeset/245073>
Comment 7 Daniel Bates 2019-05-08 15:48:36 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-05-08 15:51:40 PDT
<rdar://problem/50600263>