Bug 11096 - Hit testing for polylines fails
Summary: Hit testing for polylines fails
Status: RESOLVED DUPLICATE of bug 11931
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2006-09-30 05:10 PDT by Rob Buis
Modified: 2007-06-05 13:01 PDT (History)
1 user (show)

See Also:

First attempt (8.85 KB, patch)
2006-09-30 06:15 PDT, Rob Buis
andersca: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2006-09-30 05:10:01 PDT
When using the default pointer-events value, polylines should react to hit testing
if filled with paint. In ToT this fails atm. Will append a testcase soon.
Comment 1 Rob Buis 2006-09-30 06:15:01 PDT
Created attachment 10846 [details]
First attempt

Fix for bug 11096 :)

Comment 2 Eric Seidel (no email) 2006-09-30 06:21:32 PDT
Comment on attachment 10846 [details]
First attempt

Looks good.

But you need a better comment.  Here is a suggestion:

 // CGPathContainsPoint returns false for non-closed paths, as a work-around, we copy and close the path first.  Radar 4758998 asks for a better CG API to use

We could also consider only ever copying the path if CGPathContainsPoint returns false.  I'm just not sure how expensive CGPathContainsPoint is relative to a malloc.
Comment 3 Eric Seidel (no email) 2006-09-30 06:28:21 PDT
I was just discussing this with rob again in the channel.  This code is run on mousemove (if you're mousing over an SVG, so the malloc could be a significant problem.  Another optimization could be to first check the bbox, only if it's in the bbox check CGPathContainsPoint, then only if that returned false, do we copy the path close it, and check again.

Not sure all that optimization is necessary.  We'd have to shark it.
Comment 4 Anders Carlsson 2006-11-02 19:31:26 PST
Comment on attachment 10846 [details]
First attempt

Marking this r- until a solution is found, so this won't show up in the commit queue.
Comment 5 Eric Seidel (no email) 2007-06-05 13:01:33 PDT
This is fixed on TOT.  I fixed this when fixing an earlier related bug (in way which also causes copy/mallocs, unfortunately. :(

*** This bug has been marked as a duplicate of 11931 ***