Bug 12334 - Respect <text> boundaries for svg text selecting
Summary: Respect <text> boundaries for svg text selecting
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-18 22:55 PST by Rob Buis
Modified: 2007-01-20 14:11 PST (History)
0 users

See Also:


Attachments
First attempt (1.52 KB, patch)
2007-01-19 04:35 PST, Rob Buis
eric: review-
Details | Formatted Diff | Diff
Improved patch (3.21 KB, patch)
2007-01-19 13:41 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Now with testcase (4.16 KB, patch)
2007-01-20 14:04 PST, Rob Buis
sam: 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 2007-01-18 22:55:56 PST
See text-tselect-01-b.svg and text-tselect-02-f.svg for tests.
Comment 1 Rob Buis 2007-01-19 04:35:03 PST
Created attachment 12555 [details]
First attempt

This patch should do it. Testcases may need to wait until we can select SVG text using the DOM.
Cheers,

Rob.
Comment 2 Eric Seidel (no email) 2007-01-19 04:39:40 PST
Comment on attachment 12555 [details]
First attempt

This is wrong:
strncmp(r->renderName(), "RenderSVGInlineText", 19) == 0 || strncmp(r->renderName(), "RenderSVGText", 13) == 0
we should add a virtual method isSVGTextObject() (or similar) to RenderObject instead (if RenderSVGInlineTExt is a subclass of RenderSVGText it coudl easily be named isSVGText())

maybe there is an easier more general way to do this?  It seems a little awkward to hack this into the base code.
Comment 3 Rob Buis 2007-01-19 13:41:23 PST
Created attachment 12563 [details]
Improved patch

Addressing Eric's issue.
Cheers,

Rob.
Comment 4 Rob Buis 2007-01-20 14:04:15 PST
Created attachment 12575 [details]
Now with testcase

This one contains some extra safety checks and cleanups. Also added a manual test.
Cheers,

Rob.
Comment 5 Sam Weinig 2007-01-20 14:07:56 PST
Comment on attachment 12575 [details]
Now with testcase

r=me
Comment 6 Rob Buis 2007-01-20 14:11:28 PST
Landed in r19002.