Bug 128277

Summary: WK2: Tap highlight is positioned incorrectly in iframes
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Test case
none
Patch benjamin: review+

Description Enrica Casucci 2014-02-05 15:51:01 PST
Created attachment 223275 [details]
Test case

Open the attached testcase (iframe-page.html) and tap on the link in the iframe. Note that the tap hightlight is offset.

<rdar://problem/15975993>
Comment 1 Enrica Casucci 2014-02-05 15:53:40 PST
Created attachment 223277 [details]
Patch
Comment 2 Benjamin Poulain 2014-02-05 17:00:07 PST
Comment on attachment 223277 [details]
Patch

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

Thanks!

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:328
> +                currentQuad.setP1(view->contentsToRootView(IntPoint(currentQuad.p1())));
> +                currentQuad.setP2(view->contentsToRootView(IntPoint(currentQuad.p2())));
> +                currentQuad.setP3(view->contentsToRootView(IntPoint(currentQuad.p3())));
> +                currentQuad.setP4(view->contentsToRootView(IntPoint(currentQuad.p4())));

Can you please file a bug to me to convert this to floating point?
Comment 3 Simon Fraser (smfr) 2014-02-05 17:12:08 PST
Comment on attachment 223277 [details]
Patch

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

>> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:328
>> +                currentQuad.setP1(view->contentsToRootView(IntPoint(currentQuad.p1())));
>> +                currentQuad.setP2(view->contentsToRootView(IntPoint(currentQuad.p2())));
>> +                currentQuad.setP3(view->contentsToRootView(IntPoint(currentQuad.p3())));
>> +                currentQuad.setP4(view->contentsToRootView(IntPoint(currentQuad.p4())));
> 
> Can you please file a bug to me to convert this to floating point?

It sucks that we all the mapping 4 times (it can be expensive). We should have a way to convert a set of points all at the same time too.
Comment 4 Enrica Casucci 2014-02-05 17:15:44 PST
(In reply to comment #3)
> (From update of attachment 223277 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223277&action=review
> 
> >> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:328
> >> +                currentQuad.setP1(view->contentsToRootView(IntPoint(currentQuad.p1())));
> >> +                currentQuad.setP2(view->contentsToRootView(IntPoint(currentQuad.p2())));
> >> +                currentQuad.setP3(view->contentsToRootView(IntPoint(currentQuad.p3())));
> >> +                currentQuad.setP4(view->contentsToRootView(IntPoint(currentQuad.p4())));
> > 
> > Can you please file a bug to me to convert this to floating point?
> 
> It sucks that we all the mapping 4 times (it can be expensive). We should have a way to convert a set of points all at the same time too.

The upside is that we do this conversion only for tap highlight and only if it is not the main frame.
Comment 5 Enrica Casucci 2014-02-05 17:15:53 PST
Committed revision 163499.