Merge to tip after applying bundle for bug 353364

This commit is contained in:
Shawn Wilsher 2008-11-28 15:30:28 -08:00
commit aed89a8174
23 changed files with 119 additions and 10 deletions

View File

@ -0,0 +1,2 @@
<?xml-stylesheet type="text/css" href="passer.css"?>
<element/>

View File

@ -0,0 +1,2 @@
<?xml-stylesheet type="text/css" href="passer.css"?>
<element/>

View File

@ -0,0 +1 @@
Link: <failer.css>;rel="stylesheet";type="text/css"

View File

@ -0,0 +1,2 @@
<?xml-stylesheet type="text/css" href="failer.css"?>
<element/>

View File

@ -0,0 +1 @@
Link: <passer_override.css>;rel="stylesheet";type="text/css"

View File

@ -0,0 +1,20 @@
<!DOCTYPE svg:svg [<!ATTLIST transform id ID #IMPLIED>]>
<?xml-stylesheet type="application/xml" href="#transform"?>
<svg:svg xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:svg="http://www.w3.org/2000/svg">
<svg:defs>
<transform id="transform" version="1.0">
<template match="node()|@*">
<copy>
<apply-templates select="@*"/>
<apply-templates/>
</copy>
</template>
<template match="svg:defs"/>
<template match="@fill">
<attribute name="fill">lime</attribute>
</template>
</transform>
</svg:defs>
<svg:rect width="100%" height="100%" fill="red"/>
</svg:svg>

After

Width:  |  Height:  |  Size: 607 B

View File

@ -0,0 +1,8 @@
<?xml-stylesheet type="application/xml"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xslt:version="1.0">
<rect width="100%" height="100%" fill="lime">
<xslt:attribute name="fill">red</xslt:attribute>
</rect>
</svg>

After

Width:  |  Height:  |  Size: 270 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<desc>Fail</desc>
<rect width="100%" height="100%" fill="red"/>
</svg>

After

Width:  |  Height:  |  Size: 114 B

View File

@ -0,0 +1 @@
:root { background: red; }

View File

@ -0,0 +1,9 @@
<!DOCTYPE svg [<!ATTLIST svg id ID #IMPLIED>]>
<?xml-stylesheet type="application/xml" href="#transform"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
id="transform" xslt:version="1.0">
<rect width="100%" height="100%" fill="red">
<xslt:attribute name="fill">lime</xslt:attribute>
</rect>
</svg>

After

Width:  |  Height:  |  Size: 350 B

View File

@ -0,0 +1,8 @@
<?xml-stylesheet type="application/xml" href=""?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xslt:version="1.0">
<rect width="100%" height="100%" fill="red">
<xslt:attribute name="fill">lime</xslt:attribute>
</rect>
</svg>

After

Width:  |  Height:  |  Size: 278 B

View File

@ -0,0 +1,9 @@
<?xml-stylesheet type="application/xml"
href="lreas_selflink_relative_href.svg"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xslt:version="1.0">
<rect width="100%" height="100%" fill="red">
<xslt:attribute name="fill">lime</xslt:attribute>
</rect>
</svg>

After

Width:  |  Height:  |  Size: 312 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<desc>Pass</desc>
<rect width="100%" height="100%" fill="lime"/>
</svg>

After

Width:  |  Height:  |  Size: 115 B

View File

@ -0,0 +1 @@
:root { background: lime; }

View File

@ -0,0 +1 @@
:root { background: lime !important; }

View File

@ -0,0 +1,10 @@
== css_relative_href.xml pass.svg
HTTP == css_relative_href_also_external.xml pass.svg
HTTP == css_relative_href_also_external_override.xml pass.svg
== embedded_dtd_id.svg pass.svg
!= error_no_href.svg fail.svg
fails == lreas_selflink_dtd_id.svg pass.svg
== lreas_selflink_empty_href.svg pass.svg
== lreas_selflink_relative_href.svg pass.svg
== xslt_relative_href.svg pass.svg
== xslt_selflink_empty_href.xslt pass.svg

View File

@ -0,0 +1,11 @@
<transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<template match="node()|@*">
<copy>
<apply-templates select="@*"/>
<apply-templates/>
</copy>
</template>
<template match="@fill">
<attribute name="fill">lime</attribute>
</template>
</transform>

View File

@ -0,0 +1,4 @@
<?xml-stylesheet type="application/xml" href="svg_passer.xslt"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="red"/>
</svg>

After

Width:  |  Height:  |  Size: 160 B

View File

@ -0,0 +1,10 @@
<?xml-stylesheet type="application/xml" href=""?>
<xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/2000/svg"
version="1.0">
<xslt:template match="/xslt:transform">
<svg>
<rect width="100%" height="100%" fill="lime"/>
</svg>
</xslt:template>
</xslt:transform>

View File

@ -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;
}

View File

@ -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;
}
/*

View File

@ -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);

View File

@ -126,6 +126,9 @@ include text-transform/reftest.list
# -moz-transform/
include transform/reftest.list
# xml-stylesheet/
include ../../content/test/reftest/xml-stylesheet/reftest.list
# xul-document-load/
include xul-document-load/reftest.list