Bug 1243337: Indicate the correct context for the generate-id function. r=peterv

This commit is contained in:
Jonas Sicking 2016-02-17 11:46:50 -08:00
parent dec8f6e7f4
commit 3919f82ff1
4 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,3 @@
<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="1243337.xsl" ?>
<root/>

View File

@ -0,0 +1,6 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="generate-id(5)"/>
<html><body/></html>
</xsl:template>
</xsl:stylesheet>

View File

@ -17,3 +17,4 @@ load 603844.html
load 667315.xml
load 1089049.html
load 1205163.xml
load 1243337.xml

View File

@ -41,7 +41,7 @@ GenerateIdFunctionCall::evaluate(txIEvalContext* aContext,
static_cast<txExecutionState*>(aContext->getPrivateContext());
if (!es) {
NS_ERROR(
"called xslt extension function \"current\" with wrong context");
"called xslt extension function \"generate-id\" with wrong context");
return NS_ERROR_UNEXPECTED;
}
@ -92,6 +92,10 @@ GenerateIdFunctionCall::getReturnType()
bool
GenerateIdFunctionCall::isSensitiveTo(ContextSensitivity aContext)
{
if (aContext & PRIVATE_CONTEXT) {
return true;
}
if (mParams.IsEmpty()) {
return !!(aContext & NODE_CONTEXT);
}