mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 353364 - Same-document references in xml-stylesheet PI processed incorrectly. r+sr=peterv, a191=beltzner
This commit is contained in:
parent
8fe34ebf2e
commit
6895526488
@ -171,8 +171,7 @@ nsXMLStylesheetPI::GetStyleSheetURL(PRBool* aIsInline,
|
||||
*aURI = nsnull;
|
||||
|
||||
nsAutoString href;
|
||||
GetAttrValue(nsGkAtoms::href, href);
|
||||
if (href.IsEmpty()) {
|
||||
if (!GetAttrValue(nsGkAtoms::href, href)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1374,10 +1374,9 @@ nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget,
|
||||
|
||||
nsAutoString href, title, media;
|
||||
PRBool isAlternate = PR_FALSE;
|
||||
ParsePIData(data, href, title, media, isAlternate);
|
||||
|
||||
// If there was no href, we can't do anything with this PI
|
||||
if (href.IsEmpty()) {
|
||||
if (!ParsePIData(data, href, title, media, isAlternate)) {
|
||||
return DidProcessATokenImpl();
|
||||
}
|
||||
|
||||
@ -1386,16 +1385,14 @@ nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget,
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
PRBool
|
||||
nsXMLContentSink::ParsePIData(const nsString &aData, nsString &aHref,
|
||||
nsString &aTitle, nsString &aMedia,
|
||||
PRBool &aIsAlternate)
|
||||
{
|
||||
nsParserUtils::GetQuotedAttributeValue(aData, nsGkAtoms::href, aHref);
|
||||
|
||||
// If there was no href, we can't do anything with this PI
|
||||
if (aHref.IsEmpty()) {
|
||||
return;
|
||||
if (!nsParserUtils::GetQuotedAttributeValue(aData, nsGkAtoms::href, aHref)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsParserUtils::GetQuotedAttributeValue(aData, nsGkAtoms::title, aTitle);
|
||||
@ -1406,6 +1403,8 @@ nsXMLContentSink::ParsePIData(const nsString &aData, nsString &aHref,
|
||||
nsParserUtils::GetQuotedAttributeValue(aData, nsGkAtoms::alternate, alternate);
|
||||
|
||||
aIsAlternate = alternate.EqualsLiteral("yes");
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
// nsICSSLoaderObserver
|
||||
NS_IMETHOD StyleSheetLoaded(nsICSSStyleSheet* aSheet, PRBool aWasAlternate,
|
||||
nsresult aStatus);
|
||||
static void ParsePIData(const nsString &aData, nsString &aHref,
|
||||
static PRBool ParsePIData(const nsString &aData, nsString &aHref,
|
||||
nsString &aTitle, nsString &aMedia,
|
||||
PRBool &aIsAlternate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user