Bug 15564 - HitTesting is incorrect for test-anchor: middle
Summary: HitTesting is incorrect for test-anchor: middle
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nikolas Zimmermann
URL: http://www.humanracetrack.com/misc/we...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-19 09:54 PDT by Adam Rofer
Modified: 2007-11-25 05:06 PST (History)
1 user (show)

See Also:


Attachments
Initial patch (6.56 KB, patch)
2007-11-25 03:14 PST, Nikolas Zimmermann
aroben: review+
Details | Formatted Diff | Diff
DRT reduction (551 bytes, image/svg+xml)
2007-11-25 03:16 PST, Nikolas Zimmermann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Rofer 2007-10-19 09:54:59 PDT
When text-anchor="middle" occurs, this causes the glyphs to not be rendered that occur before the path (which is correct behavior). When this happens, however, the entire X and Y domain less than the fallen-off text is treated (with onMouseOver) as if the text were covering the entire area.

This is not the case in other SVG viewers.
Comment 1 Eric Seidel (no email) 2007-10-19 12:12:27 PDT
We'll need to build a DRT compatible test, but the attached reduction is great, thanks!
Comment 2 Nikolas Zimmermann 2007-10-19 13:50:21 PDT
Hi Adam,

thanks a lot for the nice report. I'm aware of the bug, it's especially nicely visible in Web Inspector (the <textPath> x/y origin starts at 0x0, when text-anchor is not "start".

The reduction looks excellent, I'm going to make a DRT compatible layout test out of it!

Greetings,
Niko
Comment 3 Nikolas Zimmermann 2007-11-25 03:14:48 PST
Created attachment 17503 [details]
Initial patch

Bug fixed, contains a DRT compatible reduction of Adams nice testcase!
Comment 4 Nikolas Zimmermann 2007-11-25 03:16:42 PST
Created attachment 17504 [details]
DRT reduction
Comment 5 Adam Roben (:aroben) 2007-11-25 04:08:07 PST
Comment on attachment 17503 [details]
Initial patch

+                    it++;

We normally use the prefix increment operator on iterators, for efficiency.

+    if (pathData)
+        return pathData->hidden;
+
+    return false;

This can just be

return pathData && pathData->hidden;

Make sure you land the layout test and results with it.

r=me
Comment 6 Nikolas Zimmermann 2007-11-25 05:06:01 PST
Landed in r28015.
Incorported all of Adams comments.