Bug 169062 - Data interaction support for WK1
Summary: Data interaction support for WK1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 15:49 PST by Megan Gardner
Modified: 2017-03-02 11:16 PST (History)
3 users (show)

See Also:


Attachments
Patch (12.48 KB, patch)
2017-03-01 15:58 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.23 KB, patch)
2017-03-01 18:01 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.38 KB, patch)
2017-03-01 18:14 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.39 KB, patch)
2017-03-01 18:45 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.42 KB, patch)
2017-03-01 19:24 PST, Megan Gardner
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2017-03-01 15:49:52 PST
Data interaction support for WK1
Comment 1 Megan Gardner 2017-03-01 15:58:52 PST
Created attachment 303138 [details]
Patch
Comment 2 Wenson Hsieh 2017-03-01 16:50:52 PST
Comment on attachment 303138 [details]
Patch

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

> Source/WebKit/mac/WebCoreSupport/WebDragClient.mm:64
> +

Nit - extra newline here.

> Source/WebKit/mac/WebView/WebView.mm:623
> +    CGRect _selectionRectInRootViewCoordinates;

Can we @synthesize these properties instead of making these all ivars?

> Source/WebKit/mac/WebView/WebView.mm:642
> +    for (FloatRect rect : indicatorData.textRectsInBoundingRectCoordinates)

Nit - auto rect here.

> Source/WebKit/mac/WebView/WebViewData.h:289
> +    

Nit - extra newline here.

> Source/WebKit/mac/WebView/WebViewInternal.h:259
> +- (void)_setDataInteractionData:(CGImageRef)image textIndicator:(WebCore::TextIndicatorData&)textIndicator atClientPosition:(CGPoint)clientPosition anchorPoint:(CGPoint)anchorPoint action:(uint64_t)action;

I think this should be an std::optional, or a RefPtr, or just a raw pointer if the first two are not available. We plumb an optional text indicator here, if I understand correctly.
Comment 3 Megan Gardner 2017-03-01 18:01:48 PST
Created attachment 303152 [details]
Patch
Comment 4 Megan Gardner 2017-03-01 18:14:32 PST
Created attachment 303154 [details]
Patch
Comment 5 Wenson Hsieh 2017-03-01 18:19:29 PST
Comment on attachment 303154 [details]
Patch

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

r=me, with some minor nits. You may need a WebKit2 reviewer (Tim, Beth, Simon, Dan...) to rubber stamp the tiny WK2 change though.

> Source/WebKit/mac/WebView/WebView.mm:1789
> +        _private->textIndicatorData = [[WebUITextIndicatorData alloc] initWithImage:image TextIndicatorData:indicatorData.value() scale:_private->page->deviceScaleFactor()];

Nit - According to https://webkit.org/code-style-guidelines, "each piece of the selector should start with a lowercase letter and use intercaps." -- IMO we should make this textIndicatorData, and also just pass nil to avoid having two different initializers.

> Source/WebKit/mac/WebView/WebView.mm:1810
> +#endif // ENABLE(DATA_INTERACTION)

Nit - should be // ENABLE(DATA_INTERACTION) && defined(__cplusplus)

> Source/WebKit/mac/WebView/WebViewData.h:288
> +    WebUITextIndicatorData *textIndicatorData;

This should be a RetainPtr, and we should use adoptNS() when we init it.

> Source/WebKit/mac/WebView/WebViewPrivate.h:193
> +

Nit - extra newline
Comment 6 Megan Gardner 2017-03-01 18:45:30 PST
Created attachment 303155 [details]
Patch
Comment 7 Megan Gardner 2017-03-01 19:24:23 PST
Created attachment 303161 [details]
Patch
Comment 8 Wenson Hsieh 2017-03-01 19:28:17 PST
Comment on attachment 303161 [details]
Patch

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

> Source/WebKit2/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=169062

It would be great to include the rdar link here.
Comment 9 Megan Gardner 2017-03-02 11:16:37 PST
https://trac.webkit.org/changeset/213292