Bug 1205163: Set readystate correctly for XSLT result with output=text. r=sicking.

--HG--
extra : rebase_source : e3063322df57ed44cb8247b6c129f024f2fe40ce
This commit is contained in:
Peter Van der Beken 2015-09-23 15:34:36 +02:00
parent 426b1b699a
commit 78adaf671d
4 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="1205163.xsl"?>
<result>
<Title>Example</Title>
<Error>Error</Error>
</result>

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Error"/>
</xsl:stylesheet>

View File

@ -16,3 +16,4 @@ load 602115.html
load 603844.html
load 667315.xml
load 1089049.html
load 1205163.xml

View File

@ -81,6 +81,11 @@ txMozillaTextOutput::endDocument(nsresult aResult)
nsresult rv = mTextParent->AppendChildTo(text, true);
NS_ENSURE_SUCCESS(rv, rv);
// This should really be handled by nsIDocument::EndLoad
MOZ_ASSERT(mDocument->GetReadyStateEnum() ==
nsIDocument::READYSTATE_LOADING, "Bad readyState");
mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_INTERACTIVE);
if (NS_SUCCEEDED(aResult)) {
nsCOMPtr<nsITransformObserver> observer = do_QueryReferent(mObserver);
if (observer) {
@ -134,6 +139,10 @@ txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument,
nsresult rv = NS_NewXMLDocument(getter_AddRefs(mDocument),
aLoadedAsData);
NS_ENSURE_SUCCESS(rv, rv);
// This should really be handled by nsIDocument::BeginLoad
MOZ_ASSERT(mDocument->GetReadyStateEnum() ==
nsIDocument::READYSTATE_UNINITIALIZED, "Bad readyState");
mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_LOADING);
nsCOMPtr<nsIDocument> source = do_QueryInterface(aSourceDocument);
NS_ENSURE_STATE(source);
bool hasHadScriptObject = false;