Bug 118284

Summary: Simplify SVGTextContentElement::elementFromRenderer()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: SVGAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, d-r, fmalita, krit, laszlo.gombos, pdr, rwlbuis, schenney, thorton, zimmermann
Priority: P2 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.