2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2013-03-26 19:31:53 +04:00
|
|
|
#ifndef mozilla_dom_XULDocument_h
|
|
|
|
#define mozilla_dom_XULDocument_h
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2016-06-07 23:10:18 +03:00
|
|
|
#include "nsAutoPtr.h"
|
1999-10-29 05:21:15 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2006-12-22 19:11:16 +03:00
|
|
|
#include "nsXULPrototypeDocument.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
#include "mozilla/dom/XMLDocument.h"
|
2016-09-26 15:03:25 +03:00
|
|
|
#include "mozilla/StyleSheet.h"
|
1999-10-29 05:21:15 +04:00
|
|
|
#include "nsIContent.h"
|
2002-12-03 08:48:14 +03:00
|
|
|
#include "nsCOMArray.h"
|
1999-10-29 05:21:15 +04:00
|
|
|
#include "nsIURI.h"
|
2004-02-10 12:08:06 +03:00
|
|
|
#include "nsIStreamListener.h"
|
2015-11-30 17:54:11 +03:00
|
|
|
#include "nsIStreamLoader.h"
|
2006-11-12 01:27:00 +03:00
|
|
|
#include "nsICSSLoaderObserver.h"
|
1999-10-29 05:21:15 +04:00
|
|
|
|
2012-05-05 13:00:05 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-05-08 09:24:22 +03:00
|
|
|
#include "mozilla/dom/ScriptLoader.h"
|
2012-05-05 13:00:05 +04:00
|
|
|
|
2014-04-12 02:19:05 +04:00
|
|
|
#include "js/TracingAPI.h"
|
2013-08-28 06:59:14 +04:00
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
|
2010-02-20 19:07:03 +03:00
|
|
|
class nsPIWindowRoot;
|
2018-01-31 22:49:27 +03:00
|
|
|
class nsXULPrototypeElement;
|
1999-11-18 05:25:33 +03:00
|
|
|
#if 0 // XXXbe save me, scc (need NSCAP_FORWARD_DECL(nsXULPrototypeScript))
|
2001-07-31 23:05:34 +04:00
|
|
|
class nsIObjectInputStream;
|
|
|
|
class nsIObjectOutputStream;
|
1999-11-18 05:25:33 +03:00
|
|
|
#else
|
2001-07-31 23:05:34 +04:00
|
|
|
# include "nsIObjectInputStream.h"
|
|
|
|
# include "nsIObjectOutputStream.h"
|
1999-11-18 05:25:33 +03:00
|
|
|
# include "nsXULElement.h"
|
|
|
|
#endif
|
2005-02-25 12:06:34 +03:00
|
|
|
#include "nsURIHashKey.h"
|
|
|
|
#include "nsInterfaceHashtable.h"
|
2012-08-25 00:22:23 +04:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
/**
|
|
|
|
* The XUL document class
|
|
|
|
*/
|
2013-03-26 19:31:53 +04:00
|
|
|
|
2018-01-31 22:49:29 +03:00
|
|
|
// Factory function.
|
2019-01-02 16:05:23 +03:00
|
|
|
nsresult NS_NewXULDocument(mozilla::dom::Document** result);
|
2018-01-31 22:49:29 +03:00
|
|
|
|
2013-03-26 19:31:53 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class XULDocument final : public XMLDocument,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsIStreamLoaderObserver,
|
|
|
|
public nsICSSLoaderObserver,
|
|
|
|
public nsIOffThreadScriptReceiver {
|
1999-10-29 05:21:15 +04:00
|
|
|
public:
|
2013-03-26 19:31:53 +04:00
|
|
|
XULDocument();
|
1999-10-29 05:21:15 +04:00
|
|
|
|
|
|
|
// nsISupports interface
|
2003-03-26 10:41:30 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2000-02-03 02:04:47 +03:00
|
|
|
NS_DECL_NSISTREAMLOADEROBSERVER
|
2001-03-12 09:39:27 +03:00
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
// Document interface
|
2018-05-15 16:56:38 +03:00
|
|
|
virtual void Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) override;
|
1999-10-29 05:21:15 +04:00
|
|
|
virtual void ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup,
|
2006-11-12 01:27:00 +03:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
1999-10-29 05:21:15 +04:00
|
|
|
|
|
|
|
virtual nsresult StartDocumentLoad(const char* aCommand, nsIChannel* channel,
|
2004-01-10 02:54:21 +03:00
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsISupports* aContainer,
|
1999-10-29 05:21:15 +04:00
|
|
|
nsIStreamListener** aDocListener,
|
2012-08-22 19:56:38 +04:00
|
|
|
bool aReset = true,
|
|
|
|
nsIContentSink* aSink = nullptr) override;
|
1999-10-29 05:21:15 +04:00
|
|
|
|
|
|
|
virtual void SetContentType(const nsAString& aContentType) override;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual void EndLoad() override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-01-26 02:14:03 +03:00
|
|
|
virtual void InitialDocumentTranslationCompleted() override;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
/**
|
|
|
|
* This is invoked whenever the prototype for this document is loaded
|
1999-10-29 05:21:15 +04:00
|
|
|
* and should be walked, regardless of whether the XUL cache is
|
|
|
|
* disabled, whether the protototype was loaded, whether the
|
|
|
|
* prototype was loaded from the cache or created by parsing the
|
|
|
|
* actual XUL source, etc.
|
2018-11-30 13:46:48 +03:00
|
|
|
*
|
1999-10-29 05:21:15 +04:00
|
|
|
* @param aResumeWalk whether this should also call ResumeWalk().
|
|
|
|
* Sometimes the caller of OnPrototypeLoadDone resumes the walk itself
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
nsresult OnPrototypeLoadDone(bool aResumeWalk);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2005-04-06 03:54:35 +04:00
|
|
|
// nsINode interface overrides
|
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-11-18 05:25:33 +03:00
|
|
|
// nsICSSLoaderObserver
|
|
|
|
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet, bool aWasAlternate,
|
|
|
|
nsresult aStatus) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void EndUpdate() override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-11-18 05:25:33 +03:00
|
|
|
virtual bool IsDocumentRightToLeft() override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-08-16 01:14:43 +04:00
|
|
|
/**
|
|
|
|
* Reset the document direction so that it is recomputed.
|
|
|
|
*/
|
|
|
|
void ResetDocumentDirection();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-08-16 01:14:43 +04:00
|
|
|
NS_IMETHOD OnScriptCompileComplete(JSScript* aScript,
|
|
|
|
nsresult aStatus) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-08-16 01:14:43 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULDocument, XMLDocument)
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-08-16 01:14:43 +04:00
|
|
|
void TraceProtos(JSTracer* aTrc);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-04-27 18:15:25 +04:00
|
|
|
protected:
|
1999-10-29 05:21:15 +04:00
|
|
|
virtual ~XULDocument();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
// Implementation methods
|
2019-01-02 16:05:23 +03:00
|
|
|
friend nsresult(::NS_NewXULDocument(Document** aResult));
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
nsresult Init(void) override;
|
|
|
|
nsresult StartLayout(void);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-11-16 01:14:37 +03:00
|
|
|
nsresult PrepareToLoad(nsISupports* aContainer, const char* aCommand,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIChannel* aChannel, nsILoadGroup* aLoadGroup,
|
1999-10-29 05:21:15 +04:00
|
|
|
nsIParser** aResult);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
nsresult PrepareToLoadPrototype(nsIURI* aURI, const char* aCommand,
|
|
|
|
nsIPrincipal* aDocumentPrincipal,
|
|
|
|
nsIParser** aResult);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-14 13:43:35 +03:00
|
|
|
void CloseElement(Element* aElement);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
static void DirectionChanged(const char* aPrefName, XULDocument* aData);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
// pseudo constants
|
|
|
|
static int32_t gRefCnt;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
static LazyLogModule gXULLog;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-01-25 18:02:06 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx,
|
2006-11-12 01:27:00 +03:00
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
// IMPORTANT: The ownership implicit in the following member
|
|
|
|
// variables has been explicitly checked and set using nsCOMPtr
|
|
|
|
// for owning pointers and raw COM interface pointers for weak
|
|
|
|
// (ie, non owning) references. If you add any members to this
|
|
|
|
// class, please make the ownership explicit (pinkerton, scc).
|
|
|
|
// NOTE, THIS IS STILL IN PROGRESS, TALK TO PINK OR SCC BEFORE
|
|
|
|
// CHANGING
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
XULDocument* mNextSrcLoadWaiter; // [OWNER] but not COMPtr
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2006-11-12 01:27:00 +03:00
|
|
|
bool mIsWritingFastLoad;
|
|
|
|
bool mDocumentLoaded;
|
1999-10-29 05:21:15 +04:00
|
|
|
/**
|
|
|
|
* Since ResumeWalk is interruptible, it's possible that last
|
2006-11-12 01:27:00 +03:00
|
|
|
* stylesheet finishes loading while the PD walk is still in
|
|
|
|
* progress (waiting for an overlay to finish loading).
|
|
|
|
* mStillWalking prevents DoneLoading (and StartLayout) from being
|
1999-12-04 10:45:57 +03:00
|
|
|
* called in this situation.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
1999-12-04 10:45:57 +03:00
|
|
|
bool mStillWalking;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-12-04 10:45:57 +03:00
|
|
|
uint32_t mPendingSheets;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-12-04 10:45:57 +03:00
|
|
|
* Context stack, which maintains the state of the Builder and allows
|
|
|
|
* it to be interrupted.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
1999-12-04 10:45:57 +03:00
|
|
|
class ContextStack {
|
1999-11-25 01:46:09 +03:00
|
|
|
protected:
|
2015-10-18 08:24:48 +03:00
|
|
|
struct Entry {
|
2015-04-19 18:08:13 +03:00
|
|
|
nsXULPrototypeElement* mPrototype;
|
2013-03-26 19:31:53 +04:00
|
|
|
nsIContent* mElement;
|
2011-09-29 10:19:26 +04:00
|
|
|
int32_t mIndex;
|
1999-12-04 10:45:57 +03:00
|
|
|
Entry* mNext;
|
1999-11-25 01:46:09 +03:00
|
|
|
};
|
|
|
|
|
2018-11-30 13:46:48 +03:00
|
|
|
Entry* mTop;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mDepth;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
public:
|
1999-10-29 05:21:15 +04:00
|
|
|
ContextStack();
|
|
|
|
~ContextStack();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t Depth() { return mDepth; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-12-05 20:05:51 +03:00
|
|
|
nsresult Push(nsXULPrototypeElement* aPrototype, nsIContent* aElement);
|
1999-10-29 05:21:15 +04:00
|
|
|
nsresult Pop();
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult Peek(nsXULPrototypeElement** aPrototype, nsIContent** aElement,
|
|
|
|
int32_t* aIndex);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult SetTopIndex(int32_t aIndex);
|
2018-11-30 13:46:48 +03:00
|
|
|
};
|
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
friend class ContextStack;
|
|
|
|
ContextStack mContextStack;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* Load the transcluded script at the specified URI. If the
|
1999-10-29 05:21:15 +04:00
|
|
|
* prototype construction must 'block' until the load has
|
|
|
|
* completed, aBlock will be set to true.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2006-06-13 07:07:47 +04:00
|
|
|
nsresult LoadScript(nsXULPrototypeScript* aScriptProto, bool* aBlock);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* Execute the precompiled script object scoped by this XUL document's
|
2014-08-05 17:57:53 +04:00
|
|
|
* containing window object.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2006-06-13 07:07:47 +04:00
|
|
|
nsresult ExecuteScript(nsXULPrototypeScript* aScript);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-10-29 05:21:15 +04:00
|
|
|
* Create a delegate content model element from a prototype.
|
2005-04-06 03:54:35 +04:00
|
|
|
* Note that the resulting content node is not bound to any tree
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2004-02-10 16:17:48 +03:00
|
|
|
nsresult CreateElementFromPrototype(nsXULPrototypeElement* aPrototype,
|
2012-08-22 19:56:38 +04:00
|
|
|
Element** aResult, bool aIsRoot);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-10-29 05:21:15 +04:00
|
|
|
* Add attributes from the prototype to the element.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2017-12-05 20:05:51 +03:00
|
|
|
nsresult AddAttributes(nsXULPrototypeElement* aPrototype, Element* aElement);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* The prototype-script of the current transcluded script that is being
|
|
|
|
* loaded. For document.write('<script src="nestedwrite.js"><\/script>')
|
|
|
|
* to work, these need to be in a stack element type, and we need to hold
|
|
|
|
* the top of stack here.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
1999-11-18 05:25:33 +03:00
|
|
|
nsXULPrototypeScript* mCurrentScriptProto;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* Whether the current transcluded script is being compiled off thread.
|
2013-08-16 01:14:43 +04:00
|
|
|
* The load event is blocked while this is in progress.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2013-08-16 01:14:43 +04:00
|
|
|
bool mOffThreadCompiling;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* If the current transcluded script is being compiled off thread, the
|
2013-08-16 01:14:43 +04:00
|
|
|
* source for that script.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2014-07-22 08:43:21 +04:00
|
|
|
char16_t* mOffThreadCompileStringBuf;
|
2014-04-25 18:11:57 +04:00
|
|
|
size_t mOffThreadCompileStringLength;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-10-29 05:21:15 +04:00
|
|
|
protected:
|
2018-11-30 13:46:48 +03:00
|
|
|
/**
|
1999-11-18 05:25:33 +03:00
|
|
|
* The current prototype that we are walking to construct the
|
1999-10-29 05:21:15 +04:00
|
|
|
* content model.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsXULPrototypeDocument> mCurrentPrototype;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-10-29 05:21:15 +04:00
|
|
|
* Owning references to all of the prototype documents that were
|
|
|
|
* used to construct this document.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<nsXULPrototypeDocument> > mPrototypes;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-10-29 05:21:15 +04:00
|
|
|
* Prepare to walk the current prototype.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
1999-11-16 01:14:37 +03:00
|
|
|
nsresult PrepareToWalk();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
2006-11-12 01:27:00 +03:00
|
|
|
* Creates a processing instruction based on aProtoPI and inserts
|
2018-01-25 18:02:06 +03:00
|
|
|
* it to the DOM.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2006-11-12 01:27:00 +03:00
|
|
|
nsresult CreateAndInsertPI(const nsXULPrototypePI* aProtoPI, nsINode* aParent,
|
2018-01-25 18:02:06 +03:00
|
|
|
nsINode* aBeforeThis);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
2006-11-12 01:27:00 +03:00
|
|
|
* Inserts the passed <?xml-stylesheet ?> PI at the specified
|
|
|
|
* index. Loads and applies the associated stylesheet
|
|
|
|
* asynchronously.
|
|
|
|
* The prototype document walk can happen before the stylesheets
|
|
|
|
* are loaded, but the final steps in the load process (see
|
|
|
|
* DoneWalking()) are not run before all the stylesheets are done
|
2018-11-30 13:46:48 +03:00
|
|
|
* loading.
|
|
|
|
*/
|
2006-11-12 01:27:00 +03:00
|
|
|
nsresult InsertXMLStylesheetPI(const nsXULPrototypePI* aProtoPI,
|
2018-01-25 18:02:06 +03:00
|
|
|
nsINode* aParent, nsINode* aBeforeThis,
|
2012-08-22 19:56:38 +04:00
|
|
|
nsIContent* aPINode);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
1999-10-29 05:21:15 +04:00
|
|
|
* Resume (or initiate) an interrupted (or newly prepared)
|
|
|
|
* prototype walk.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
1999-10-29 05:21:15 +04:00
|
|
|
nsresult ResumeWalk();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
/**
|
2019-01-26 02:14:03 +03:00
|
|
|
* Called at the end of ResumeWalk(), from StyleSheetLoaded(),
|
|
|
|
* and from DocumentL10n.
|
|
|
|
* If walking, stylesheets and l10n are not blocking, it
|
|
|
|
* will trigger `DoneWalking()`.
|
|
|
|
*/
|
|
|
|
nsresult MaybeDoneWalking();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called from `MaybeDoneWalking()`.
|
2006-11-12 01:27:00 +03:00
|
|
|
* Expects that both the prototype document walk is complete and
|
|
|
|
* all referenced stylesheets finished loading.
|
2018-11-30 13:46:48 +03:00
|
|
|
*/
|
2018-01-31 22:49:28 +03:00
|
|
|
nsresult DoneWalking();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-12-04 10:45:57 +03:00
|
|
|
class CachedChromeStreamListener : public nsIStreamListener {
|
1999-10-29 05:21:15 +04:00
|
|
|
protected:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<XULDocument> mDocument;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mProtoLoaded;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-12-04 10:45:57 +03:00
|
|
|
virtual ~CachedChromeStreamListener();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
|
|
|
public:
|
2013-03-26 19:31:53 +04:00
|
|
|
CachedChromeStreamListener(XULDocument* aDocument, bool aProtoLoaded);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-11-25 01:46:09 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
1999-12-04 10:45:57 +03:00
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2018-11-30 13:46:48 +03:00
|
|
|
};
|
|
|
|
|
1999-12-04 10:45:57 +03:00
|
|
|
friend class CachedChromeStreamListener;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInitialLayoutComplete;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2001-04-18 10:06:31 +04:00
|
|
|
private:
|
|
|
|
// helpers
|
1999-10-29 05:21:15 +04:00
|
|
|
};
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
inline XULDocument* Document::AsXULDocument() {
|
2018-04-21 19:42:31 +03:00
|
|
|
MOZ_ASSERT(IsXULDocument());
|
|
|
|
return static_cast<mozilla::dom::XULDocument*>(this);
|
|
|
|
}
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-03-26 19:31:53 +04:00
|
|
|
#endif // mozilla_dom_XULDocument_h
|