Clean up SVGLocatable.cpp See attached (simple) patch.
Created attachment 29511 [details] Simplify nearestViewportElement and farthestViewportElement using isViewportElement and a for loop WebCore/ChangeLog | 16 +++++++++ WebCore/svg/SVGLocatable.cpp | 72 ++++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 45 deletions(-)
Comment on attachment 29511 [details] Simplify nearestViewportElement and farthestViewportElement using isViewportElement and a for loop > +static bool isViewportElement(Node* node) > { > - Node* n = e->parentNode(); > - while (n && !n->isDocumentNode()) { > - if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) || > - n->hasTagName(SVGNames::imageTag)) > - return static_cast<SVGElement*>(n); > + if (node->hasTagName(SVGNames::svgTag) > + || node->hasTagName(SVGNames::symbolTag) > #if ENABLE(SVG_FOREIGN_OBJECT) > - if (n->hasTagName(SVGNames::foreignObjectTag)) > - return static_cast<SVGElement*>(n); > + || node->hasTagName(SVGNames::foreignObjectTag) > #endif > + || node->hasTagName(SVGNames::imageTag)) > + return true; > + return false; You could just do return node->hasTagName(SVGNames::svgTag) || ....... r=me either way.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/svg/SVGLocatable.cpp Committed r42552