Bug 83148 - Best zoomable area does not balance intersection with target area.
Summary: Best zoomable area does not balance intersection with target area.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 04:59 PDT by Allan Sandfeld Jensen
Modified: 2012-04-04 05:48 PDT (History)
1 user (show)

See Also:


Attachments
Patch (6.85 KB, patch)
2012-04-04 05:03 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (10.02 KB, patch)
2012-04-04 05:12 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.