Preventing processing of style links if the HREF is empty. b=30817, r=harishd

git-svn-id: svn://10.0.0.236/trunk@68914 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
attinasi%netscape.com 2000-05-09 23:05:13 +00:00
parent 6eede096f5
commit 6cf3f832c5
2 changed files with 16 additions and 2 deletions

View File

@ -3690,6 +3690,11 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
{
nsresult result = NS_OK;
if (aHref.IsEmpty()) {
// if href is empty then just bail
return result;
}
nsStringArray linkTypes;
ParseLinkTypes(aRel, linkTypes);
PRBool isAlternate = PR_FALSE;
@ -3847,7 +3852,9 @@ HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode)
media.ToLowerCase(); // HTML4.0 spec is inconsistent, make it case INSENSITIVE
}
}
result = ProcessStyleLink(element, href, rel, title, type, media);
if (0 < href.Length()) {
result = ProcessStyleLink(element, href, rel, title, type, media);
}
}
NS_RELEASE(element);
}

View File

@ -3690,6 +3690,11 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
{
nsresult result = NS_OK;
if (aHref.IsEmpty()) {
// if href is empty then just bail
return result;
}
nsStringArray linkTypes;
ParseLinkTypes(aRel, linkTypes);
PRBool isAlternate = PR_FALSE;
@ -3847,7 +3852,9 @@ HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode)
media.ToLowerCase(); // HTML4.0 spec is inconsistent, make it case INSENSITIVE
}
}
result = ProcessStyleLink(element, href, rel, title, type, media);
if (0 < href.Length()) {
result = ProcessStyleLink(element, href, rel, title, type, media);
}
}
NS_RELEASE(element);
}