From 7fc3cdc6a92cc068f234698adae244ea53283168 Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Sat, 12 Dec 2009 14:37:22 +0000 Subject: [PATCH] Bug 467477 - View Source should linkify xlink:href. r=mrbkap --- parser/htmlparser/src/nsViewSourceHTML.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser/htmlparser/src/nsViewSourceHTML.cpp b/parser/htmlparser/src/nsViewSourceHTML.cpp index b9a4be2b3663..5f905994c511 100644 --- a/parser/htmlparser/src/nsViewSourceHTML.cpp +++ b/parser/htmlparser/src/nsViewSourceHTML.cpp @@ -948,6 +948,8 @@ PRBool CViewSourceHTML::IsUrlAttribute(const nsAString& tagName, PRBool isHref = trimmedAttrName.LowerCaseEqualsLiteral("href"); PRBool isSrc = !isHref && trimmedAttrName.LowerCaseEqualsLiteral("src"); + PRBool isXLink = !isHref && !isSrc && + mDocType == eXML && trimmedAttrName.EqualsLiteral("xlink:href"); // If this is the HREF attribute of a BASE element, then update the base URI. // This doesn't feel like the ideal place for this, but the alternatives don't @@ -959,7 +961,7 @@ PRBool CViewSourceHTML::IsUrlAttribute(const nsAString& tagName, SetBaseURI(expandedBaseSpec); } - return isHref || isSrc; + return isHref || isSrc || isXLink; } void CViewSourceHTML::WriteHrefAttribute(nsTokenAllocator* allocator,