Bug 1236991 - part 3: fix tooltips picking up SVG <title> elements inside SVG link tags, r?enndeakin
MozReview-Commit-ID: XEQJQtMCaC
--- a/embedding/browser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/nsDocShellTreeOwner.cpp
@@ -1199,20 +1199,19 @@ nsDefaultTooltipTextProvider::GetNodeTex
nsCOMPtr<nsIURI> uri(linkContent->GetURIExternal());
if (uri) {
currElement->GetAttributeNS(
xlinkNS, NS_LITERAL_STRING("title"), outText);
if (outText.Length()) {
found = true;
}
}
- } else {
- if (lookingForSVGTitle) {
- lookingForSVGTitle = UseSVGTitle(currElement);
- }
+ }
+ if (!found && lookingForSVGTitle) {
+ lookingForSVGTitle = UseSVGTitle(currElement);
if (lookingForSVGTitle) {
nsINodeList* childNodes = content->ChildNodes();
uint32_t childNodeCount = childNodes->Length();
for (uint32_t i = 0; i < childNodeCount; i++) {
nsIContent* child = childNodes->Item(i);
if (child->IsSVGElement(nsGkAtoms::title)) {
static_cast<dom::SVGTitleElement*>(child)->GetTextContent(outText);
if (outText.Length()) {