Fix for bug 142108 (Crash when reloading XML+XSLT Trunk, M100, N70PR1, M11A [@ nsXMLContentSink::Observe][@ 0x00000001]). r=Pike, sr=jst.
This commit is contained in:
Родитель
914124385d
Коммит
6d9c1486db
|
@ -941,7 +941,8 @@ sub BuildClientDist()
|
|||
InstallFromManifest(":mozilla:content:xbl:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xml:content:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xml:document:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xsl:document:src:MANIFEST_IDL", "$distdirectory:idl:");
|
||||
InstallFromManifest(":mozilla:content:xsl:document:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xsl:document:public:MANIFEST_IDL", "$distdirectory:idl:");
|
||||
InstallFromManifest(":mozilla:content:xul:content:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xul:document:public:MANIFEST", "$distdirectory:content:");
|
||||
InstallFromManifest(":mozilla:content:xul:document:public:MANIFEST_IDL", "$distdirectory:idl:");
|
||||
|
|
|
@ -40,7 +40,6 @@ my %map = (
|
|||
'commandhandler', 'embedding/components/commandhandler',
|
||||
'composer', 'editor/composer',
|
||||
'content', 'content',
|
||||
'content_xsl', 'content/xsl/document',
|
||||
'cookie', 'extensions/cookie',
|
||||
'ctl', 'extensions/ctl',
|
||||
'dbm', 'dbm',
|
||||
|
|
|
@ -44,7 +44,6 @@ class nsIDocument;
|
|||
class nsIPresContext;
|
||||
class nsIPresShell;
|
||||
class nsIStyleSheet;
|
||||
class nsITransformMediator;
|
||||
|
||||
#define NS_IDOCUMENT_VIEWER_IID \
|
||||
{ 0xa6cf9057, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
@ -68,8 +67,6 @@ public:
|
|||
|
||||
NS_IMETHOD CreateDocumentViewerUsing(nsIPresContext* aPresContext,
|
||||
nsIDocumentViewer*& aResult) = 0;
|
||||
|
||||
NS_IMETHOD SetTransformMediator(nsITransformMediator* aMediator)=0;
|
||||
};
|
||||
|
||||
#endif /* nsIDocumentViewer_h___ */
|
||||
|
|
|
@ -49,7 +49,6 @@ REQUIRES = xpcom \
|
|||
xpconnect \
|
||||
util \
|
||||
unicharutil \
|
||||
content_xsl \
|
||||
xuldoc \
|
||||
intl \
|
||||
windowwatcher \
|
||||
|
|
|
@ -1,120 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
LIBRARY_NAME=contentbase_s
|
||||
DEFINES=-D_IMPL_NS_LAYOUT -DWIN32_LEAN_AND_MEAN
|
||||
!if defined(XP_NEW_SELECTION)
|
||||
DEFINES = $(DEFINES) -DXP_NEW_SELECTION
|
||||
!endif
|
||||
|
||||
MODULE=content
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
dom \
|
||||
widget \
|
||||
view \
|
||||
locale \
|
||||
htmlparser \
|
||||
js \
|
||||
webshell \
|
||||
necko \
|
||||
caps \
|
||||
lwbrk \
|
||||
uconv \
|
||||
chrome \
|
||||
docshell \
|
||||
uriloader \
|
||||
pref \
|
||||
xpconnect \
|
||||
util \
|
||||
unicharutil \
|
||||
layout \
|
||||
gfx \
|
||||
layout_xul \
|
||||
content_xsl \
|
||||
content_xul \
|
||||
windowwatcher \
|
||||
intl \
|
||||
imglib2 \
|
||||
gfx2 \
|
||||
uriloader \
|
||||
webBrowser_core\
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsPrintPreviewListener.obj \
|
||||
.\$(OBJDIR)\nsStyleContext.obj \
|
||||
.\$(OBJDIR)\nsStyleSet.obj \
|
||||
.\$(OBJDIR)\nsCommentNode.obj \
|
||||
.\$(OBJDIR)\nsGenericDOMDataNode.obj \
|
||||
.\$(OBJDIR)\nsGenericDOMNodeList.obj \
|
||||
.\$(OBJDIR)\nsGenericElement.obj \
|
||||
.\$(OBJDIR)\nsContentList.obj \
|
||||
.\$(OBJDIR)\nsContentIterator.obj \
|
||||
.\$(OBJDIR)\nsContentPolicy.obj \
|
||||
.\$(OBJDIR)\nsDocument.obj \
|
||||
.\$(OBJDIR)\nsDocumentEncoder.obj \
|
||||
.\$(OBJDIR)\nsDocumentFragment.obj \
|
||||
.\$(OBJDIR)\nsDocumentViewer.obj \
|
||||
.\$(OBJDIR)\nsDOMAttribute.obj \
|
||||
.\$(OBJDIR)\nsDOMAttributeMap.obj \
|
||||
.\$(OBJDIR)\nsDOMDocumentType.obj \
|
||||
.\$(OBJDIR)\nsGeneratedIterator.obj \
|
||||
.\$(OBJDIR)\nsNameSpaceManager.obj \
|
||||
.\$(OBJDIR)\nsNodeInfo.obj \
|
||||
.\$(OBJDIR)\nsNodeInfoManager.obj \
|
||||
.\$(OBJDIR)\nsSelection.obj \
|
||||
.\$(OBJDIR)\nsRange.obj \
|
||||
.\$(OBJDIR)\nsRuleNode.obj \
|
||||
.\$(OBJDIR)\nsTextContentChangeData.obj \
|
||||
.\$(OBJDIR)\nsTextNode.obj \
|
||||
.\$(OBJDIR)\nsTreeWalker.obj \
|
||||
.\$(OBJDIR)\nsXMLContentSerializer.obj \
|
||||
.\$(OBJDIR)\nsHTMLContentSerializer.obj \
|
||||
.\$(OBJDIR)\nsParserUtils.obj \
|
||||
.\$(OBJDIR)\nsPlainTextSerializer.obj \
|
||||
.\$(OBJDIR)\mozSanitizingSerializer.obj \
|
||||
.\$(OBJDIR)\nsContentUtils.obj \
|
||||
.\$(OBJDIR)\nsScriptLoader.obj \
|
||||
.\$(OBJDIR)\nsStyleLinkElement.obj \
|
||||
.\$(OBJDIR)\nsContentAreaDragDrop.obj \
|
||||
.\$(OBJDIR)\nsFrameLoader.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I..\..\html\base\src -I..\..\html\style\src \
|
||||
-I..\..\xul\base\src -I..\..\xul\content\src \
|
||||
-I..\..\events\src -I..\..\html\content\src
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
rm -f $(PDBFILE).pdb
|
|
@ -184,8 +184,6 @@ const char* kPrintingPromptService = "@mozilla.org/embedcomp/printingprompt-serv
|
|||
#include "nsIDOMFocusListener.h"
|
||||
#include "nsISelectionController.h"
|
||||
|
||||
#include "nsITransformMediator.h"
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiUtils.h"
|
||||
#endif
|
||||
|
@ -511,7 +509,6 @@ public:
|
|||
NS_IMETHOD GetPresContext(nsIPresContext*& aResult);
|
||||
NS_IMETHOD CreateDocumentViewerUsing(nsIPresContext* aPresContext,
|
||||
nsIDocumentViewer*& aResult);
|
||||
NS_IMETHOD SetTransformMediator(nsITransformMediator* aMediator);
|
||||
|
||||
// nsIContentViewerEdit
|
||||
NS_DECL_NSICONTENTVIEWEREDIT
|
||||
|
@ -698,9 +695,8 @@ protected:
|
|||
nsISupports* mContainer; // [WEAK] it owns me!
|
||||
nsCOMPtr<nsIDeviceContext> mDeviceContext; // ??? can't hurt, but...
|
||||
|
||||
// the following seven items are explicitly in this order
|
||||
// the following six items are explicitly in this order
|
||||
// so they will be destroyed in the reverse order (pinkerton, scc)
|
||||
nsCOMPtr<nsITransformMediator> mTransformMediator;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIWidget> mWindow; // ??? should we really own it?
|
||||
nsCOMPtr<nsIViewManager> mViewManager;
|
||||
|
@ -1389,8 +1385,6 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
|
|||
const nsRect& aBounds,
|
||||
PRBool aDoCreation)
|
||||
{
|
||||
mTransformMediator = nsnull;
|
||||
|
||||
#ifdef NS_PRINT_PREVIEW
|
||||
mParentWidget = aParentWidget; // not ref counted
|
||||
#endif
|
||||
|
@ -5343,16 +5337,6 @@ nsresult DocumentViewerImpl::DocumentReadyForPrinting()
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::SetTransformMediator(nsITransformMediator* aMediator)
|
||||
{
|
||||
NS_ASSERTION(!mTransformMediator || !aMediator,
|
||||
"nsXMLDocument::SetTransformMediator(): \
|
||||
Cannot set a second transform mediator\n");
|
||||
mTransformMediator = aMediator;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
|
|
@ -347,7 +347,7 @@
|
|||
<!-- Settings for "FTP Panel" panel -->
|
||||
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_password</NAME><VALUE>25jysun5jyay2Ù±ÀÑ“(</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
|
||||
|
@ -897,6 +897,13 @@
|
|||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsITransformObserver.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
</FILELIST>
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
|
@ -1004,6 +1011,11 @@
|
|||
<PATH>nsIDragDropOverride.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsITransformObserver.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</LINKORDER>
|
||||
</TARGET>
|
||||
<TARGET>
|
||||
|
@ -1300,7 +1312,7 @@
|
|||
<!-- Settings for "FTP Panel" panel -->
|
||||
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_password</NAME><VALUE>25jysun5jyay2Ù±ÀÑ“(</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
|
||||
|
@ -1850,6 +1862,13 @@
|
|||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsITransformObserver.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
</FILELIST>
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
|
@ -1957,6 +1976,11 @@
|
|||
<PATH>nsIDragDropOverride.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsITransformObserver.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</LINKORDER>
|
||||
</TARGET>
|
||||
</TARGETLIST>
|
||||
|
@ -2093,6 +2117,12 @@
|
|||
<PATH>nsIDragDropOverride.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>headers</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsITransformObserver.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</GROUPLIST>
|
||||
|
||||
</PROJECT>
|
||||
|
|
|
@ -88,7 +88,6 @@
|
|||
#include "nsXSLContentSink.h"
|
||||
#include "nsParserCIID.h"
|
||||
#include "nsParserUtils.h"
|
||||
#include "nsIDocumentViewer.h"
|
||||
#include "nsIScrollable.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsGenericElement.h"
|
||||
|
@ -260,7 +259,7 @@ NS_INTERFACE_MAP_BEGIN(nsXMLContentSink)
|
|||
NS_INTERFACE_MAP_ENTRY(nsIXMLContentSink)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContentSink)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIExpatSink)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsITransformObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptLoaderObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
|
||||
|
@ -362,13 +361,14 @@ nsXMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
|
|||
rv = SetupTransformMediator();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptLoader> loader;
|
||||
mDocument->GetScriptLoader(getter_AddRefs(loader));
|
||||
if (loader) {
|
||||
loader->RemoveObserver(this);
|
||||
}
|
||||
|
||||
// Kick off layout for non-XSLT transformed documents.
|
||||
if (!mXSLTransformMediator || NS_FAILED(rv)) {
|
||||
nsCOMPtr<nsIScriptLoader> loader;
|
||||
mDocument->GetScriptLoader(getter_AddRefs(loader));
|
||||
if (loader) {
|
||||
loader->RemoveObserver(this);
|
||||
}
|
||||
|
||||
StartLayout();
|
||||
|
||||
#if 0 /* Disable until this works for XML */
|
||||
|
@ -392,7 +392,7 @@ nsXMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
|
|||
// Do this hack to make sure that the parser
|
||||
// doesn't get destroyed, accidently, before
|
||||
// the circularity, between sink & parser, is
|
||||
// actually borken.
|
||||
// actually broken.
|
||||
nsCOMPtr<nsIParser> kungFuDeathGrip(mParser);
|
||||
|
||||
// Drop our reference to the parser to get rid of a circular
|
||||
|
@ -402,88 +402,71 @@ nsXMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// The observe method is called on completion of the transform. The nsISupports argument is an
|
||||
// nsIContent interface to the root node of the output content model.
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSink::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
|
||||
nsXMLContentSink::OnTransformDone(nsresult aResult,
|
||||
nsIDOMDocument* aResultDocument)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_ASSERTION(NS_FAILED(aResult) || aResultDocument,
|
||||
"Don't notify about transform success without a document.");
|
||||
|
||||
if (!nsCRT::strcmp(aTopic, "xslt-done")) {
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
// Reset the observer on the transform mediator
|
||||
mXSLTransformMediator->SetTransformObserver(nsnull);
|
||||
|
||||
// Set the output content model on the document
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aSubject, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIDOMDocument> resultDOMDoc;
|
||||
mXSLTransformMediator->GetResultDocument(getter_AddRefs(resultDOMDoc));
|
||||
nsCOMPtr<nsIDocument> resultDoc = do_QueryInterface(resultDOMDoc);
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
|
||||
nsCOMPtr<nsIDocument> sourceDoc = mDocument;
|
||||
NS_RELEASE(mDocument);
|
||||
|
||||
mDocument = resultDoc;
|
||||
NS_ADDREF(mDocument);
|
||||
nsCOMPtr<nsIContent> root;
|
||||
mDocument->GetRootContent(getter_AddRefs(root));
|
||||
if (!root)
|
||||
mDocument->SetRootContent(content);
|
||||
|
||||
// Reset the observer on the transform mediator
|
||||
mXSLTransformMediator->SetTransformObserver(nsnull);
|
||||
|
||||
// Start the layout process
|
||||
StartLayout();
|
||||
|
||||
#if 0 /* Disable until this works for XML */
|
||||
// Scroll to Anchor only if the document was *not* loaded through history means.
|
||||
PRUint32 documentLoadType = 0;
|
||||
docShell->GetLoadType(&documentLoadType);
|
||||
if (!(documentLoadType & nsIDocShell::LOAD_CMD_HISTORY)) {
|
||||
ScrollToRef();
|
||||
}
|
||||
#else
|
||||
ScrollToRef();
|
||||
#endif
|
||||
|
||||
sourceDoc->EndLoad();
|
||||
|
||||
if (contentViewer) {
|
||||
contentViewer->LoadComplete(NS_OK);
|
||||
}
|
||||
if (NS_FAILED(aResult) && contentViewer) {
|
||||
// Transform failed.
|
||||
if (aResultDocument) {
|
||||
// We have an error document.
|
||||
contentViewer->SetDOMDocument(aResultDocument);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transform failed
|
||||
nsCOMPtr<nsIDocumentViewer> documentViewer(do_QueryInterface(contentViewer));
|
||||
if (documentViewer) {
|
||||
documentViewer->SetTransformMediator(nsnull);
|
||||
}
|
||||
|
||||
mDocument->SetRootContent(mDocElement);
|
||||
|
||||
// Start the layout process
|
||||
StartLayout();
|
||||
|
||||
#if 0 /* Disable until this works for XML */
|
||||
// Scroll to Anchor only if the document was *not* loaded through history means.
|
||||
PRUint32 documentLoadType = 0;
|
||||
docShell->GetLoadType(&documentLoadType);
|
||||
if (!(documentLoadType & nsIDocShell::LOAD_CMD_HISTORY)) {
|
||||
ScrollToRef();
|
||||
}
|
||||
#else
|
||||
ScrollToRef();
|
||||
#endif
|
||||
|
||||
mDocument->EndLoad();
|
||||
else {
|
||||
// We don't have an error document, display the
|
||||
// untransformed source document.
|
||||
nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocument);
|
||||
contentViewer->SetDOMDocument(document);
|
||||
}
|
||||
|
||||
mXSLTransformMediator = nsnull;
|
||||
}
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIDocument> originalDocument = mDocument;
|
||||
if (NS_SUCCEEDED(aResult) || aResultDocument) {
|
||||
// Transform succeeded or it failed and we have an error
|
||||
// document to display.
|
||||
NS_RELEASE(mDocument);
|
||||
CallQueryInterface(aResultDocument, &mDocument); // addrefs
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transform failed and we don't have an error document, display the
|
||||
// untransformed source document.
|
||||
mDocument->SetRootContent(mDocElement);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptLoader> loader;
|
||||
originalDocument->GetScriptLoader(getter_AddRefs(loader));
|
||||
if (loader) {
|
||||
loader->RemoveObserver(this);
|
||||
}
|
||||
|
||||
// Start the layout process
|
||||
StartLayout();
|
||||
|
||||
#if 0 /* Disable until this works for XML */
|
||||
// Scroll to Anchor only if the document was *not* loaded through history means.
|
||||
PRUint32 documentLoadType = 0;
|
||||
docShell->GetLoadType(&documentLoadType);
|
||||
if (!(documentLoadType & nsIDocShell::LOAD_CMD_HISTORY)) {
|
||||
ScrollToRef();
|
||||
}
|
||||
#else
|
||||
ScrollToRef();
|
||||
#endif
|
||||
|
||||
originalDocument->EndLoad();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -512,13 +495,10 @@ nsXMLContentSink::SetupTransformMediator()
|
|||
rv = NS_NewDOMDocument(getter_AddRefs(resultDOMDoc), emptyStr, emptyStr, nsnull, url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIXMLDocument> resultXMLDoc(do_QueryInterface(resultDOMDoc));
|
||||
resultXMLDoc->SetDefaultStylesheets(url);
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
if (NS_SUCCEEDED(rv) && contentViewer) {
|
||||
docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
if (contentViewer) {
|
||||
contentViewer->SetDOMDocument(resultDOMDoc);
|
||||
}
|
||||
|
||||
|
@ -651,15 +631,6 @@ nsXMLContentSink::LoadXSLStyleSheet(nsIURI* aUrl)
|
|||
// this state by calling the various setters on nsITransformMediator.
|
||||
mXSLTransformMediator->SetEnabled(PR_TRUE);
|
||||
|
||||
// The document viewer owns the transform mediator.
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
nsCOMPtr<nsIDocumentViewer> documentViewer(do_QueryInterface(contentViewer));
|
||||
if (documentViewer) {
|
||||
documentViewer->SetTransformMediator(mXSLTransformMediator);
|
||||
}
|
||||
|
||||
// Create the XSL stylesheet document
|
||||
nsCOMPtr<nsIDOMDocument> styleDOMDoc;
|
||||
nsAutoString emptyStr;
|
||||
|
@ -1972,13 +1943,6 @@ nsXMLContentSink::ReportError(const PRUnichar* aErrorText,
|
|||
|
||||
if (mXSLTransformMediator) {
|
||||
// Get rid of the transform mediator.
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
nsCOMPtr<nsIDocumentViewer> documentViewer(do_QueryInterface(contentViewer));
|
||||
if (documentViewer) {
|
||||
documentViewer->SetTransformMediator(nsnull);
|
||||
}
|
||||
mXSLTransformMediator->SetEnabled(PR_FALSE);
|
||||
mXSLTransformMediator = nsnull;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsIXMLContentSink.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsITransformMediator.h"
|
||||
#include "nsIUnicharInputStream.h"
|
||||
|
@ -58,6 +57,7 @@ class nsICSSStyleSheet;
|
|||
#include "nsIScriptLoaderObserver.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsIExpatSink.h"
|
||||
#include "nsITransformObserver.h"
|
||||
|
||||
class nsIDocument;
|
||||
class nsIURI;
|
||||
|
@ -81,7 +81,7 @@ typedef enum {
|
|||
// XXX Till the parser knows a little bit more about XML,
|
||||
// this is a HTMLContentSink.
|
||||
class nsXMLContentSink : public nsIXMLContentSink,
|
||||
public nsIObserver,
|
||||
public nsITransformObserver,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIScriptLoaderObserver,
|
||||
public nsICSSLoaderObserver,
|
||||
|
@ -99,7 +99,7 @@ public:
|
|||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISCRIPTLOADEROBSERVER
|
||||
|
||||
NS_DECL_NSITRANSFORMOBSERVER
|
||||
NS_DECL_NSIEXPATSINK
|
||||
|
||||
// nsIContentSink
|
||||
|
@ -114,11 +114,6 @@ public:
|
|||
// nsICSSLoaderObserver
|
||||
NS_IMETHOD StyleSheetLoaded(nsICSSStyleSheet*aSheet, PRBool aNotify);
|
||||
|
||||
// nsIObserver
|
||||
NS_IMETHOD Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
const PRUnichar *someData);
|
||||
|
||||
protected:
|
||||
void StartLayout();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = src
|
||||
DIRS = public src
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=src
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -22,7 +22,7 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = content_xsl
|
||||
MODULE = content
|
||||
LIBRARY_NAME = gkconxsldoc_s
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
|
@ -44,19 +44,11 @@ ifeq ($(OS_ARCH),WINNT)
|
|||
DEFINES += -DWIN32_LEAN_AND_MEAN
|
||||
endif
|
||||
|
||||
XPIDLSRCS= \
|
||||
nsIDocumentTransformer.idl \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsXSLContentSink.cpp \
|
||||
nsTransformMediator.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsITransformMediator.h \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../../../xml/document/src \
|
||||
$(NULL)
|
||||
|
|
|
@ -21,9 +21,10 @@
|
|||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
LIBRARY_NAME=contentxsldoc_s
|
||||
MODULE=content_xsl
|
||||
REQUIRES = xpcom \
|
||||
LIBRARY_NAME = contentxsldoc_s
|
||||
MODULE = content
|
||||
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
htmlparser \
|
||||
view \
|
||||
|
@ -37,18 +38,11 @@ REQUIRES = xpcom \
|
|||
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
XPIDLSRCS= .\nsIDocumentTransformer.idl \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsXSLContentSink.obj \
|
||||
.\$(OBJDIR)\nsTransformMediator.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsITransformMediator.h \
|
||||
$(NULL)
|
||||
|
||||
LINCS= -I..\..\..\html\style\src -I..\..\..\html\base\src \
|
||||
-I..\..\..\html\content\src -I..\..\..\html\document\src \
|
||||
-I..\..\..\xul\content\src -I..\..\..\xml\document\src \
|
||||
|
|
|
@ -38,11 +38,6 @@
|
|||
|
||||
#include "nsTransformMediator.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIServiceManagerUtils.h"
|
||||
#include "nsObserverService.h"
|
||||
#include "nsString.h"
|
||||
|
||||
nsresult
|
||||
|
@ -102,37 +97,24 @@ NS_IMPL_ISUPPORTS1(nsTransformMediator, nsITransformMediator)
|
|||
void
|
||||
nsTransformMediator::TryToTransform()
|
||||
{
|
||||
if (mSourceDOM && mStyleDOM && mResultDoc && mObserver)
|
||||
nsCOMPtr<nsITransformObserver> observer = do_QueryReferent(mObserver);
|
||||
if (mSourceDOM && mStyleDOM && mResultDoc && observer)
|
||||
{
|
||||
if (mEnabled && mTransformer) {
|
||||
mTransformer->TransformDocument(mSourceDOM,
|
||||
mStyleDOM,
|
||||
mResultDoc,
|
||||
mObserver);
|
||||
observer);
|
||||
}
|
||||
else if (mStyleInvalid) {
|
||||
// Copy the error message from the stylesheet document to the result
|
||||
// result document and notify the observer.
|
||||
nsCOMPtr<nsIDOMElement> docElement;
|
||||
mResultDoc->GetDocumentElement(getter_AddRefs(docElement));
|
||||
nsCOMPtr<nsIDOMNode> newRoot, root;
|
||||
mResultDoc->ImportNode(mStyleDOM, PR_TRUE, getter_AddRefs(newRoot));
|
||||
if (docElement) {
|
||||
nsCOMPtr<nsIDOMNode> origRoot;
|
||||
root = newRoot;
|
||||
mResultDoc->ReplaceChild(docElement, root, getter_AddRefs(origRoot));
|
||||
}
|
||||
else {
|
||||
mResultDoc->AppendChild(newRoot, getter_AddRefs(root));
|
||||
}
|
||||
// Avoid recursion.
|
||||
mStyleInvalid = PR_FALSE;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIObserverService> anObserverService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
anObserverService->AddObserver(mObserver, "xslt-done", PR_TRUE);
|
||||
anObserverService->NotifyObservers(root, "xslt-done", nsnull);
|
||||
}
|
||||
// Notify the observer with the stylesheet which contains
|
||||
// the error message.
|
||||
nsCOMPtr<nsIDOMDocument> errorDoc;
|
||||
mStyleDOM->GetOwnerDocument(getter_AddRefs(errorDoc));
|
||||
observer->OnTransformDone(NS_ERROR_FAILURE, errorDoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,9 +161,9 @@ nsTransformMediator::GetResultDocument(nsIDOMDocument** aDoc)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTransformMediator::SetTransformObserver(nsIObserver* aObserver)
|
||||
nsTransformMediator::SetTransformObserver(nsITransformObserver* aObserver)
|
||||
{
|
||||
mObserver = aObserver;
|
||||
mObserver = do_GetWeakReference(aObserver);
|
||||
TryToTransform();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
#include "nsIDocumentTransformer.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsITransformObserver.h"
|
||||
#include "nsWeakPtr.h"
|
||||
|
||||
class nsTransformMediator : public nsITransformMediator {
|
||||
public:
|
||||
|
@ -62,7 +63,7 @@ public:
|
|||
NS_IMETHOD SetStyleSheetContentModel(nsIDOMNode* aStyle);
|
||||
NS_IMETHOD SetResultDocument(nsIDOMDocument* aDoc);
|
||||
NS_IMETHOD GetResultDocument(nsIDOMDocument** aDoc);
|
||||
NS_IMETHOD SetTransformObserver(nsIObserver* aObserver);
|
||||
NS_IMETHOD SetTransformObserver(nsITransformObserver* aObserver);
|
||||
NS_IMETHOD SetStyleInvalid(PRBool aInvalid);
|
||||
|
||||
protected:
|
||||
|
@ -70,11 +71,11 @@ protected:
|
|||
|
||||
PRBool mEnabled;
|
||||
PRBool mStyleInvalid;
|
||||
nsCOMPtr<nsIDocumentTransformer> mTransformer; // Strong reference
|
||||
nsCOMPtr<nsIDOMNode> mSourceDOM; // Strong reference
|
||||
nsCOMPtr<nsIDOMNode> mStyleDOM; // Strong reference
|
||||
nsCOMPtr<nsIDOMDocument> mResultDoc; // Strong reference
|
||||
nsCOMPtr<nsIObserver> mObserver; // Strong reference
|
||||
nsCOMPtr<nsIDocumentTransformer> mTransformer;
|
||||
nsCOMPtr<nsIDOMNode> mSourceDOM;
|
||||
nsCOMPtr<nsIDOMNode> mStyleDOM;
|
||||
nsCOMPtr<nsIDOMDocument> mResultDoc;
|
||||
nsWeakPtr mObserver;
|
||||
};
|
||||
|
||||
#endif // nsTransformMediator_h__
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIParser.h"
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
#include "nsITransformMediator.h"
|
||||
|
@ -55,21 +56,17 @@ NS_NewXSLContentSink(nsIXMLContentSink** aResult,
|
|||
nsIURI* aURL,
|
||||
nsIWebShell* aWebShell)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aResult, "null ptr");
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
NS_ENSURE_ARG(aResult);
|
||||
|
||||
nsXSLContentSink* it;
|
||||
NS_NEWXPCOM(it, nsXSLContentSink);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
NS_ENSURE_TRUE(it, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsCOMPtr<nsIXMLContentSink> sink = it;
|
||||
nsresult rv = it->Init(aTM, aDoc, aURL, aWebShell);
|
||||
if (NS_OK != rv) {
|
||||
delete it;
|
||||
return rv;
|
||||
}
|
||||
return it->QueryInterface(NS_GET_IID(nsIXMLContentSink), (void **)aResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return CallQueryInterface(it, aResult);
|
||||
}
|
||||
|
||||
nsXSLContentSink::nsXSLContentSink()
|
||||
|
@ -82,15 +79,13 @@ nsXSLContentSink::~nsXSLContentSink()
|
|||
// Empty
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsXSLContentSink::Init(nsITransformMediator* aTM,
|
||||
nsIDocument* aDoc,
|
||||
nsIURI* aURL,
|
||||
nsIWebShell* aContainer)
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsXMLContentSink::Init(aDoc, aURL, aContainer, nsnull);
|
||||
nsresult rv = nsXMLContentSink::Init(aDoc, aURL, aContainer, nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mXSLTransformMediator = aTM;
|
||||
|
@ -98,7 +93,10 @@ nsXSLContentSink::Init(nsITransformMediator* aTM,
|
|||
nsCOMPtr<nsIScriptLoader> loader;
|
||||
rv = mDocument->GetScriptLoader(getter_AddRefs(loader));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
loader->Suspend();
|
||||
loader->RemoveObserver(this);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -140,6 +138,7 @@ nsXSLContentSink::DidBuildModel(PRInt32 aQualityLevel)
|
|||
if (mXSLTransformMediator) {
|
||||
// Pass the style content model to the tranform mediator.
|
||||
mXSLTransformMediator->SetStyleSheetContentModel(styleNode);
|
||||
mXSLTransformMediator = nsnull;
|
||||
}
|
||||
|
||||
// Drop our reference to the parser to get rid of a circular
|
||||
|
@ -222,6 +221,12 @@ nsXSLContentSink::ReportError(const PRUnichar* aErrorText,
|
|||
// nsXMLContentSink::ReportError sets mXSLTransformMediator to nsnull
|
||||
nsCOMPtr<nsITransformMediator> mediator = mXSLTransformMediator;
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
mParser->GetChannel(getter_AddRefs(channel));
|
||||
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
|
||||
mDocument->Reset(channel, loadGroup);
|
||||
|
||||
nsXMLContentSink::ReportError(aErrorText, aSourceText);
|
||||
|
||||
if (mediator) {
|
||||
|
|
|
@ -37,7 +37,6 @@ REQUIRES = xpcom \
|
|||
dom \
|
||||
layout \
|
||||
content \
|
||||
content_xsl \
|
||||
widget \
|
||||
necko \
|
||||
js \
|
||||
|
|
|
@ -25,7 +25,6 @@ REQUIRES = xpcom \
|
|||
string \
|
||||
dom \
|
||||
widget \
|
||||
content_xsl \
|
||||
necko \
|
||||
content \
|
||||
xpconnect \
|
||||
|
|
|
@ -35,7 +35,6 @@ REQUIRES = string \
|
|||
dom \
|
||||
layout \
|
||||
content \
|
||||
content_xsl \
|
||||
widget \
|
||||
necko \
|
||||
unicharutil \
|
||||
|
|
|
@ -2275,7 +2275,7 @@ NS_IMETHODIMP
|
|||
XSLTProcessor::TransformDocument(nsIDOMNode* aSourceDOM,
|
||||
nsIDOMNode* aStyleDOM,
|
||||
nsIDOMDocument* aOutputDoc,
|
||||
nsIObserver* aObserver)
|
||||
nsITransformObserver* aObserver)
|
||||
{
|
||||
// We need source and result documents but no stylesheet.
|
||||
NS_ENSURE_ARG(aSourceDOM);
|
||||
|
@ -2402,7 +2402,7 @@ XSLTProcessor::TransformDocument(nsIDOMNode* aSourceDOM,
|
|||
document->ContentInserted(nsnull, root, 0);
|
||||
}
|
||||
|
||||
mObserver = aObserver;
|
||||
mObserver = do_GetWeakReference(aObserver);
|
||||
SignalTransformEnd();
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2442,7 +2442,8 @@ XSLTProcessor::ScriptEvaluated(nsresult aResult,
|
|||
void
|
||||
XSLTProcessor::SignalTransformEnd()
|
||||
{
|
||||
if (!mObserver)
|
||||
nsCOMPtr<nsITransformObserver> observer = do_QueryReferent(mObserver);
|
||||
if (!observer)
|
||||
return;
|
||||
|
||||
if (!mOutputHandler || !mOutputHandler->isDone())
|
||||
|
@ -2453,15 +2454,21 @@ XSLTProcessor::SignalTransformEnd()
|
|||
mScriptLoader = nsnull;
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIObserverService> anObserverService = do_GetService("@mozilla.org/observer-service;1", &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIContent> rootContent;
|
||||
mOutputHandler->getRootContent(getter_AddRefs(rootContent));
|
||||
anObserverService->AddObserver(mObserver, "xslt-done", PR_TRUE);
|
||||
anObserverService->NotifyObservers(rootContent, "xslt-done", nsnull);
|
||||
}
|
||||
mObserver = nsnull;
|
||||
|
||||
// XXX Need a better way to determine transform success/failure
|
||||
nsCOMPtr<nsIContent> rootContent;
|
||||
mOutputHandler->getRootContent(getter_AddRefs(rootContent));
|
||||
nsCOMPtr<nsIDOMNode> root = do_QueryInterface(rootContent);
|
||||
if (root) {
|
||||
nsCOMPtr<nsIDOMDocument> resultDoc;
|
||||
root->GetOwnerDocument(getter_AddRefs(resultDoc));
|
||||
observer->OnTransformDone(NS_OK, resultDoc);
|
||||
}
|
||||
else {
|
||||
// XXX Need better error message and code.
|
||||
observer->OnTransformDone(NS_ERROR_FAILURE, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
#include "nsICSSLoaderObserver.h"
|
||||
#include "nsIDocumentTransformer.h"
|
||||
#include "nsIDOMHTMLScriptElement.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIScriptLoader.h"
|
||||
#include "nsIScriptLoaderObserver.h"
|
||||
|
||||
#include "nsITransformObserver.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "txMozillaTextOutput.h"
|
||||
#include "txMozillaXMLOutput.h"
|
||||
#endif
|
||||
|
@ -374,7 +374,7 @@ private:
|
|||
void SignalTransformEnd();
|
||||
|
||||
nsCOMPtr<nsIScriptLoader> mScriptLoader;
|
||||
nsCOMPtr<nsIObserver> mObserver;
|
||||
nsWeakPtr mObserver;
|
||||
#endif
|
||||
}; //-- XSLTProcessor
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ REQUIRES = string \
|
|||
dom \
|
||||
widget \
|
||||
necko \
|
||||
content_xsl \
|
||||
content \
|
||||
unicharutil \
|
||||
xpconnect \
|
||||
|
|
|
@ -184,8 +184,6 @@ const char* kPrintingPromptService = "@mozilla.org/embedcomp/printingprompt-serv
|
|||
#include "nsIDOMFocusListener.h"
|
||||
#include "nsISelectionController.h"
|
||||
|
||||
#include "nsITransformMediator.h"
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiUtils.h"
|
||||
#endif
|
||||
|
@ -511,7 +509,6 @@ public:
|
|||
NS_IMETHOD GetPresContext(nsIPresContext*& aResult);
|
||||
NS_IMETHOD CreateDocumentViewerUsing(nsIPresContext* aPresContext,
|
||||
nsIDocumentViewer*& aResult);
|
||||
NS_IMETHOD SetTransformMediator(nsITransformMediator* aMediator);
|
||||
|
||||
// nsIContentViewerEdit
|
||||
NS_DECL_NSICONTENTVIEWEREDIT
|
||||
|
@ -698,9 +695,8 @@ protected:
|
|||
nsISupports* mContainer; // [WEAK] it owns me!
|
||||
nsCOMPtr<nsIDeviceContext> mDeviceContext; // ??? can't hurt, but...
|
||||
|
||||
// the following seven items are explicitly in this order
|
||||
// the following six items are explicitly in this order
|
||||
// so they will be destroyed in the reverse order (pinkerton, scc)
|
||||
nsCOMPtr<nsITransformMediator> mTransformMediator;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIWidget> mWindow; // ??? should we really own it?
|
||||
nsCOMPtr<nsIViewManager> mViewManager;
|
||||
|
@ -1389,8 +1385,6 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
|
|||
const nsRect& aBounds,
|
||||
PRBool aDoCreation)
|
||||
{
|
||||
mTransformMediator = nsnull;
|
||||
|
||||
#ifdef NS_PRINT_PREVIEW
|
||||
mParentWidget = aParentWidget; // not ref counted
|
||||
#endif
|
||||
|
@ -5343,16 +5337,6 @@ nsresult DocumentViewerImpl::DocumentReadyForPrinting()
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::SetTransformMediator(nsITransformMediator* aMediator)
|
||||
{
|
||||
NS_ASSERTION(!mTransformMediator || !aMediator,
|
||||
"nsXMLDocument::SetTransformMediator(): \
|
||||
Cannot set a second transform mediator\n");
|
||||
mTransformMediator = aMediator;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
|
|
@ -44,7 +44,6 @@ class nsIDocument;
|
|||
class nsIPresContext;
|
||||
class nsIPresShell;
|
||||
class nsIStyleSheet;
|
||||
class nsITransformMediator;
|
||||
|
||||
#define NS_IDOCUMENT_VIEWER_IID \
|
||||
{ 0xa6cf9057, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
@ -68,8 +67,6 @@ public:
|
|||
|
||||
NS_IMETHOD CreateDocumentViewerUsing(nsIPresContext* aPresContext,
|
||||
nsIDocumentViewer*& aResult) = 0;
|
||||
|
||||
NS_IMETHOD SetTransformMediator(nsITransformMediator* aMediator)=0;
|
||||
};
|
||||
|
||||
#endif /* nsIDocumentViewer_h___ */
|
||||
|
|
|
@ -93,7 +93,7 @@ bin/components/jar.xpt
|
|||
bin/components/jsconsole-clhandler.js
|
||||
bin/components/content_base.xpt
|
||||
bin/components/content_html.xpt
|
||||
bin/components/content_xsl.xpt
|
||||
bin/components/content_xslt.xpt
|
||||
bin/components/webBrowser_core.xpt
|
||||
bin/components/locale.xpt
|
||||
bin/components/mozbrwsr.xpt
|
||||
|
|
|
@ -101,7 +101,7 @@ bin\components\gfx.xpt
|
|||
bin\components\gfx2.xpt
|
||||
bin\components\content_base.xpt
|
||||
bin\components\content_html.xpt
|
||||
bin\components\content_xsl.xpt
|
||||
bin\components\content_xslt.xpt
|
||||
bin\components\xuldoc.xpt
|
||||
bin\components\xultmpl.xpt
|
||||
bin\components\imglib2.xpt
|
||||
|
|
|
@ -140,7 +140,7 @@ bin/components/libprofile.so
|
|||
bin/components/libgkcontent.so
|
||||
bin/components/content_base.xpt
|
||||
bin/components/content_html.xpt
|
||||
bin/components/content_xsl.xpt
|
||||
bin/components/content_xslt.xpt
|
||||
bin/components/libgklayout.so
|
||||
bin/components/libgkplugin.so
|
||||
bin/components/libhtmlpars.so
|
||||
|
|
|
@ -127,7 +127,7 @@ bin\components\gfx2.dll
|
|||
bin\components\gkcontent.dll
|
||||
bin\components\content_base.xpt
|
||||
bin\components\content_html.xpt
|
||||
bin\components\content_xsl.xpt
|
||||
bin\components\content_xslt.xpt
|
||||
bin\components\xuldoc.xpt
|
||||
bin\components\xultmpl.xpt
|
||||
bin\components\gklayout.dll
|
||||
|
|
Загрузка…
Ссылка в новой задаче