2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2006-01-24 01:25:14 +00:00
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
2012-05-21 11:12:37 +00: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/. */
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsHTMLDocument_h___
|
|
|
|
#define nsHTMLDocument_h___
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
#include "nsDocument.h"
|
|
|
|
#include "nsIHTMLDocument.h"
|
1998-07-22 23:32:19 +00:00
|
|
|
#include "nsIDOMHTMLDocument.h"
|
2003-03-26 07:41:30 +00:00
|
|
|
#include "nsIDOMHTMLCollection.h"
|
2006-01-24 01:25:14 +00:00
|
|
|
#include "nsIScriptElement.h"
|
2009-03-20 08:15:35 +00:00
|
|
|
#include "nsTArray.h"
|
2006-08-14 22:36:15 +00:00
|
|
|
|
2002-01-25 06:37:35 +00:00
|
|
|
#include "pldhash.h"
|
2002-03-02 01:26:49 +00:00
|
|
|
#include "nsIHttpChannel.h"
|
2004-04-12 21:56:09 +00:00
|
|
|
#include "nsHTMLStyleSheet.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2002-11-07 15:36:25 +00:00
|
|
|
#include "nsICommandManager.h"
|
2013-02-08 12:20:11 +00:00
|
|
|
#include "mozilla/dom/HTMLSharedElement.h"
|
2001-05-25 08:49:03 +00:00
|
|
|
|
2007-06-28 02:48:16 +00:00
|
|
|
class nsIEditor;
|
1998-07-23 22:06:05 +00:00
|
|
|
class nsIParser;
|
2001-11-16 02:03:19 +00:00
|
|
|
class nsIURI;
|
2012-01-24 09:52:05 +00:00
|
|
|
class nsIDocShell;
|
2010-06-24 06:55:19 +00:00
|
|
|
class nsICachingChannel;
|
2013-06-11 00:18:29 +00:00
|
|
|
class nsIWyciwygChannel;
|
|
|
|
class nsILoadGroup;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2013-09-06 06:41:42 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class HTMLAllCollection;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
class nsHTMLDocument : public nsDocument,
|
1999-01-09 00:15:19 +00:00
|
|
|
public nsIHTMLDocument,
|
2011-05-28 07:43:57 +00:00
|
|
|
public nsIDOMHTMLDocument
|
1999-01-09 00:15:19 +00:00
|
|
|
{
|
1998-04-13 20:24:54 +00:00
|
|
|
public:
|
2011-03-26 16:06:27 +00:00
|
|
|
using nsDocument::SetDocumentURI;
|
2012-04-27 18:17:22 +00:00
|
|
|
using nsDocument::GetPlugins;
|
2011-03-26 16:06:27 +00:00
|
|
|
|
2013-05-06 13:42:00 +00:00
|
|
|
nsHTMLDocument();
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual nsresult Init() MOZ_OVERRIDE;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2013-06-14 17:10:12 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2013-09-06 06:41:42 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDocument, nsDocument)
|
1998-07-22 23:32:19 +00:00
|
|
|
|
2013-06-12 06:55:00 +00:00
|
|
|
// nsIDocument
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) MOZ_OVERRIDE;
|
2006-11-22 18:27:54 +00:00
|
|
|
virtual void ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
|
2001-03-12 06:39:27 +00:00
|
|
|
|
2013-04-01 10:26:37 +00:00
|
|
|
virtual already_AddRefed<nsIPresShell> CreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
|
|
|
nsStyleSet* aStyleSet) MOZ_OVERRIDE;
|
1999-07-07 01:27:08 +00:00
|
|
|
|
2004-01-09 23:54:21 +00:00
|
|
|
virtual nsresult StartDocumentLoad(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsISupports* aContainer,
|
|
|
|
nsIStreamListener **aDocListener,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aReset = true,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsIContentSink* aSink = nullptr) MOZ_OVERRIDE;
|
|
|
|
virtual void StopDocumentLoad() MOZ_OVERRIDE;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void BeginLoad() MOZ_OVERRIDE;
|
|
|
|
virtual void EndLoad() MOZ_OVERRIDE;
|
1998-07-23 22:06:05 +00:00
|
|
|
|
2013-06-12 06:55:00 +00:00
|
|
|
// nsIHTMLDocument
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void SetCompatibilityMode(nsCompatibility aMode) MOZ_OVERRIDE;
|
1998-09-02 02:07:42 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual bool IsWriting() MOZ_OVERRIDE
|
2003-04-19 00:28:09 +00:00
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
return mWriteLevel != uint32_t(0);
|
2003-04-19 00:28:09 +00:00
|
|
|
}
|
2002-04-18 22:11:17 +00:00
|
|
|
|
2015-01-06 20:13:36 +00:00
|
|
|
virtual nsContentList* GetForms() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsContentList* GetFormControls() MOZ_OVERRIDE;
|
|
|
|
|
1998-07-22 23:32:19 +00:00
|
|
|
// nsIDOMDocument interface
|
2014-02-23 21:01:26 +00:00
|
|
|
using nsDocument::CreateElement;
|
|
|
|
using nsDocument::CreateElementNS;
|
2011-05-08 18:15:49 +00:00
|
|
|
NS_FORWARD_NSIDOMDOCUMENT(nsDocument::)
|
1998-07-22 23:32:19 +00:00
|
|
|
|
2012-12-22 08:27:27 +00:00
|
|
|
// And explicitly import the things from nsDocument that we just shadowed
|
|
|
|
using nsDocument::GetImplementation;
|
|
|
|
using nsDocument::GetTitle;
|
|
|
|
using nsDocument::SetTitle;
|
|
|
|
using nsDocument::GetLastStyleSheetSet;
|
|
|
|
using nsDocument::MozSetImageElement;
|
|
|
|
using nsDocument::GetMozFullScreenElement;
|
|
|
|
|
1998-07-22 23:32:19 +00:00
|
|
|
// nsIDOMNode interface
|
2012-10-09 12:31:24 +00:00
|
|
|
NS_FORWARD_NSIDOMNODE_TO_NSINODE
|
1998-07-22 23:32:19 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
// nsIDOMHTMLDocument interface
|
2011-05-28 07:43:57 +00:00
|
|
|
NS_DECL_NSIDOMHTMLDOCUMENT
|
2010-05-10 16:43:20 +00:00
|
|
|
|
2014-02-09 08:02:45 +00:00
|
|
|
mozilla::dom::HTMLAllCollection* All();
|
2010-05-10 16:43:20 +00:00
|
|
|
|
2013-03-18 09:47:32 +00:00
|
|
|
nsISupports* ResolveName(const nsAString& aName, nsWrapperCache **aCache);
|
2013-05-29 20:43:41 +00:00
|
|
|
|
|
|
|
virtual void AddedForm() MOZ_OVERRIDE;
|
|
|
|
virtual void RemovedForm() MOZ_OVERRIDE;
|
|
|
|
virtual int32_t GetNumFormsSynchronous() MOZ_OVERRIDE;
|
|
|
|
virtual void TearingDownEditor(nsIEditor *aEditor) MOZ_OVERRIDE;
|
2014-05-24 19:28:48 +00:00
|
|
|
virtual void SetIsXHTML(bool aXHTML) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mType = (aXHTML ? eXHTML : eHTML);
|
|
|
|
}
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void SetDocWriteDisabled(bool aDisabled) MOZ_OVERRIDE
|
2009-11-06 04:27:30 +00:00
|
|
|
{
|
|
|
|
mDisableDocWrite = aDisabled;
|
|
|
|
}
|
2003-04-19 00:28:09 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
nsresult ChangeContentEditableCount(nsIContent *aElement, int32_t aChange) MOZ_OVERRIDE;
|
2010-05-12 22:21:24 +00:00
|
|
|
void DeferredContentEditableCountChange(nsIContent *aElement);
|
2007-06-28 02:48:16 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual EditingState GetEditingState() MOZ_OVERRIDE
|
2007-06-28 02:48:16 +00:00
|
|
|
{
|
2007-08-10 13:19:13 +00:00
|
|
|
return mEditingState;
|
2007-06-28 02:48:16 +00:00
|
|
|
}
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void DisableCookieAccess() MOZ_OVERRIDE
|
2008-10-01 00:49:30 +00:00
|
|
|
{
|
2011-10-17 14:59:28 +00:00
|
|
|
mDisableCookieAccess = true;
|
2008-10-01 00:49:30 +00:00
|
|
|
}
|
|
|
|
|
2008-09-18 02:32:44 +00:00
|
|
|
class nsAutoEditingState {
|
|
|
|
public:
|
|
|
|
nsAutoEditingState(nsHTMLDocument* aDoc, EditingState aState)
|
|
|
|
: mDoc(aDoc), mSavedState(aDoc->mEditingState)
|
|
|
|
{
|
|
|
|
aDoc->mEditingState = aState;
|
|
|
|
}
|
|
|
|
~nsAutoEditingState() {
|
|
|
|
mDoc->mEditingState = mSavedState;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
nsHTMLDocument* mDoc;
|
|
|
|
EditingState mSavedState;
|
|
|
|
};
|
|
|
|
friend class nsAutoEditingState;
|
2008-02-19 18:47:34 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
void EndUpdate(nsUpdateType aUpdateType) MOZ_OVERRIDE;
|
2007-10-26 10:30:44 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual nsresult SetEditingState(EditingState aState) MOZ_OVERRIDE;
|
2008-04-23 21:36:17 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2008-09-18 11:15:47 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual void RemovedFromDocShell() MOZ_OVERRIDE;
|
2009-02-21 02:51:48 +00:00
|
|
|
|
2015-01-06 20:13:36 +00:00
|
|
|
virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId) MOZ_OVERRIDE
|
2010-04-19 15:41:38 +00:00
|
|
|
{
|
2010-06-04 01:09:20 +00:00
|
|
|
return nsDocument::GetElementById(aElementId);
|
2010-04-19 15:41:38 +00:00
|
|
|
}
|
|
|
|
|
2013-09-30 23:20:23 +00:00
|
|
|
virtual void DocAddSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const MOZ_OVERRIDE;
|
|
|
|
// DocAddSizeOfIncludingThis is inherited from nsIDocument.
|
2012-02-01 21:58:01 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual bool WillIgnoreCharsetOverride() MOZ_OVERRIDE;
|
2013-01-18 14:27:03 +00:00
|
|
|
|
2012-12-26 02:00:47 +00:00
|
|
|
// WebIDL API
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx)
|
2012-12-12 02:45:36 +00:00
|
|
|
MOZ_OVERRIDE;
|
2012-12-26 02:00:47 +00:00
|
|
|
void SetDomain(const nsAString& aDomain, mozilla::ErrorResult& rv);
|
|
|
|
void GetCookie(nsAString& aCookie, mozilla::ErrorResult& rv);
|
|
|
|
void SetCookie(const nsAString& aCookie, mozilla::ErrorResult& rv);
|
2014-06-11 20:26:52 +00:00
|
|
|
void NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
|
|
|
|
JS::MutableHandle<JSObject*> aRetval,
|
|
|
|
mozilla::ErrorResult& rv);
|
2014-04-16 02:58:44 +00:00
|
|
|
bool NameIsEnumerable(const nsAString& aName);
|
2014-04-16 02:58:44 +00:00
|
|
|
void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
|
2012-12-26 02:00:47 +00:00
|
|
|
nsGenericHTMLElement *GetBody();
|
|
|
|
void SetBody(nsGenericHTMLElement* aBody, mozilla::ErrorResult& rv);
|
2013-02-08 12:20:11 +00:00
|
|
|
mozilla::dom::HTMLSharedElement *GetHead() {
|
|
|
|
return static_cast<mozilla::dom::HTMLSharedElement*>(GetHeadElement());
|
|
|
|
}
|
2012-12-26 02:00:47 +00:00
|
|
|
nsIHTMLCollection* Images();
|
|
|
|
nsIHTMLCollection* Embeds();
|
|
|
|
nsIHTMLCollection* Plugins();
|
|
|
|
nsIHTMLCollection* Links();
|
|
|
|
nsIHTMLCollection* Forms()
|
|
|
|
{
|
|
|
|
return nsHTMLDocument::GetForms();
|
|
|
|
}
|
|
|
|
nsIHTMLCollection* Scripts();
|
|
|
|
already_AddRefed<nsContentList> GetElementsByName(const nsAString & aName)
|
|
|
|
{
|
|
|
|
return NS_GetFuncStringNodeList(this, MatchNameAttribute, nullptr,
|
|
|
|
UseExistingNameString, aName);
|
|
|
|
}
|
|
|
|
already_AddRefed<nsINodeList> GetItems(const nsAString& aTypeNames);
|
|
|
|
already_AddRefed<nsIDocument> Open(JSContext* cx,
|
|
|
|
const nsAString& aType,
|
|
|
|
const nsAString& aReplace,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
already_AddRefed<nsIDOMWindow> Open(JSContext* cx,
|
|
|
|
const nsAString& aURL,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsAString& aFeatures,
|
|
|
|
bool aReplace,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
void Close(mozilla::ErrorResult& rv);
|
|
|
|
void Write(JSContext* cx, const mozilla::dom::Sequence<nsString>& aText,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
void Writeln(JSContext* cx, const mozilla::dom::Sequence<nsString>& aText,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
// The XPCOM GetDesignMode() works OK for us, since it never throws.
|
|
|
|
void SetDesignMode(const nsAString& aDesignMode, mozilla::ErrorResult& rv);
|
|
|
|
bool ExecCommand(const nsAString& aCommandID, bool aDoShowUI,
|
|
|
|
const nsAString& aValue, mozilla::ErrorResult& rv);
|
|
|
|
bool QueryCommandEnabled(const nsAString& aCommandID,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
bool QueryCommandIndeterm(const nsAString& aCommandID,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
bool QueryCommandState(const nsAString& aCommandID, mozilla::ErrorResult& rv);
|
|
|
|
bool QueryCommandSupported(const nsAString& aCommandID);
|
|
|
|
void QueryCommandValue(const nsAString& aCommandID, nsAString& aValue,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
// The XPCOM Get/SetFgColor work OK for us, since they never throw.
|
|
|
|
// The XPCOM Get/SetLinkColor work OK for us, since they never throw.
|
|
|
|
// The XPCOM Get/SetVLinkColor work OK for us, since they never throw.
|
|
|
|
// The XPCOM Get/SetALinkColor work OK for us, since they never throw.
|
|
|
|
// The XPCOM Get/SetBgColor work OK for us, since they never throw.
|
|
|
|
nsIHTMLCollection* Anchors();
|
|
|
|
nsIHTMLCollection* Applets();
|
|
|
|
void Clear() const
|
|
|
|
{
|
|
|
|
// Deprecated
|
|
|
|
}
|
2014-04-10 16:09:40 +00:00
|
|
|
mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv);
|
2013-07-31 21:44:51 +00:00
|
|
|
// The XPCOM CaptureEvents works fine for us.
|
|
|
|
// The XPCOM ReleaseEvents works fine for us.
|
2012-12-26 02:00:47 +00:00
|
|
|
// We're picking up GetLocation from Document
|
2014-07-11 23:30:27 +00:00
|
|
|
already_AddRefed<nsLocation> GetLocation() const {
|
2012-12-26 02:00:47 +00:00
|
|
|
return nsIDocument::GetLocation();
|
|
|
|
}
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual nsHTMLDocument* AsHTMLDocument() MOZ_OVERRIDE { return this; }
|
2013-04-19 01:06:57 +00:00
|
|
|
|
1998-08-28 15:55:31 +00:00
|
|
|
protected:
|
2014-07-08 21:23:16 +00:00
|
|
|
~nsHTMLDocument();
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetBodySize(int32_t* aWidth,
|
|
|
|
int32_t* aHeight);
|
2000-08-16 01:04:52 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
nsIContent *MatchId(nsIContent *aContent, const nsAString& aId);
|
1998-08-07 23:08:00 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
static bool MatchLinks(nsIContent *aContent, int32_t aNamespaceID,
|
2007-02-01 15:14:00 +00:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2012-08-22 15:56:38 +00:00
|
|
|
static bool MatchAnchors(nsIContent *aContent, int32_t aNamespaceID,
|
2007-02-01 15:14:00 +00:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2012-08-22 15:56:38 +00:00
|
|
|
static bool MatchNameAttribute(nsIContent* aContent, int32_t aNamespaceID,
|
2007-02-01 15:14:00 +00:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2010-06-08 19:58:26 +00:00
|
|
|
static void* UseExistingNameString(nsINode* aRootNode, const nsString* aName);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2002-04-19 06:05:03 +00:00
|
|
|
static void DocumentWriteTerminationFunc(nsISupports *aRef);
|
2002-04-18 23:25:35 +00:00
|
|
|
|
2013-03-17 08:51:39 +00:00
|
|
|
already_AddRefed<nsIURI> GetDomainURI();
|
1999-10-02 03:41:37 +00:00
|
|
|
|
2011-05-19 20:05:46 +00:00
|
|
|
nsresult WriteCommon(JSContext *cx, const nsAString& aText,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aNewlineTerminate);
|
2012-12-26 02:00:47 +00:00
|
|
|
// A version of WriteCommon used by WebIDL bindings
|
|
|
|
void WriteCommon(JSContext *cx,
|
|
|
|
const mozilla::dom::Sequence<nsString>& aText,
|
|
|
|
bool aNewlineTerminate,
|
|
|
|
mozilla::ErrorResult& rv);
|
1999-01-06 00:32:41 +00:00
|
|
|
|
2002-01-31 19:36:45 +00:00
|
|
|
nsresult CreateAndAddWyciwygChannel(void);
|
|
|
|
nsresult RemoveWyciwygChannel(void);
|
2001-05-25 08:49:03 +00:00
|
|
|
|
2008-10-29 20:12:24 +00:00
|
|
|
/**
|
|
|
|
* Like IsEditingOn(), but will flush as needed first.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsEditingOnAfterFlush();
|
2008-10-29 20:12:24 +00:00
|
|
|
|
2005-06-07 19:21:05 +00:00
|
|
|
void *GenerateParserKey(void);
|
|
|
|
|
2012-12-26 02:00:47 +00:00
|
|
|
nsRefPtr<nsContentList> mImages;
|
|
|
|
nsRefPtr<nsContentList> mApplets;
|
|
|
|
nsRefPtr<nsContentList> mEmbeds;
|
|
|
|
nsRefPtr<nsContentList> mLinks;
|
|
|
|
nsRefPtr<nsContentList> mAnchors;
|
|
|
|
nsRefPtr<nsContentList> mScripts;
|
2005-02-02 23:16:02 +00:00
|
|
|
nsRefPtr<nsContentList> mForms;
|
2006-06-08 04:28:20 +00:00
|
|
|
nsRefPtr<nsContentList> mFormControls;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2013-09-06 06:41:42 +00:00
|
|
|
nsRefPtr<mozilla::dom::HTMLAllCollection> mAll;
|
2013-06-12 06:55:00 +00:00
|
|
|
|
2002-07-16 22:38:51 +00:00
|
|
|
/** # of forms in the document, synchronously set */
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mNumForms;
|
2002-07-16 22:38:51 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
static uint32_t gWyciwygSessionCnt;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2014-07-09 21:27:49 +00:00
|
|
|
static void TryHintCharset(nsIContentViewer* aContentViewer,
|
2013-01-18 14:27:03 +00:00
|
|
|
int32_t& aCharsetSource,
|
|
|
|
nsACString& aCharset);
|
2014-07-09 21:27:49 +00:00
|
|
|
void TryUserForcedCharset(nsIContentViewer* aCv,
|
2013-01-18 14:27:03 +00:00
|
|
|
nsIDocShell* aDocShell,
|
|
|
|
int32_t& aCharsetSource,
|
|
|
|
nsACString& aCharset);
|
|
|
|
static void TryCacheCharset(nsICachingChannel* aCachingChannel,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t& aCharsetSource,
|
2003-06-17 16:40:34 +00:00
|
|
|
nsACString& aCharset);
|
2012-10-16 07:42:54 +00:00
|
|
|
void TryParentCharset(nsIDocShell* aDocShell,
|
2013-01-18 14:27:03 +00:00
|
|
|
int32_t& charsetSource, nsACString& aCharset);
|
2014-02-06 09:08:01 +00:00
|
|
|
void TryTLD(int32_t& aCharsetSource, nsACString& aCharset);
|
2013-11-04 11:24:33 +00:00
|
|
|
static void TryFallback(int32_t& aCharsetSource, nsACString& aCharset);
|
2001-12-26 03:17:59 +00:00
|
|
|
|
2007-05-09 02:47:58 +00:00
|
|
|
// Override so we can munge the charset on our wyciwyg channel as needed.
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void SetDocumentCharacterSet(const nsACString& aCharSetID) MOZ_OVERRIDE;
|
2007-05-09 02:47:58 +00:00
|
|
|
|
2006-01-24 01:25:14 +00:00
|
|
|
// Tracks if we are currently processing any document.write calls (either
|
|
|
|
// implicit or explicit). Note that if a write call writes out something which
|
|
|
|
// would block the parser, then mWriteLevel will be incorrect until the parser
|
|
|
|
// finishes processing that script.
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mWriteLevel;
|
2006-01-24 01:25:14 +00:00
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
// Load flags of the document's channel
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mLoadFlags;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mTooDeepWriteRecursion;
|
2007-02-11 00:30:20 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDisableDocWrite;
|
2009-11-06 04:27:30 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mWarnedWidthHeight;
|
2010-08-27 11:44:28 +00:00
|
|
|
|
2002-01-31 19:36:45 +00:00
|
|
|
nsCOMPtr<nsIWyciwygChannel> mWyciwygChannel;
|
2002-11-07 15:36:25 +00:00
|
|
|
|
|
|
|
/* Midas implementation */
|
|
|
|
nsresult GetMidasCommandManager(nsICommandManager** aCommandManager);
|
2008-01-14 09:26:22 +00:00
|
|
|
|
2002-11-07 15:36:25 +00:00
|
|
|
nsCOMPtr<nsICommandManager> mMidasCommandManager;
|
2007-06-28 02:48:16 +00:00
|
|
|
|
|
|
|
nsresult TurnEditingOff();
|
|
|
|
nsresult EditingStateChanged();
|
2009-01-31 12:53:01 +00:00
|
|
|
void MaybeEditingStateChanged();
|
2007-06-28 02:48:16 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mContentEditableCount;
|
2007-06-28 02:48:16 +00:00
|
|
|
EditingState mEditingState;
|
2002-11-07 15:36:25 +00:00
|
|
|
|
2008-10-01 00:49:30 +00:00
|
|
|
// When false, the .cookies property is completely disabled
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDisableCookieAccess;
|
2013-03-22 23:08:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Temporary flag that is set in EndUpdate() to ignore
|
|
|
|
* MaybeEditingStateChanged() script runners from a nested scope.
|
|
|
|
*/
|
|
|
|
bool mPendingMaybeEditingStateChanged;
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
2008-11-03 10:31:47 +00:00
|
|
|
#define NS_HTML_DOCUMENT_INTERFACE_TABLE_BEGIN(_class) \
|
|
|
|
NS_DOCUMENT_INTERFACE_TABLE_BEGIN(_class) \
|
|
|
|
NS_INTERFACE_TABLE_ENTRY(_class, nsIHTMLDocument) \
|
2011-05-28 07:43:57 +00:00
|
|
|
NS_INTERFACE_TABLE_ENTRY(_class, nsIDOMHTMLDocument)
|
2008-11-03 10:31:47 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#endif /* nsHTMLDocument_h___ */
|