Bug 135776

Summary: [Services with UI] Action menu arrow hit testing is sometimes wrong
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebCore Misc.Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, thorton
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Attachments:
Description Flags
Patch beidson: review+

Description Enrica Casucci 2014-08-08 16:16:28 PDT
* STEPS TO REPRODUCE
0. Install and enable a text viewer extension.
1. Load the Yelp page for Nihon Whiskey Loung in San Francisco - http://www.yelp.com/biz/nihon-whisky-lounge-san-francisco#query:nihon%20whiskey%20lounge
2. Select text from the second review, then hover over the first line of the selection.
3. Nothing happens - no arrow.
4. Hover a bit lower, over the whitespace under the first line.
5. Arrow appears.

<rdar://problem/17837670>
Comment 1 Enrica Casucci 2014-08-08 16:26:08 PDT
Created attachment 236322 [details]
Patch
Comment 2 Brady Eidson 2014-08-08 16:34:34 PDT
Comment on attachment 236322 [details]
Patch

I stared at the rect math for like 5 minutes.  Seems fine!
Comment 3 Tim Horton 2014-08-08 16:38:22 PDT
Comment on attachment 236322 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:152
> +    if (rects.isEmpty() || rects.size() == 1)

should this just be rects.size() <= 1?

> Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:171
> +    // Next stich together all the rects on the last line of the selection.

s/stich/stitch/

> Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:186
> +    // indexFromEnd is the index of the last rectangle on the sendon the last line.

"on the sendon"?
Comment 4 Enrica Casucci 2014-08-11 10:29:01 PDT
(In reply to comment #3)
> (From update of attachment 236322 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=236322&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:152
> > +    if (rects.isEmpty() || rects.size() == 1)
> 
> should this just be rects.size() <= 1?
Yes, it is better.
> 
> > Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:171
> > +    // Next stich together all the rects on the last line of the selection.
> 
> s/stich/stitch/
> 
> > Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:186
> > +    // indexFromEnd is the index of the last rectangle on the sendon the last line.
> 
> "on the sendon"?

Thanks for catching the typos.
Comment 5 Enrica Casucci 2014-08-11 10:52:46 PDT
Committed revision 172395.