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:
parent
6eede096f5
commit
6cf3f832c5
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user