Bug 83148

Summary: Best zoomable area does not balance intersection with target area.
Product: WebKit Reporter: Allan Sandfeld Jensen <allan.jensen>
Component: UI EventsAssignee: Allan Sandfeld Jensen <allan.jensen>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Allan Sandfeld Jensen 2012-04-04 04:59:57 PDT
The algorithm for best zoomable area currently chooses the area with the largest intersection, and if more than one area has the same intersection area, chooses the smallest target area.

This correctly chooses the smallest area when a touch is fully contained in the target area. But in cases where a small part of the touch is outside the targeted area, it will end up picking the background instead.

To fix this, change the algorithm from a two step sort to one step sort that picks the best target using a formula that balances the smallest area and the largest intersection with each other.
Comment 1 Allan Sandfeld Jensen 2012-04-04 05:03:34 PDT
Created attachment 135561 [details]
Patch
Comment 2 Allan Sandfeld Jensen 2012-04-04 05:12:17 PDT
Created attachment 135562 [details]
Patch
Comment 3 WebKit Review Bot 2012-04-04 05:48:09 PDT
Comment on attachment 135562 [details]
Patch

Clearing flags on attachment: 135562

Committed r113179: <http://trac.webkit.org/changeset/113179>
Comment 4 WebKit Review Bot 2012-04-04 05:48:13 PDT
All reviewed patches have been landed.  Closing bug.