Bug 152216 - Data detector yellow highlight location is vertically mirrored in WebKit1
Summary: Data detector yellow highlight location is vertically mirrored in WebKit1
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: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-12 15:08 PST by Tim Horton
Modified: 2016-01-22 14:45 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.44 KB, patch)
2015-12-12 15:09 PST, Tim Horton
no flags Details | Formatted Diff | Diff
subwindow dumping patch for safekeeping (15.37 KB, patch)
2015-12-17 11:40 PST, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (11.96 KB, patch)
2016-01-15 14:10 PST, Tim Horton
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2015-12-12 15:08:55 PST
Data detector yellow highlight location is vertically mirrored in WebKit1
Comment 1 Tim Horton 2015-12-12 15:09:12 PST
Created attachment 267244 [details]
Patch
Comment 2 Alexey Proskuryakov 2015-12-12 16:05:13 PST
Comment on attachment 267244 [details]
Patch

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

> Source/WebKit/mac/ChangeLog:3
> +        Data detector yellow highlight location is vertically mirrored in WebKit1

No test?
Comment 3 Tim Horton 2015-12-12 16:15:47 PST
No idea how to test. We could add a way to dump this specific rect at some point, but that would be pretty overly specific to this one patch. Ref/pixel tests won't work because they don't capture subwindows. At the moment we have no tests for TextIndicators in actual use, just some TextIndicator unit-ish tests that wouldn't have hit this. Ideas?
Comment 4 Tim Horton 2015-12-12 16:59:16 PST
Another alternative: an API test where we override NSWindow addChildWindow and dump its properties.

Another roadblock: it looks like we don't currently have support for synthetically invoking force-touch in WebKit1. Might be able to trigger it with the keyboard shortcut, though (?)
Comment 5 Darin Adler 2015-12-13 13:46:19 PST
Comment on attachment 267244 [details]
Patch

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

Test coverage is a good question.

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:432
> +    RefPtr<TextIndicator> indicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);

auto is typically better than RefPtr and it might be Ref; unless this is old and still returns PassRefPtr
Comment 6 Tim Horton 2015-12-16 11:14:46 PST
(In reply to comment #5)
> Comment on attachment 267244 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=267244&action=review
> 
> Test coverage is a good question.
> 
> > Source/WebKit/mac/WebView/WebImmediateActionController.mm:432
> > +    RefPtr<TextIndicator> indicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
> 
> auto is typically better than RefPtr and it might be Ref; unless this is old
> and still returns PassRefPtr

It's not Ref, TextIndicator creation can fail (in a hundred different ways). auto is fine, though.
Comment 7 Tim Horton 2015-12-17 11:39:29 PST
Ugh, I did all the work to do subwindow dumping for WKTR, then realized I needed in in DRT, then realized (again) that we don't have support for synthetic force-click in DRT.

I'm just going to land it.
Comment 8 Tim Horton 2015-12-17 11:40:03 PST
Created attachment 267572 [details]
subwindow dumping patch for safekeeping
Comment 9 Tim Horton 2015-12-17 11:42:50 PST
http://trac.webkit.org/changeset/194221
Comment 10 Tim Horton 2016-01-15 14:05:23 PST
Reopening for a new patch.
Comment 11 Tim Horton 2016-01-15 14:10:07 PST
Created attachment 269097 [details]
Patch
Comment 12 WebKit Commit Bot 2016-01-15 14:11:45 PST
Attachment 269097 [details] did not pass style-queue:


ERROR: Source/WebKit/mac/WebView/WebView.mm:8573:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit/mac/WebView/WebView.mm:8637:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Tim Horton 2016-01-22 14:45:46 PST
http://trac.webkit.org/changeset/195149