Bug 118284 - Simplify SVGTextContentElement::elementFromRenderer()
Summary: Simplify SVGTextContentElement::elementFromRenderer()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-07-01 23:30 PDT by Chris Dumez
Modified: 2013-07-02 13:16 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.87 KB, patch)
2013-07-02 00:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2013-07-01 23:30:59 PDT
Simplify SVGTextContentElement::elementFromRenderer() by leveraging SVGElement::isTextContent() methods instead of explicitly checking for tag names.

Corresponding Blink revision:
https://src.chromium.org/viewvc/blink?revision=153348&view=revision
Comment 1 Chris Dumez 2013-07-02 00:11:49 PDT
Created attachment 205874 [details]
Patch
Comment 2 WebKit Commit Bot 2013-07-02 04:51:06 PDT
Comment on attachment 205874 [details]
Patch

Clearing flags on attachment: 205874

Committed r152284: <http://trac.webkit.org/changeset/152284>
Comment 3 WebKit Commit Bot 2013-07-02 04:51:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Dirk Schulze 2013-07-02 12:24:17 PDT
Comment on attachment 205874 [details]
Patch

I assume we had these lines for <tref>. But am not entirely sure. Even if it landed, can you elaborate in the history so that we don't miss anything?
Comment 5 Chris Dumez 2013-07-02 13:16:25 PDT
(In reply to comment #4)
> (From update of attachment 205874 [details])
> I assume we had these lines for <tref>. But am not entirely sure. Even if it landed, can you elaborate in the history so that we don't miss anything?

For tref? Why does tref need special handling?
SVGTRefElement inherits SVGTextContentElement so SVGTRefElement::isTextContent() will return true as expected.

This function is supported to return a SVGTextContentElement from a Node so it seems logical to use isTextContent() / toSVGTextContentElement() instead of checking manually for all tags that correspond to SVGTextContentElement subclasses.

AFAICT, there is no behavior change with this patch as the checks do the same in the end.

Please let me know if I overlooked something.