2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2006-01-24 04:25:14 +03:00
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
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/. */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsHTMLDocument_h___
|
|
|
|
#define nsHTMLDocument_h___
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsDocument.h"
|
|
|
|
#include "nsIHTMLDocument.h"
|
1998-07-23 03:32:19 +04:00
|
|
|
#include "nsIDOMHTMLDocument.h"
|
2003-03-26 10:41:30 +03:00
|
|
|
#include "nsIDOMHTMLCollection.h"
|
2006-01-24 04:25:14 +03:00
|
|
|
#include "nsIScriptElement.h"
|
2009-03-20 11:15:35 +03:00
|
|
|
#include "nsTArray.h"
|
2006-08-15 02:36:15 +04:00
|
|
|
|
2002-01-25 09:37:35 +03:00
|
|
|
#include "pldhash.h"
|
2002-03-02 04:26:49 +03:00
|
|
|
#include "nsIHttpChannel.h"
|
2004-04-13 01:56:09 +04:00
|
|
|
#include "nsHTMLStyleSheet.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2002-11-07 18:36:25 +03:00
|
|
|
#include "nsICommandManager.h"
|
2013-02-08 16:20:11 +04:00
|
|
|
#include "mozilla/dom/HTMLSharedElement.h"
|
2001-05-25 12:49:03 +04:00
|
|
|
|
2007-06-28 06:48:16 +04:00
|
|
|
class nsIEditor;
|
2001-11-16 05:03:19 +03:00
|
|
|
class nsIURI;
|
2012-01-24 13:52:05 +04:00
|
|
|
class nsIDocShell;
|
2010-06-24 10:55:19 +04:00
|
|
|
class nsICachingChannel;
|
2013-06-11 04:18:29 +04:00
|
|
|
class nsIWyciwygChannel;
|
|
|
|
class nsILoadGroup;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2013-09-06 10:41:42 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class HTMLAllCollection;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
class nsHTMLDocument : public nsDocument,
|
1999-01-09 03:15:19 +03:00
|
|
|
public nsIHTMLDocument,
|
2011-05-28 11:43:57 +04:00
|
|
|
public nsIDOMHTMLDocument
|
1999-01-09 03:15:19 +03:00
|
|
|
{
|
1998-04-14 00:24:54 +04:00
|
|
|
public:
|
2011-03-26 19:06:27 +03:00
|
|
|
using nsDocument::SetDocumentURI;
|
2012-04-27 22:17:22 +04:00
|
|
|
using nsDocument::GetPlugins;
|
2011-03-26 19:06:27 +03:00
|
|
|
|
2013-05-06 17:42:00 +04:00
|
|
|
nsHTMLDocument();
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Init() override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2013-06-14 21:10:12 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2013-09-06 10:41:42 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDocument, nsDocument)
|
1998-07-23 03:32:19 +04:00
|
|
|
|
2013-06-12 10:55:00 +04:00
|
|
|
// nsIDocument
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) override;
|
2006-11-22 21:27:54 +03:00
|
|
|
virtual void ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
2001-03-12 09:39:27 +03:00
|
|
|
|
2013-04-01 14:26:37 +04:00
|
|
|
virtual already_AddRefed<nsIPresShell> CreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsStyleSet* aStyleSet) override;
|
1999-07-07 05:27:08 +04:00
|
|
|
|
2004-01-10 02:54:21 +03:00
|
|
|
virtual nsresult StartDocumentLoad(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsISupports* aContainer,
|
|
|
|
nsIStreamListener **aDocListener,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aReset = true,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIContentSink* aSink = nullptr) override;
|
|
|
|
virtual void StopDocumentLoad() override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void BeginLoad() override;
|
|
|
|
virtual void EndLoad() override;
|
1998-07-24 02:06:05 +04:00
|
|
|
|
2013-06-12 10:55:00 +04:00
|
|
|
// nsIHTMLDocument
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetCompatibilityMode(nsCompatibility aMode) override;
|
1998-09-02 06:07:42 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsWriting() override
|
2003-04-19 04:28:09 +04:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
return mWriteLevel != uint32_t(0);
|
2003-04-19 04:28:09 +04:00
|
|
|
}
|
2002-04-19 02:11:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsContentList* GetForms() override;
|
2015-01-06 23:13:36 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsContentList* GetFormControls() override;
|
2015-01-06 23:13:36 +03:00
|
|
|
|
1998-07-23 03:32:19 +04:00
|
|
|
// nsIDOMDocument interface
|
2014-02-24 01:01:26 +04:00
|
|
|
using nsDocument::CreateElement;
|
|
|
|
using nsDocument::CreateElementNS;
|
2011-05-08 22:15:49 +04:00
|
|
|
NS_FORWARD_NSIDOMDOCUMENT(nsDocument::)
|
1998-07-23 03:32:19 +04:00
|
|
|
|
2012-12-22 12:27:27 +04: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-23 03:32:19 +04:00
|
|
|
// nsIDOMNode interface
|
2012-10-09 16:31:24 +04:00
|
|
|
NS_FORWARD_NSIDOMNODE_TO_NSINODE
|
1998-07-23 03:32:19 +04: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 20:46:42 +04:00
|
|
|
// nsIDOMHTMLDocument interface
|
2011-05-28 11:43:57 +04:00
|
|
|
NS_DECL_NSIDOMHTMLDOCUMENT
|
2010-05-10 20:43:20 +04:00
|
|
|
|
2014-02-09 12:02:45 +04:00
|
|
|
mozilla::dom::HTMLAllCollection* All();
|
2010-05-10 20:43:20 +04:00
|
|
|
|
2013-03-18 13:47:32 +04:00
|
|
|
nsISupports* ResolveName(const nsAString& aName, nsWrapperCache **aCache);
|
2013-05-30 00:43:41 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddedForm() override;
|
|
|
|
virtual void RemovedForm() override;
|
|
|
|
virtual int32_t GetNumFormsSynchronous() override;
|
|
|
|
virtual void TearingDownEditor(nsIEditor *aEditor) override;
|
|
|
|
virtual void SetIsXHTML(bool aXHTML) override
|
2014-05-24 23:28:48 +04:00
|
|
|
{
|
|
|
|
mType = (aXHTML ? eXHTML : eHTML);
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetDocWriteDisabled(bool aDisabled) override
|
2009-11-06 07:27:30 +03:00
|
|
|
{
|
|
|
|
mDisableDocWrite = aDisabled;
|
|
|
|
}
|
2003-04-19 04:28:09 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
nsresult ChangeContentEditableCount(nsIContent *aElement, int32_t aChange) override;
|
2010-05-13 02:21:24 +04:00
|
|
|
void DeferredContentEditableCountChange(nsIContent *aElement);
|
2007-06-28 06:48:16 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual EditingState GetEditingState() override
|
2007-06-28 06:48:16 +04:00
|
|
|
{
|
2007-08-10 17:19:13 +04:00
|
|
|
return mEditingState;
|
2007-06-28 06:48:16 +04:00
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DisableCookieAccess() override
|
2008-10-01 04:49:30 +04:00
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
mDisableCookieAccess = true;
|
2008-10-01 04:49:30 +04:00
|
|
|
}
|
|
|
|
|
2008-09-18 06:32:44 +04: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 21:47:34 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
void EndUpdate(nsUpdateType aUpdateType) override;
|
2007-10-26 14:30:44 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult SetEditingState(EditingState aState) override;
|
2008-04-24 01:36:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2008-09-18 15:15:47 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RemovedFromDocShell() override;
|
2009-02-21 05:51:48 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId) override
|
2010-04-19 19:41:38 +04:00
|
|
|
{
|
2010-06-04 05:09:20 +04:00
|
|
|
return nsDocument::GetElementById(aElementId);
|
2010-04-19 19:41:38 +04:00
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DocAddSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const override;
|
2013-10-01 03:20:23 +04:00
|
|
|
// DocAddSizeOfIncludingThis is inherited from nsIDocument.
|
2012-02-02 01:58:01 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool WillIgnoreCharsetOverride() override;
|
2013-01-18 18:27:03 +04:00
|
|
|
|
2012-12-26 06:00:47 +04:00
|
|
|
// WebIDL API
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2012-12-26 06:00:47 +04: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-12 00:26:52 +04:00
|
|
|
void NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
|
|
|
|
JS::MutableHandle<JSObject*> aRetval,
|
|
|
|
mozilla::ErrorResult& rv);
|
2014-04-16 06:58:44 +04:00
|
|
|
bool NameIsEnumerable(const nsAString& aName);
|
2014-04-16 06:58:44 +04:00
|
|
|
void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
|
2012-12-26 06:00:47 +04:00
|
|
|
nsGenericHTMLElement *GetBody();
|
|
|
|
void SetBody(nsGenericHTMLElement* aBody, mozilla::ErrorResult& rv);
|
2013-02-08 16:20:11 +04:00
|
|
|
mozilla::dom::HTMLSharedElement *GetHead() {
|
|
|
|
return static_cast<mozilla::dom::HTMLSharedElement*>(GetHeadElement());
|
|
|
|
}
|
2012-12-26 06:00:47 +04: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 20:09:40 +04:00
|
|
|
mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv);
|
2013-08-01 01:44:51 +04:00
|
|
|
// The XPCOM CaptureEvents works fine for us.
|
|
|
|
// The XPCOM ReleaseEvents works fine for us.
|
2012-12-26 06:00:47 +04:00
|
|
|
// We're picking up GetLocation from Document
|
2014-07-12 03:30:27 +04:00
|
|
|
already_AddRefed<nsLocation> GetLocation() const {
|
2012-12-26 06:00:47 +04:00
|
|
|
return nsIDocument::GetLocation();
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsHTMLDocument* AsHTMLDocument() override { return this; }
|
2013-04-19 05:06:57 +04:00
|
|
|
|
1998-08-28 19:55:31 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
~nsHTMLDocument();
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult GetBodySize(int32_t* aWidth,
|
|
|
|
int32_t* aHeight);
|
2000-08-16 05:04:52 +04:00
|
|
|
|
2002-03-24 02:13:20 +03:00
|
|
|
nsIContent *MatchId(nsIContent *aContent, const nsAString& aId);
|
1998-08-08 03:08:00 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static bool MatchLinks(nsIContent *aContent, int32_t aNamespaceID,
|
2007-02-01 18:14:00 +03:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2012-08-22 19:56:38 +04:00
|
|
|
static bool MatchAnchors(nsIContent *aContent, int32_t aNamespaceID,
|
2007-02-01 18:14:00 +03:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2012-08-22 19:56:38 +04:00
|
|
|
static bool MatchNameAttribute(nsIContent* aContent, int32_t aNamespaceID,
|
2007-02-01 18:14:00 +03:00
|
|
|
nsIAtom* aAtom, void* aData);
|
2010-06-08 23:58:26 +04:00
|
|
|
static void* UseExistingNameString(nsINode* aRootNode, const nsString* aName);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2002-04-19 10:05:03 +04:00
|
|
|
static void DocumentWriteTerminationFunc(nsISupports *aRef);
|
2002-04-19 03:25:35 +04:00
|
|
|
|
2013-03-17 12:51:39 +04:00
|
|
|
already_AddRefed<nsIURI> GetDomainURI();
|
1999-10-02 07:41:37 +04:00
|
|
|
|
2011-05-20 00:05:46 +04:00
|
|
|
nsresult WriteCommon(JSContext *cx, const nsAString& aText,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aNewlineTerminate);
|
2012-12-26 06:00:47 +04: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 03:32:41 +03:00
|
|
|
|
2002-01-31 22:36:45 +03:00
|
|
|
nsresult CreateAndAddWyciwygChannel(void);
|
|
|
|
nsresult RemoveWyciwygChannel(void);
|
2001-05-25 12:49:03 +04:00
|
|
|
|
2015-01-22 04:57:29 +03:00
|
|
|
// This should *ONLY* be used in GetCookie/SetCookie.
|
|
|
|
already_AddRefed<nsIChannel> CreateDummyChannelForCookies(nsIURI* aCodebaseURI);
|
|
|
|
|
2008-10-29 23:12:24 +03:00
|
|
|
/**
|
|
|
|
* Like IsEditingOn(), but will flush as needed first.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsEditingOnAfterFlush();
|
2008-10-29 23:12:24 +03:00
|
|
|
|
2005-06-07 23:21:05 +04:00
|
|
|
void *GenerateParserKey(void);
|
|
|
|
|
2012-12-26 06:00:47 +04:00
|
|
|
nsRefPtr<nsContentList> mImages;
|
|
|
|
nsRefPtr<nsContentList> mApplets;
|
|
|
|
nsRefPtr<nsContentList> mEmbeds;
|
|
|
|
nsRefPtr<nsContentList> mLinks;
|
|
|
|
nsRefPtr<nsContentList> mAnchors;
|
|
|
|
nsRefPtr<nsContentList> mScripts;
|
2005-02-03 02:16:02 +03:00
|
|
|
nsRefPtr<nsContentList> mForms;
|
2006-06-08 08:28:20 +04:00
|
|
|
nsRefPtr<nsContentList> mFormControls;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2013-09-06 10:41:42 +04:00
|
|
|
nsRefPtr<mozilla::dom::HTMLAllCollection> mAll;
|
2013-06-12 10:55:00 +04:00
|
|
|
|
2002-07-17 02:38:51 +04:00
|
|
|
/** # of forms in the document, synchronously set */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mNumForms;
|
2002-07-17 02:38:51 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static uint32_t gWyciwygSessionCnt;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2014-07-10 01:27:49 +04:00
|
|
|
static void TryHintCharset(nsIContentViewer* aContentViewer,
|
2013-01-18 18:27:03 +04:00
|
|
|
int32_t& aCharsetSource,
|
|
|
|
nsACString& aCharset);
|
2014-07-10 01:27:49 +04:00
|
|
|
void TryUserForcedCharset(nsIContentViewer* aCv,
|
2013-01-18 18:27:03 +04:00
|
|
|
nsIDocShell* aDocShell,
|
|
|
|
int32_t& aCharsetSource,
|
|
|
|
nsACString& aCharset);
|
|
|
|
static void TryCacheCharset(nsICachingChannel* aCachingChannel,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t& aCharsetSource,
|
2003-06-17 20:40:34 +04:00
|
|
|
nsACString& aCharset);
|
2012-10-16 11:42:54 +04:00
|
|
|
void TryParentCharset(nsIDocShell* aDocShell,
|
2013-01-18 18:27:03 +04:00
|
|
|
int32_t& charsetSource, nsACString& aCharset);
|
2014-02-06 13:08:01 +04:00
|
|
|
void TryTLD(int32_t& aCharsetSource, nsACString& aCharset);
|
2013-11-04 15:24:33 +04:00
|
|
|
static void TryFallback(int32_t& aCharsetSource, nsACString& aCharset);
|
2001-12-26 06:17:59 +03:00
|
|
|
|
2007-05-09 06:47:58 +04:00
|
|
|
// Override so we can munge the charset on our wyciwyg channel as needed.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetDocumentCharacterSet(const nsACString& aCharSetID) override;
|
2007-05-09 06:47:58 +04:00
|
|
|
|
2006-01-24 04:25:14 +03: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 19:56:38 +04:00
|
|
|
uint32_t mWriteLevel;
|
2006-01-24 04:25:14 +03:00
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
// Load flags of the document's channel
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mLoadFlags;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mTooDeepWriteRecursion;
|
2007-02-11 03:30:20 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mDisableDocWrite;
|
2009-11-06 07:27:30 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mWarnedWidthHeight;
|
2010-08-27 15:44:28 +04:00
|
|
|
|
2002-01-31 22:36:45 +03:00
|
|
|
nsCOMPtr<nsIWyciwygChannel> mWyciwygChannel;
|
2002-11-07 18:36:25 +03:00
|
|
|
|
|
|
|
/* Midas implementation */
|
|
|
|
nsresult GetMidasCommandManager(nsICommandManager** aCommandManager);
|
2008-01-14 12:26:22 +03:00
|
|
|
|
2002-11-07 18:36:25 +03:00
|
|
|
nsCOMPtr<nsICommandManager> mMidasCommandManager;
|
2007-06-28 06:48:16 +04:00
|
|
|
|
|
|
|
nsresult TurnEditingOff();
|
|
|
|
nsresult EditingStateChanged();
|
2009-01-31 15:53:01 +03:00
|
|
|
void MaybeEditingStateChanged();
|
2007-06-28 06:48:16 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mContentEditableCount;
|
2007-06-28 06:48:16 +04:00
|
|
|
EditingState mEditingState;
|
2002-11-07 18:36:25 +03:00
|
|
|
|
2008-10-01 04:49:30 +04:00
|
|
|
// When false, the .cookies property is completely disabled
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mDisableCookieAccess;
|
2013-03-23 03:08:59 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Temporary flag that is set in EndUpdate() to ignore
|
|
|
|
* MaybeEditingStateChanged() script runners from a nested scope.
|
|
|
|
*/
|
|
|
|
bool mPendingMaybeEditingStateChanged;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2008-11-03 13:31:47 +03:00
|
|
|
#define NS_HTML_DOCUMENT_INTERFACE_TABLE_BEGIN(_class) \
|
|
|
|
NS_DOCUMENT_INTERFACE_TABLE_BEGIN(_class) \
|
|
|
|
NS_INTERFACE_TABLE_ENTRY(_class, nsIHTMLDocument) \
|
2011-05-28 11:43:57 +04:00
|
|
|
NS_INTERFACE_TABLE_ENTRY(_class, nsIDOMHTMLDocument)
|
2008-11-03 13:31:47 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsHTMLDocument_h___ */
|