2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 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/. */
|
2006-03-30 12:03:04 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Base class for all our document implementations.
|
|
|
|
*/
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsDocument_h___
|
|
|
|
#define nsDocument_h___
|
|
|
|
|
2013-08-22 10:30:44 +04:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCRT.h"
|
1999-08-25 14:51:55 +04:00
|
|
|
#include "nsWeakReference.h"
|
1999-09-21 10:44:56 +04:00
|
|
|
#include "nsWeakPtr.h"
|
2009-03-20 11:15:35 +03:00
|
|
|
#include "nsTArray.h"
|
2001-10-26 06:23:56 +04:00
|
|
|
#include "nsIDOMXMLDocument.h"
|
2000-06-02 12:13:29 +04:00
|
|
|
#include "nsIDOMDocumentXBL.h"
|
2004-01-29 00:04:33 +03:00
|
|
|
#include "nsStubDocumentObserver.h"
|
1999-12-03 12:24:22 +03:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
1998-08-28 19:57:59 +04:00
|
|
|
#include "nsIContent.h"
|
1999-08-30 01:58:42 +04:00
|
|
|
#include "nsIPrincipal.h"
|
2005-04-28 20:57:24 +04:00
|
|
|
#include "nsIParser.h"
|
2007-02-17 02:02:08 +03:00
|
|
|
#include "nsBindingManager.h"
|
2006-04-26 16:42:49 +04:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2013-06-18 14:00:38 +04:00
|
|
|
#include "nsJSThingHashtable.h"
|
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
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2001-05-01 03:35:09 +04:00
|
|
|
#include "nsIURI.h"
|
2001-05-17 09:54:16 +04:00
|
|
|
#include "nsScriptLoader.h"
|
2002-07-21 03:09:24 +04:00
|
|
|
#include "nsIRadioGroupContainer.h"
|
2005-05-13 00:53:33 +04:00
|
|
|
#include "nsILayoutHistoryState.h"
|
2005-05-13 23:54:28 +04:00
|
|
|
#include "nsIRequest.h"
|
|
|
|
#include "nsILoadGroup.h"
|
2006-06-28 21:36:56 +04:00
|
|
|
#include "nsTObserverArray.h"
|
2006-07-02 11:23:10 +04:00
|
|
|
#include "nsStubMutationObserver.h"
|
2006-10-25 01:47:40 +04:00
|
|
|
#include "nsIChannel.h"
|
2007-01-05 01:31:26 +03:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2008-06-23 03:12:40 +04:00
|
|
|
#include "nsContentList.h"
|
2008-08-18 06:10:28 +04:00
|
|
|
#include "nsGkAtoms.h"
|
2008-08-27 03:09:02 +04:00
|
|
|
#include "nsIApplicationCache.h"
|
|
|
|
#include "nsIApplicationCacheContainer.h"
|
2004-05-05 04:30:57 +04:00
|
|
|
#include "nsStyleSet.h"
|
2015-09-16 06:49:53 +03:00
|
|
|
#include "PLDHashTable.h"
|
2005-10-01 00:06:33 +04:00
|
|
|
#include "nsAttrAndChildArray.h"
|
2006-07-29 20:02:11 +04:00
|
|
|
#include "nsDOMAttributeMap.h"
|
2011-10-15 11:33:26 +04:00
|
|
|
#include "nsIContentViewer.h"
|
2008-10-05 00:00:09 +04:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2008-11-24 21:32:04 +03:00
|
|
|
#include "nsILoadContext.h"
|
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsISecurityEventSink.h"
|
|
|
|
#include "nsIChannelEventSink.h"
|
2009-07-08 09:23:20 +04:00
|
|
|
#include "imgIRequest.h"
|
2014-03-17 10:56:53 +04:00
|
|
|
#include "mozilla/EventListenerManager.h"
|
2014-04-03 08:18:36 +04:00
|
|
|
#include "mozilla/EventStates.h"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2015-04-21 04:22:09 +03:00
|
|
|
#include "mozilla/PendingAnimationTracker.h"
|
2012-12-22 12:27:27 +04:00
|
|
|
#include "mozilla/dom/DOMImplementation.h"
|
2014-04-12 12:15:59 +04:00
|
|
|
#include "mozilla/dom/StyleSheetList.h"
|
2011-08-11 17:29:50 +04:00
|
|
|
#include "nsDataHashtable.h"
|
2011-09-16 03:47:29 +04:00
|
|
|
#include "mozilla/TimeStamp.h"
|
2012-06-19 06:30:09 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-07-04 19:39:24 +04:00
|
|
|
#include "nsIDOMXPathEvaluator.h"
|
2013-10-24 22:53:52 +04:00
|
|
|
#include "jsfriendapi.h"
|
2014-05-21 21:08:12 +04:00
|
|
|
#include "ImportManager.h"
|
2015-06-19 03:09:52 +03:00
|
|
|
#include "mozilla/LinkedList.h"
|
2011-06-23 14:39:48 +04:00
|
|
|
|
2003-04-19 04:28:09 +04:00
|
|
|
#define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)
|
|
|
|
#define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1)
|
|
|
|
#define XML_DECLARATION_BITS_STANDALONE_EXISTS (1 << 2)
|
|
|
|
#define XML_DECLARATION_BITS_STANDALONE_YES (1 << 3)
|
|
|
|
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
class nsDOMStyleSheetSetList;
|
1999-04-01 00:49:25 +04:00
|
|
|
class nsDocument;
|
2002-07-21 03:09:24 +04:00
|
|
|
class nsIRadioVisitor;
|
|
|
|
class nsIFormControl;
|
|
|
|
struct nsRadioGroupStruct;
|
2005-05-13 23:54:28 +04:00
|
|
|
class nsOnloadBlocker;
|
2006-05-10 21:30:15 +04:00
|
|
|
class nsUnblockOnloadEvent;
|
2011-06-23 14:39:48 +04:00
|
|
|
class nsDOMNavigationTiming;
|
2012-02-02 01:58:01 +04:00
|
|
|
class nsWindowSizes;
|
2012-03-24 15:34:42 +04:00
|
|
|
class nsHtml5TreeOpExecutor;
|
2013-01-24 13:09:06 +04:00
|
|
|
class nsDocumentOnStack;
|
2013-07-26 19:37:03 +04:00
|
|
|
class nsISecurityConsoleMessage;
|
2014-10-15 00:15:21 +04:00
|
|
|
class nsPIBoxObject;
|
2005-08-11 00:21:44 +04:00
|
|
|
|
2013-01-04 10:54:26 +04:00
|
|
|
namespace mozilla {
|
2014-03-18 08:48:19 +04:00
|
|
|
class EventChainPreVisitor;
|
2013-01-04 10:54:26 +04:00
|
|
|
namespace dom {
|
2014-10-15 00:15:21 +04:00
|
|
|
class BoxObject;
|
2013-01-04 10:54:26 +04:00
|
|
|
class UndoManager;
|
2014-06-19 04:57:51 +04:00
|
|
|
struct LifecycleCallbacks;
|
2014-02-24 01:01:26 +04:00
|
|
|
class CallbackFunction;
|
2015-06-19 03:09:52 +03:00
|
|
|
|
|
|
|
struct FullscreenRequest : public LinkedListElement<FullscreenRequest>
|
|
|
|
{
|
|
|
|
explicit FullscreenRequest(Element* aElement);
|
2015-08-27 04:21:29 +03:00
|
|
|
FullscreenRequest(const FullscreenRequest&) = delete;
|
2015-06-19 03:09:52 +03:00
|
|
|
~FullscreenRequest();
|
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
Element* GetElement() const { return mElement; }
|
|
|
|
nsDocument* GetDocument() const { return mDocument; }
|
|
|
|
|
|
|
|
private:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<Element> mElement;
|
|
|
|
RefPtr<nsDocument> mDocument;
|
2015-06-19 03:09:52 +03:00
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
public:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<gfx::VRHMDInfo> mVRHMDDevice;
|
2015-06-19 03:09:52 +03:00
|
|
|
// This value should be true if the fullscreen request is
|
|
|
|
// originated from chrome code.
|
|
|
|
bool mIsCallerChrome = false;
|
|
|
|
// This value denotes whether we should trigger a NewOrigin event if
|
|
|
|
// requesting fullscreen in its document causes the origin which is
|
|
|
|
// fullscreen to change. We may want *not* to trigger that event if
|
|
|
|
// we're calling RequestFullScreen() as part of a continuation of a
|
|
|
|
// request in a subdocument in different process, whereupon the caller
|
|
|
|
// need to send some notification itself with the real origin.
|
|
|
|
bool mShouldNotifyNewOrigin = true;
|
|
|
|
};
|
2015-07-13 18:25:42 +03:00
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-01-04 10:54:26 +04:00
|
|
|
|
2008-06-23 03:12:40 +04:00
|
|
|
/**
|
|
|
|
* Right now our identifier map entries contain information for 'name'
|
|
|
|
* and 'id' mappings of a given string. This is so that
|
|
|
|
* nsHTMLDocument::ResolveName only has to do one hash lookup instead
|
|
|
|
* of two. It's not clear whether this still matters for performance.
|
|
|
|
*
|
|
|
|
* We also store the document.all result list here. This is mainly so that
|
|
|
|
* when all elements with the given ID are removed and we remove
|
|
|
|
* the ID's nsIdentifierMapEntry, the document.all result is released too.
|
|
|
|
* Perhaps the document.all results should have their own hashtable
|
|
|
|
* in nsHTMLDocument.
|
|
|
|
*/
|
2010-06-22 06:59:37 +04:00
|
|
|
class nsIdentifierMapEntry : public nsStringHashKey
|
2008-06-23 03:12:40 +04:00
|
|
|
{
|
|
|
|
public:
|
2010-05-14 21:04:51 +04:00
|
|
|
typedef mozilla::dom::Element Element;
|
2014-11-18 16:46:29 +03:00
|
|
|
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
2014-09-02 04:49:25 +04:00
|
|
|
|
|
|
|
explicit nsIdentifierMapEntry(const nsAString& aKey) :
|
2012-07-30 18:20:58 +04:00
|
|
|
nsStringHashKey(&aKey), mNameContentList(nullptr)
|
2010-06-22 06:59:37 +04:00
|
|
|
{
|
|
|
|
}
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsIdentifierMapEntry(const nsAString* aKey) :
|
2012-07-30 18:20:58 +04:00
|
|
|
nsStringHashKey(aKey), mNameContentList(nullptr)
|
2008-06-23 03:12:40 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) :
|
2010-06-22 06:59:37 +04:00
|
|
|
nsStringHashKey(&aOther.GetKey())
|
2008-06-23 03:12:40 +04:00
|
|
|
{
|
|
|
|
NS_ERROR("Should never be called");
|
|
|
|
}
|
|
|
|
~nsIdentifierMapEntry();
|
|
|
|
|
2013-12-02 14:26:11 +04:00
|
|
|
void AddNameElement(nsINode* aDocument, Element* aElement);
|
2010-05-14 21:04:51 +04:00
|
|
|
void RemoveNameElement(Element* aElement);
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsEmpty();
|
2008-06-23 03:12:40 +04:00
|
|
|
nsBaseContentList* GetNameContentList() {
|
|
|
|
return mNameContentList;
|
|
|
|
}
|
2013-03-27 21:15:37 +04:00
|
|
|
bool HasNameElement() const {
|
2013-04-29 17:18:02 +04:00
|
|
|
return mNameContentList && mNameContentList->Length() != 0;
|
2013-03-27 21:15:37 +04:00
|
|
|
}
|
2008-06-23 03:12:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the element if we know the element associated with this
|
|
|
|
* id. Otherwise returns null.
|
|
|
|
*/
|
2010-05-14 21:04:51 +04:00
|
|
|
Element* GetIdElement();
|
2011-11-01 06:50:50 +04:00
|
|
|
/**
|
|
|
|
* Returns the list of all elements associated with this id.
|
|
|
|
*/
|
2015-05-06 20:57:37 +03:00
|
|
|
const nsTArray<Element*>& GetIdElements() const {
|
|
|
|
return mIdContentList;
|
2011-11-01 06:50:50 +04:00
|
|
|
}
|
2010-08-13 17:35:36 +04:00
|
|
|
/**
|
|
|
|
* If this entry has a non-null image element set (using SetImageElement),
|
|
|
|
* the image element will be returned, otherwise the same as GetIdElement().
|
|
|
|
*/
|
|
|
|
Element* GetImageIdElement();
|
2009-03-23 17:04:40 +03:00
|
|
|
/**
|
|
|
|
* Append all the elements with this id to aElements
|
|
|
|
*/
|
2008-06-23 05:48:05 +04:00
|
|
|
void AppendAllIdContent(nsCOMArray<nsIContent>* aElements);
|
2008-06-25 05:55:01 +04:00
|
|
|
/**
|
|
|
|
* This can fire ID change callbacks.
|
|
|
|
* @return true if the content could be added, false if we failed due
|
|
|
|
* to OOM.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool AddIdElement(Element* aElement);
|
2008-06-23 05:48:05 +04:00
|
|
|
/**
|
2008-06-25 05:55:01 +04:00
|
|
|
* This can fire ID change callbacks.
|
2008-06-23 05:48:05 +04:00
|
|
|
*/
|
2010-08-13 17:35:36 +04:00
|
|
|
void RemoveIdElement(Element* aElement);
|
|
|
|
/**
|
|
|
|
* Set the image element override for this ID. This will be returned by
|
2011-10-17 18:59:28 +04:00
|
|
|
* GetIdElement(true) if non-null.
|
2010-08-13 17:35:36 +04:00
|
|
|
*/
|
|
|
|
void SetImageElement(Element* aElement);
|
2013-04-20 20:04:09 +04:00
|
|
|
bool HasIdElementExposedAsHTMLDocumentProperty();
|
2008-06-23 03:12:40 +04:00
|
|
|
|
2012-07-30 18:20:58 +04:00
|
|
|
bool HasContentChangeCallback() { return mChangeCallbacks != nullptr; }
|
2010-08-13 17:35:36 +04:00
|
|
|
void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
2011-09-29 10:19:26 +04:00
|
|
|
void* aData, bool aForImage);
|
2010-08-13 17:35:36 +04:00
|
|
|
void RemoveContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
2011-09-29 10:19:26 +04:00
|
|
|
void* aData, bool aForImage);
|
2008-06-25 05:55:01 +04:00
|
|
|
|
2008-06-23 03:12:40 +04:00
|
|
|
void Traverse(nsCycleCollectionTraversalCallback* aCallback);
|
|
|
|
|
2008-06-25 05:55:01 +04:00
|
|
|
struct ChangeCallback {
|
|
|
|
nsIDocument::IDTargetObserver mCallback;
|
|
|
|
void* mData;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mForImage;
|
2008-06-25 05:55:01 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ChangeCallbackEntry : public PLDHashEntryHdr {
|
|
|
|
typedef const ChangeCallback KeyType;
|
|
|
|
typedef const ChangeCallback* KeyTypePointer;
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit ChangeCallbackEntry(const ChangeCallback* aKey) :
|
|
|
|
mKey(*aKey) { }
|
2008-06-25 05:55:01 +04:00
|
|
|
ChangeCallbackEntry(const ChangeCallbackEntry& toCopy) :
|
|
|
|
mKey(toCopy.mKey) { }
|
|
|
|
|
|
|
|
KeyType GetKey() const { return mKey; }
|
2011-09-29 10:19:26 +04:00
|
|
|
bool KeyEquals(KeyTypePointer aKey) const {
|
2008-06-25 05:55:01 +04:00
|
|
|
return aKey->mCallback == mKey.mCallback &&
|
2010-08-13 17:35:36 +04:00
|
|
|
aKey->mData == mKey.mData &&
|
|
|
|
aKey->mForImage == mKey.mForImage;
|
2008-06-25 05:55:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static KeyTypePointer KeyToPointer(KeyType& aKey) { return &aKey; }
|
|
|
|
static PLDHashNumber HashKey(KeyTypePointer aKey)
|
|
|
|
{
|
2012-03-13 02:53:18 +04:00
|
|
|
return mozilla::HashGeneric(aKey->mCallback, aKey->mData);
|
2008-06-25 05:55:01 +04:00
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
enum { ALLOW_MEMMOVE = true };
|
2014-08-06 00:27:41 +04:00
|
|
|
|
2008-06-25 05:55:01 +04:00
|
|
|
ChangeCallback mKey;
|
|
|
|
};
|
|
|
|
|
2014-08-06 00:27:41 +04:00
|
|
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
2012-06-18 20:39:29 +04:00
|
|
|
|
2008-06-23 03:12:40 +04:00
|
|
|
private:
|
2010-08-13 17:35:36 +04:00
|
|
|
void FireChangeCallbacks(Element* aOldElement, Element* aNewElement,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aImageOnly = false);
|
2008-06-25 05:55:01 +04:00
|
|
|
|
2011-11-01 06:50:50 +04:00
|
|
|
// empty if there are no elements with this ID.
|
2010-09-02 02:48:24 +04:00
|
|
|
// The elements are stored as weak pointers.
|
2015-05-06 20:57:37 +03:00
|
|
|
nsTArray<Element*> mIdContentList;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsBaseContentList> mNameContentList;
|
2008-06-25 05:55:01 +04:00
|
|
|
nsAutoPtr<nsTHashtable<ChangeCallbackEntry> > mChangeCallbacks;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<Element> mImageElement;
|
2008-06-23 03:12:40 +04:00
|
|
|
};
|
1998-05-27 21:51:41 +04:00
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class CustomElementHashKey : public PLDHashEntryHdr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef CustomElementHashKey *KeyType;
|
|
|
|
typedef const CustomElementHashKey *KeyTypePointer;
|
|
|
|
|
|
|
|
CustomElementHashKey(int32_t aNamespaceID, nsIAtom *aAtom)
|
|
|
|
: mNamespaceID(aNamespaceID),
|
|
|
|
mAtom(aAtom)
|
|
|
|
{}
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit CustomElementHashKey(const CustomElementHashKey* aKey)
|
2014-02-24 01:01:26 +04:00
|
|
|
: mNamespaceID(aKey->mNamespaceID),
|
|
|
|
mAtom(aKey->mAtom)
|
|
|
|
{}
|
|
|
|
~CustomElementHashKey()
|
|
|
|
{}
|
|
|
|
|
|
|
|
KeyType GetKey() const { return const_cast<KeyType>(this); }
|
|
|
|
bool KeyEquals(const KeyTypePointer aKey) const
|
|
|
|
{
|
2014-03-27 22:55:44 +04:00
|
|
|
MOZ_ASSERT(mNamespaceID != kNameSpaceID_Unknown,
|
2014-02-24 01:01:26 +04:00
|
|
|
"This equals method is not transitive, nor symmetric. "
|
2014-03-27 22:55:44 +04:00
|
|
|
"A key with a namespace of kNamespaceID_Unknown should "
|
2014-02-24 01:01:26 +04:00
|
|
|
"not be stored in a hashtable.");
|
2014-03-27 22:55:44 +04:00
|
|
|
return (kNameSpaceID_Unknown == aKey->mNamespaceID ||
|
2014-02-24 01:01:26 +04:00
|
|
|
mNamespaceID == aKey->mNamespaceID) &&
|
|
|
|
aKey->mAtom == mAtom;
|
|
|
|
}
|
|
|
|
|
|
|
|
static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
|
|
|
|
static PLDHashNumber HashKey(const KeyTypePointer aKey)
|
|
|
|
{
|
|
|
|
return aKey->mAtom->hash();
|
|
|
|
}
|
|
|
|
enum { ALLOW_MEMMOVE = true };
|
|
|
|
|
|
|
|
private:
|
|
|
|
int32_t mNamespaceID;
|
|
|
|
nsCOMPtr<nsIAtom> mAtom;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LifecycleCallbackArgs
|
|
|
|
{
|
|
|
|
nsString name;
|
|
|
|
nsString oldValue;
|
|
|
|
nsString newValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CustomElementData;
|
|
|
|
|
|
|
|
class CustomElementCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CustomElementCallback(Element* aThisObject,
|
|
|
|
nsIDocument::ElementCallbackType aCallbackType,
|
|
|
|
mozilla::dom::CallbackFunction* aCallback,
|
|
|
|
CustomElementData* aOwnerData);
|
|
|
|
void Traverse(nsCycleCollectionTraversalCallback& aCb) const;
|
|
|
|
void Call();
|
|
|
|
void SetArgs(LifecycleCallbackArgs& aArgs)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mType == nsIDocument::eAttributeChanged,
|
|
|
|
"Arguments are only used by attribute changed callback.");
|
|
|
|
mArgs = aArgs;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// The this value to use for invocation of the callback.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::Element> mThisObject;
|
|
|
|
RefPtr<mozilla::dom::CallbackFunction> mCallback;
|
2014-03-01 05:45:31 +04:00
|
|
|
// The type of callback (eCreated, eAttached, etc.)
|
2014-02-24 01:01:26 +04:00
|
|
|
nsIDocument::ElementCallbackType mType;
|
|
|
|
// Arguments to be passed to the callback,
|
|
|
|
// used by the attribute changed callback.
|
|
|
|
LifecycleCallbackArgs mArgs;
|
|
|
|
// CustomElementData that contains this callback in the
|
|
|
|
// callback queue.
|
|
|
|
CustomElementData* mOwnerData;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Each custom element has an associated callback queue and an element is
|
|
|
|
// being created flag.
|
|
|
|
struct CustomElementData
|
|
|
|
{
|
2014-10-16 22:53:36 +04:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(CustomElementData)
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit CustomElementData(nsIAtom* aType);
|
2014-02-24 01:01:26 +04:00
|
|
|
// Objects in this array are transient and empty after each microtask
|
|
|
|
// checkpoint.
|
|
|
|
nsTArray<nsAutoPtr<CustomElementCallback>> mCallbackQueue;
|
|
|
|
// Custom element type, for <button is="x-button"> or <x-button>
|
|
|
|
// this would be x-button.
|
|
|
|
nsCOMPtr<nsIAtom> mType;
|
|
|
|
// The callback that is next to be processed upon calling RunCallbackQueue.
|
|
|
|
int32_t mCurrentCallback;
|
|
|
|
// Element is being created flag as described in the custom elements spec.
|
|
|
|
bool mElementIsBeingCreated;
|
|
|
|
// Flag to determine if the created callback has been invoked, thus it
|
|
|
|
// determines if other callbacks can be enqueued.
|
|
|
|
bool mCreatedCallbackInvoked;
|
|
|
|
// The microtask level associated with the callbacks in the callback queue,
|
|
|
|
// it is used to determine if a new queue needs to be pushed onto the
|
|
|
|
// processing stack.
|
|
|
|
int32_t mAssociatedMicroTask;
|
|
|
|
|
|
|
|
// Empties the callback queue.
|
|
|
|
void RunCallbackQueue();
|
2014-10-16 22:53:36 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual ~CustomElementData() {}
|
2014-02-24 01:01:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// The required information for a custom element as defined in:
|
|
|
|
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html
|
|
|
|
struct CustomElementDefinition
|
|
|
|
{
|
|
|
|
CustomElementDefinition(JSObject* aPrototype,
|
|
|
|
nsIAtom* aType,
|
|
|
|
nsIAtom* aLocalName,
|
|
|
|
mozilla::dom::LifecycleCallbacks* aCallbacks,
|
|
|
|
uint32_t aNamespaceID,
|
|
|
|
uint32_t aDocOrder);
|
|
|
|
|
|
|
|
// The prototype to use for new custom elements of this type.
|
|
|
|
JS::Heap<JSObject *> mPrototype;
|
|
|
|
|
|
|
|
// The type (name) for this custom element.
|
|
|
|
nsCOMPtr<nsIAtom> mType;
|
|
|
|
|
|
|
|
// The localname to (e.g. <button is=type> -- this would be button).
|
|
|
|
nsCOMPtr<nsIAtom> mLocalName;
|
|
|
|
|
|
|
|
// The lifecycle callbacks to call for this custom element.
|
|
|
|
nsAutoPtr<mozilla::dom::LifecycleCallbacks> mCallbacks;
|
|
|
|
|
|
|
|
// Whether we're currently calling the created callback for a custom element
|
|
|
|
// of this type.
|
|
|
|
bool mElementIsBeingCreated;
|
|
|
|
|
|
|
|
// Element namespace.
|
|
|
|
int32_t mNamespaceID;
|
|
|
|
|
|
|
|
// The document custom element order.
|
|
|
|
uint32_t mDocOrder;
|
|
|
|
};
|
|
|
|
|
2014-03-27 22:55:44 +04:00
|
|
|
class Registry : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
friend class ::nsDocument;
|
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Registry)
|
|
|
|
|
|
|
|
Registry();
|
|
|
|
|
|
|
|
protected:
|
2014-06-25 06:09:15 +04:00
|
|
|
virtual ~Registry();
|
|
|
|
|
2014-03-27 22:55:44 +04:00
|
|
|
typedef nsClassHashtable<mozilla::dom::CustomElementHashKey,
|
|
|
|
mozilla::dom::CustomElementDefinition>
|
|
|
|
DefinitionMap;
|
|
|
|
typedef nsClassHashtable<mozilla::dom::CustomElementHashKey,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<mozilla::dom::Element>>>
|
2014-03-27 22:55:44 +04:00
|
|
|
CandidateMap;
|
|
|
|
|
|
|
|
// Hashtable for custom element definitions in web components.
|
2015-03-02 20:48:30 +03:00
|
|
|
// Custom prototypes are stored in the compartment where
|
|
|
|
// registerElement was called.
|
2014-03-27 22:55:44 +04:00
|
|
|
DefinitionMap mCustomDefinitions;
|
|
|
|
|
|
|
|
// The "upgrade candidates map" from the web components spec. Maps from a
|
|
|
|
// namespace id and local name to a list of elements to upgrade if that
|
|
|
|
// element is registered as a custom element.
|
|
|
|
CandidateMap mCandidatesMap;
|
|
|
|
};
|
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1999-01-23 10:01:40 +03:00
|
|
|
class nsDocHeaderData
|
|
|
|
{
|
|
|
|
public:
|
2002-03-24 02:54:46 +03:00
|
|
|
nsDocHeaderData(nsIAtom* aField, const nsAString& aData)
|
2012-07-30 18:20:58 +04:00
|
|
|
: mField(aField), mData(aData), mNext(nullptr)
|
1999-01-23 10:01:40 +03:00
|
|
|
{
|
|
|
|
}
|
2003-03-26 10:41:30 +03:00
|
|
|
|
1999-01-23 10:01:40 +03:00
|
|
|
~nsDocHeaderData(void)
|
|
|
|
{
|
2003-03-26 10:41:30 +03:00
|
|
|
delete mNext;
|
1999-01-23 10:01:40 +03:00
|
|
|
}
|
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
nsCOMPtr<nsIAtom> mField;
|
|
|
|
nsString mData;
|
|
|
|
nsDocHeaderData* mNext;
|
1999-01-23 10:01:40 +03:00
|
|
|
};
|
1998-07-01 15:16:09 +04:00
|
|
|
|
2014-04-12 12:15:59 +04:00
|
|
|
class nsDOMStyleSheetList : public mozilla::dom::StyleSheetList,
|
2004-01-29 00:04:33 +03:00
|
|
|
public nsStubDocumentObserver
|
2001-04-12 05:05:42 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsDOMStyleSheetList(nsIDocument* aDocument);
|
2001-04-12 05:05:42 +04:00
|
|
|
|
2014-04-12 12:18:54 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2004-01-29 00:04:33 +03:00
|
|
|
// nsIDocumentObserver
|
2010-10-20 11:41:05 +04:00
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED
|
|
|
|
|
|
|
|
// nsIMutationObserver
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
2001-04-12 05:05:42 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsINode* GetParentObject() const override
|
2014-04-12 12:18:54 +04:00
|
|
|
{
|
|
|
|
return mDocument;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual uint32_t Length() override;
|
2014-06-20 14:32:49 +04:00
|
|
|
virtual mozilla::CSSStyleSheet*
|
2015-03-21 19:28:04 +03:00
|
|
|
IndexedGetter(uint32_t aIndex, bool& aFound) override;
|
2008-10-22 18:31:14 +04:00
|
|
|
|
2001-04-12 05:05:42 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~nsDOMStyleSheetList();
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mLength;
|
2001-04-12 05:05:42 +04:00
|
|
|
nsIDocument* mDocument;
|
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsOnloadBlocker final : public nsIRequest
|
2005-05-13 23:54:28 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsOnloadBlocker() {}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
|
|
|
|
private:
|
|
|
|
~nsOnloadBlocker() {}
|
|
|
|
};
|
2002-04-17 08:17:16 +04:00
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
class nsExternalResourceMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef nsIDocument::ExternalResourceLoad ExternalResourceLoad;
|
|
|
|
nsExternalResourceMap();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request an external resource document. This does exactly what
|
|
|
|
* nsIDocument::RequestExternalResource is documented to do.
|
|
|
|
*/
|
|
|
|
nsIDocument* RequestResource(nsIURI* aURI,
|
|
|
|
nsINode* aRequestingNode,
|
|
|
|
nsDocument* aDisplayDocument,
|
|
|
|
ExternalResourceLoad** aPendingLoad);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerate the resource documents. See
|
|
|
|
* nsIDocument::EnumerateExternalResources.
|
|
|
|
*/
|
|
|
|
void EnumerateResources(nsIDocument::nsSubDocEnumFunc aCallback, void* aData);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Traverse ourselves for cycle-collection
|
|
|
|
*/
|
|
|
|
void Traverse(nsCycleCollectionTraversalCallback* aCallback) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shut ourselves down (used for cycle-collection unlink), as well
|
|
|
|
* as for document destruction.
|
|
|
|
*/
|
|
|
|
void Shutdown()
|
|
|
|
{
|
|
|
|
mPendingLoads.Clear();
|
|
|
|
mMap.Clear();
|
2011-10-17 18:59:28 +04:00
|
|
|
mHaveShutDown = true;
|
2008-10-05 00:00:09 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool HaveShutDown() const
|
2008-10-05 00:00:09 +04:00
|
|
|
{
|
|
|
|
return mHaveShutDown;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Needs to be public so we can traverse them sanely
|
|
|
|
struct ExternalResource
|
|
|
|
{
|
|
|
|
~ExternalResource();
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
nsCOMPtr<nsIContentViewer> mViewer;
|
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
|
|
|
};
|
|
|
|
|
2010-08-12 01:05:26 +04:00
|
|
|
// Hide all our viewers
|
|
|
|
void HideViewers();
|
|
|
|
|
|
|
|
// Show all our viewers
|
|
|
|
void ShowViewers();
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
protected:
|
|
|
|
class PendingLoad : public ExternalResourceLoad,
|
|
|
|
public nsIStreamListener
|
|
|
|
{
|
2014-06-25 06:09:15 +04:00
|
|
|
~PendingLoad() {}
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit PendingLoad(nsDocument* aDisplayDocument) :
|
2008-10-05 00:00:09 +04:00
|
|
|
mDisplayDocument(aDisplayDocument)
|
|
|
|
{}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start aURI loading. This will perform the necessary security checks and
|
|
|
|
* so forth.
|
|
|
|
*/
|
|
|
|
nsresult StartLoad(nsIURI* aURI, nsINode* aRequestingNode);
|
|
|
|
|
|
|
|
/**
|
2011-10-15 11:33:26 +04:00
|
|
|
* Set up an nsIContentViewer based on aRequest. This is guaranteed to
|
2008-10-05 00:00:09 +04:00
|
|
|
* put null in *aViewer and *aLoadGroup on all failures.
|
|
|
|
*/
|
2011-10-15 11:33:26 +04:00
|
|
|
nsresult SetupViewer(nsIRequest* aRequest, nsIContentViewer** aViewer,
|
2008-10-05 00:00:09 +04:00
|
|
|
nsILoadGroup** aLoadGroup);
|
|
|
|
|
|
|
|
private:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsDocument> mDisplayDocument;
|
2008-10-05 00:00:09 +04:00
|
|
|
nsCOMPtr<nsIStreamListener> mTargetListener;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
|
|
|
};
|
|
|
|
friend class PendingLoad;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class LoadgroupCallbacks final : public nsIInterfaceRequestor
|
2008-10-05 00:00:09 +04:00
|
|
|
{
|
2014-06-25 06:09:15 +04:00
|
|
|
~LoadgroupCallbacks() {}
|
2008-10-05 00:00:09 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
|
2008-10-05 00:00:09 +04:00
|
|
|
: mCallbacks(aOtherCallbacks)
|
|
|
|
{}
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
private:
|
2008-11-24 21:32:04 +03:00
|
|
|
// The only reason it's safe to hold a strong ref here without leaking is
|
|
|
|
// that the notificationCallbacks on a loadgroup aren't the docshell itself
|
|
|
|
// but a shim that holds a weak reference to the docshell.
|
2008-10-05 00:00:09 +04:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2008-11-24 21:32:04 +03:00
|
|
|
|
|
|
|
// Use shims for interfaces that docshell implements directly so that we
|
|
|
|
// don't hand out references to the docshell. The shims should all allow
|
|
|
|
// getInterface back on us, but other than that each one should only
|
|
|
|
// implement one interface.
|
|
|
|
|
|
|
|
// XXXbz I wish we could just derive the _allcaps thing from _i
|
|
|
|
#define DECL_SHIM(_i, _allcaps) \
|
2015-03-27 21:52:19 +03:00
|
|
|
class _i##Shim final : public nsIInterfaceRequestor, \
|
|
|
|
public _i \
|
2008-11-24 21:32:04 +03:00
|
|
|
{ \
|
2014-06-25 06:09:15 +04:00
|
|
|
~_i##Shim() {} \
|
2008-11-24 21:32:04 +03:00
|
|
|
public: \
|
|
|
|
_i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr) \
|
|
|
|
: mIfReq(aIfreq), mRealPtr(aRealPtr) \
|
|
|
|
{ \
|
|
|
|
NS_ASSERTION(mIfReq, "Expected non-null here"); \
|
|
|
|
NS_ASSERTION(mRealPtr, "Expected non-null here"); \
|
|
|
|
} \
|
|
|
|
NS_DECL_ISUPPORTS \
|
2012-07-15 08:11:10 +04:00
|
|
|
NS_FORWARD_NSIINTERFACEREQUESTOR(mIfReq->) \
|
|
|
|
NS_FORWARD_##_allcaps(mRealPtr->) \
|
2008-11-24 21:32:04 +03:00
|
|
|
private: \
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mIfReq; \
|
|
|
|
nsCOMPtr<_i> mRealPtr; \
|
|
|
|
};
|
|
|
|
|
|
|
|
DECL_SHIM(nsILoadContext, NSILOADCONTEXT)
|
|
|
|
DECL_SHIM(nsIProgressEventSink, NSIPROGRESSEVENTSINK)
|
|
|
|
DECL_SHIM(nsIChannelEventSink, NSICHANNELEVENTSINK)
|
|
|
|
DECL_SHIM(nsISecurityEventSink, NSISECURITYEVENTSINK)
|
|
|
|
DECL_SHIM(nsIApplicationCacheContainer, NSIAPPLICATIONCACHECONTAINER)
|
|
|
|
#undef DECL_SHIM
|
2008-10-05 00:00:09 +04:00
|
|
|
};
|
2015-02-19 04:34:29 +03:00
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
/**
|
|
|
|
* Add an ExternalResource for aURI. aViewer and aLoadGroup might be null
|
|
|
|
* when this is called if the URI didn't result in an XML document. This
|
|
|
|
* function makes sure to remove the pending load for aURI, if any, from our
|
|
|
|
* hashtable, and to notify its observers, if any.
|
|
|
|
*/
|
2011-10-15 11:33:26 +04:00
|
|
|
nsresult AddExternalResource(nsIURI* aURI, nsIContentViewer* aViewer,
|
2008-10-05 00:00:09 +04:00
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsIDocument* aDisplayDocument);
|
|
|
|
|
|
|
|
nsClassHashtable<nsURIHashKey, ExternalResource> mMap;
|
|
|
|
nsRefPtrHashtable<nsURIHashKey, PendingLoad> mPendingLoads;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mHaveShutDown;
|
2008-10-05 00:00:09 +04:00
|
|
|
};
|
|
|
|
|
2001-10-26 06:23:56 +04:00
|
|
|
// Base class for our document implementations.
|
|
|
|
//
|
|
|
|
// Note that this class *implements* nsIDOMXMLDocument, but it's not
|
|
|
|
// really an nsIDOMXMLDocument. The reason for implementing
|
|
|
|
// nsIDOMXMLDocument on this class is to avoid having to duplicate all
|
|
|
|
// its inherited methods on document classes that *are*
|
|
|
|
// nsIDOMXMLDocument's. nsDocument's QI should *not* claim to support
|
|
|
|
// nsIDOMXMLDocument unless someone writes a real implementation of
|
|
|
|
// the interface.
|
2003-03-26 10:41:30 +03:00
|
|
|
class nsDocument : public nsIDocument,
|
|
|
|
public nsIDOMXMLDocument, // inherits nsIDOMDocument
|
2000-06-02 12:13:29 +04:00
|
|
|
public nsIDOMDocumentXBL,
|
1999-09-21 18:18:52 +04:00
|
|
|
public nsSupportsWeakReference,
|
2002-07-21 03:09:24 +04:00
|
|
|
public nsIScriptObjectPrincipal,
|
2011-07-19 13:44:55 +04:00
|
|
|
public nsIRadioGroupContainer,
|
2008-08-27 03:09:02 +04:00
|
|
|
public nsIApplicationCacheContainer,
|
2011-04-26 16:30:17 +04:00
|
|
|
public nsStubMutationObserver,
|
2013-07-04 19:39:24 +04:00
|
|
|
public nsIObserver,
|
|
|
|
public nsIDOMXPathEvaluator
|
1998-12-18 20:34:34 +03:00
|
|
|
{
|
2014-05-24 22:46:38 +04:00
|
|
|
friend class nsIDocument;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
public:
|
2010-06-23 13:31:35 +04:00
|
|
|
typedef mozilla::dom::Element Element;
|
2012-12-22 12:27:27 +04:00
|
|
|
using nsIDocument::GetElementsByTagName;
|
2015-01-05 20:42:31 +03:00
|
|
|
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
2010-06-23 13:31:35 +04:00
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2012-02-02 01:58:01 +04:00
|
|
|
|
|
|
|
NS_DECL_SIZEOF_EXCLUDING_THIS
|
1998-04-14 00:24:54 +04:00
|
|
|
|
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
|
|
|
|
2006-01-27 04:03:06 +03:00
|
|
|
// StartDocumentLoad is pure virtual so that subclasses must override it.
|
|
|
|
// The nsDocument StartDocumentLoad does some setup, but does NOT set
|
|
|
|
// *aDocListener; this is the job of subclasses.
|
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* aContentSink = nullptr) override = 0;
|
1999-01-06 03:32:41 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void StopDocumentLoad() override;
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void NotifyPossibleTitleChange(bool aBoundTitleElement) override;
|
2008-08-18 06:10:28 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetDocumentURI(nsIURI* aURI) override;
|
2011-08-09 16:35:00 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetChromeXHRDocURI(nsIURI* aURI) override;
|
2013-09-25 01:56:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetChromeXHRDocBaseURI(nsIURI* aURI) override;
|
2013-09-25 01:56:52 +04:00
|
|
|
|
2015-11-15 06:28:38 +03:00
|
|
|
virtual void ApplySettingsFromCSP(bool aSpeculative) override;
|
|
|
|
|
2000-03-21 07:09:58 +03:00
|
|
|
/**
|
2003-10-22 02:11:49 +04:00
|
|
|
* Set the principal responsible for this document.
|
2000-03-21 07:09:58 +03:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetPrincipal(nsIPrincipal *aPrincipal) override;
|
2000-03-21 07:09:58 +03:00
|
|
|
|
2003-01-09 18:45:45 +03:00
|
|
|
/**
|
|
|
|
* Get the Content-Type of this document.
|
|
|
|
*/
|
|
|
|
// NS_IMETHOD GetContentType(nsAString& aContentType);
|
2011-05-28 11:43:53 +04:00
|
|
|
// Already declared in nsIDOMDocument
|
2003-01-09 18:45:45 +03:00
|
|
|
|
|
|
|
/**
|
2003-04-19 20:53:44 +04:00
|
|
|
* Set the Content-Type of this document.
|
2003-01-09 18:45:45 +03:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetContentType(const nsAString& aContentType) override;
|
1998-10-02 01:43:49 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult SetBaseURI(nsIURI* aURI) override;
|
2001-05-01 03:35:09 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/Set the base target of a link in a document.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetBaseTarget(nsAString &aBaseTarget) override;
|
1999-01-15 04:53:50 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Return a standard name for the document's character set. This will
|
|
|
|
* trigger a startDocumentLoad if necessary to answer the question.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetDocumentCharacterSet(const nsACString& aCharSetID) override;
|
2001-12-26 06:17:59 +03:00
|
|
|
|
2000-06-02 03:10:44 +04:00
|
|
|
/**
|
|
|
|
* Add an observer that gets notified whenever the charset changes.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult AddCharSetObserver(nsIObserver* aObserver) override;
|
2000-06-02 03:10:44 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a charset observer.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RemoveCharSetObserver(nsIObserver* aObserver) override;
|
2000-06-02 03:10:44 +04:00
|
|
|
|
2010-05-14 21:04:51 +04:00
|
|
|
virtual Element* AddIDTargetObserver(nsIAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 19:28:04 +03:00
|
|
|
void* aData, bool aForImage) override;
|
2010-08-13 17:35:36 +04:00
|
|
|
virtual void RemoveIDTargetObserver(nsIAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 19:28:04 +03:00
|
|
|
void* aData, bool aForImage) override;
|
2008-06-25 05:55:01 +04:00
|
|
|
|
1999-01-23 10:01:40 +03:00
|
|
|
/**
|
|
|
|
* Access HTTP header data (this may also get set from other sources, like
|
|
|
|
* HTML META tags).
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetHeaderData(nsIAtom* aHeaderField, nsAString& aData) const override;
|
2003-10-22 10:09:48 +04:00
|
|
|
virtual void SetHeaderData(nsIAtom* aheaderField,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aData) override;
|
1999-01-23 10:01:40 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Create a new presentation shell that will use aContext for
|
2013-04-01 14:26:37 +04:00
|
|
|
* its presentation context (presentation contexts <b>must not</b> be
|
|
|
|
* shared among multiple presentation shells).
|
1998-04-14 00:24:54 +04: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;
|
|
|
|
virtual void DeleteShell() override;
|
2004-01-10 02:54:21 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetAllowPlugins(bool* aAllowPlugins) override;
|
2012-08-20 22:34:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() override;
|
2013-01-04 10:54:26 +04:00
|
|
|
|
2015-01-08 07:53:24 +03:00
|
|
|
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
|
2015-04-10 04:34:22 +03:00
|
|
|
virtual mozilla::dom::DocumentTimeline* Timeline() override;
|
2014-05-13 11:22:12 +04:00
|
|
|
|
2011-10-30 00:22:19 +04:00
|
|
|
virtual nsresult SetSubDocumentFor(Element* aContent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIDocument* aSubDoc) override;
|
|
|
|
virtual nsIDocument* GetSubDocumentFor(nsIContent* aContent) const override;
|
|
|
|
virtual Element* FindContentForSubDocument(nsIDocument *aDocument) const override;
|
|
|
|
virtual Element* GetRootElementInternal() const override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void EnsureOnDemandBuiltInUASheet(mozilla::CSSStyleSheet* aSheet) override;
|
2014-05-24 22:46:38 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
2014-05-24 22:46:38 +04:00
|
|
|
* Get the (document) style sheets owned by this document.
|
1998-09-02 06:02:30 +04:00
|
|
|
* These are ordered, highest priority last
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual int32_t GetNumberOfStyleSheets() const override;
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual mozilla::CSSStyleSheet* GetStyleSheetAt(int32_t aIndex) const override;
|
|
|
|
virtual int32_t GetIndexOfStyleSheet(mozilla::CSSStyleSheet* aSheet) const override;
|
|
|
|
virtual void AddStyleSheet(mozilla::CSSStyleSheet* aSheet) override;
|
|
|
|
virtual void RemoveStyleSheet(mozilla::CSSStyleSheet* aSheet) override;
|
|
|
|
|
|
|
|
virtual void UpdateStyleSheets(
|
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aOldSheets,
|
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aNewSheets) override;
|
|
|
|
virtual void AddStyleSheetToStyleSets(mozilla::CSSStyleSheet* aSheet);
|
|
|
|
virtual void RemoveStyleSheetFromStyleSets(mozilla::CSSStyleSheet* aSheet);
|
|
|
|
|
|
|
|
virtual void InsertStyleSheetAt(mozilla::CSSStyleSheet* aSheet,
|
|
|
|
int32_t aIndex) override;
|
|
|
|
virtual void SetStyleSheetApplicableState(mozilla::CSSStyleSheet* aSheet,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aApplicable) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
|
|
|
|
nsIURI* aSheetURI) override;
|
|
|
|
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
|
|
|
|
mozilla::CSSStyleSheet* aSheet) override;
|
|
|
|
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
|
|
|
|
nsIURI* sheetURI) override;
|
|
|
|
virtual mozilla::CSSStyleSheet* FirstAdditionalAuthorSheet() override;
|
2012-09-11 15:51:10 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIChannel* GetChannel() const override {
|
2005-06-01 05:15:23 +04:00
|
|
|
return mChannel;
|
|
|
|
}
|
2004-07-28 11:08:41 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIChannel* GetFailedChannel() const override {
|
2014-06-20 00:55:55 +04:00
|
|
|
return mFailedChannel;
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetFailedChannel(nsIChannel* aChannel) override {
|
2014-06-20 00:55:55 +04:00
|
|
|
mFailedChannel = aChannel;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) override;
|
1998-06-26 02:26:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject) override;
|
2007-10-01 14:02:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIGlobalObject* GetScopeObject() const override;
|
|
|
|
void SetScopeObject(nsIGlobalObject* aGlobal) override;
|
2001-05-17 09:54:16 +04:00
|
|
|
/**
|
|
|
|
* Get the script loader for this document
|
2003-03-26 10:41:30 +03:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsScriptLoader* ScriptLoader() override;
|
2001-05-17 09:54:16 +04:00
|
|
|
|
2010-06-04 05:09:20 +04:00
|
|
|
/**
|
|
|
|
* Add/Remove an element to the document's id and name hashes
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddToIdTable(Element* aElement, nsIAtom* aId) override;
|
|
|
|
virtual void RemoveFromIdTable(Element* aElement, nsIAtom* aId) override;
|
|
|
|
virtual void AddToNameTable(Element* aElement, nsIAtom* aName) override;
|
|
|
|
virtual void RemoveFromNameTable(Element* aElement, nsIAtom* aName) override;
|
2010-06-04 05:09:20 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Add a new observer of document change notifications. Whenever
|
|
|
|
* content is changed, appended, inserted or removed the observers are
|
|
|
|
* informed.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an observer of document change notifications. This will
|
|
|
|
* return false if the observer cannot be found.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RemoveObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2003-10-03 01:29:40 +04:00
|
|
|
// Observation hooks used to propagate notifications to document
|
|
|
|
// observers.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void BeginUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void EndUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void BeginLoad() override;
|
|
|
|
virtual void EndLoad() override;
|
2009-01-09 20:12:09 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetReadyStateInternal(ReadyState rs) override;
|
2009-01-09 20:12:09 +03:00
|
|
|
|
2011-03-29 07:32:11 +04:00
|
|
|
virtual void ContentStateChanged(nsIContent* aContent,
|
2014-04-03 08:18:36 +04:00
|
|
|
mozilla::EventStates aStateMask)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-04-03 08:18:36 +04:00
|
|
|
virtual void DocumentStatesChanged(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::EventStates aStateMask) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual void StyleRuleChanged(mozilla::CSSStyleSheet* aStyleSheet,
|
2015-11-21 01:34:12 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual void StyleRuleAdded(mozilla::CSSStyleSheet* aStyleSheet,
|
2015-11-05 11:44:10 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual void StyleRuleRemoved(mozilla::CSSStyleSheet* aStyleSheet,
|
2015-11-05 11:44:10 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void FlushPendingNotifications(mozFlushType aType) override;
|
|
|
|
virtual void FlushExternalResources(mozFlushType aType) override;
|
2014-01-04 19:02:17 +04:00
|
|
|
virtual void SetXMLDeclaration(const char16_t *aVersion,
|
|
|
|
const char16_t *aEncoding,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int32_t aStandalone) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
virtual void GetXMLDeclaration(nsAString& aVersion,
|
|
|
|
nsAString& aEncoding,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsAString& Standalone) override;
|
|
|
|
virtual bool IsScriptEnabled() override;
|
2004-01-10 02:54:21 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void OnPageShow(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
|
|
|
virtual void OnPageHide(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
2013-04-06 04:44:15 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void WillDispatchMutationEvent(nsINode* aTarget) override;
|
|
|
|
virtual void MutationEventDispatched(nsINode* aTarget) override;
|
2005-06-16 03:52:46 +04:00
|
|
|
|
2006-01-19 06:34:18 +03:00
|
|
|
// nsINode
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsNodeOfType(uint32_t aFlags) const override;
|
|
|
|
virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
|
|
|
|
virtual nsIContent * const * GetChildArray(uint32_t* aChildCount) const override;
|
|
|
|
virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
|
|
|
|
virtual uint32_t GetChildCount() const override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
|
|
|
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
|
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override
|
2006-09-05 14:22:54 +04:00
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
2006-01-19 06:34:18 +03:00
|
|
|
|
2002-07-21 03:09:24 +04:00
|
|
|
// nsIRadioGroupContainer
|
|
|
|
NS_IMETHOD WalkRadioGroup(const nsAString& aName,
|
2006-02-08 08:56:13 +03:00
|
|
|
nsIRadioVisitor* aVisitor,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aFlushContent) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
virtual void
|
|
|
|
SetCurrentRadioButton(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::dom::HTMLInputElement* aRadio) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
virtual mozilla::dom::HTMLInputElement*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetCurrentRadioButton(const nsAString& aName) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
NS_IMETHOD
|
|
|
|
GetNextRadioButton(const nsAString& aName,
|
|
|
|
const bool aPrevious,
|
|
|
|
mozilla::dom::HTMLInputElement* aFocusedRadio,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::dom::HTMLInputElement** aRadioOut) override;
|
2012-08-03 14:38:52 +04:00
|
|
|
virtual void AddToRadioGroup(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIFormControl* aRadio) override;
|
2012-08-03 14:38:52 +04:00
|
|
|
virtual void RemoveFromRadioGroup(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIFormControl* aRadio) override;
|
|
|
|
virtual uint32_t GetRequiredRadioCount(const nsAString& aName) const override;
|
2014-11-28 04:40:00 +03:00
|
|
|
virtual void RadioRequiredWillChange(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aRequiredAdded) override;
|
|
|
|
virtual bool GetValueMissingState(const nsAString& aName) const override;
|
|
|
|
virtual void SetValueMissingState(const nsAString& aName, bool aValue) override;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2002-07-21 03:09:24 +04:00
|
|
|
// for radio group
|
2012-08-04 11:44:00 +04:00
|
|
|
nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
|
|
|
|
nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
|
2002-07-21 03:09:24 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsViewportInfo GetViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) override;
|
2013-01-04 07:27:06 +04:00
|
|
|
|
2014-08-29 04:20:27 +04:00
|
|
|
/**
|
|
|
|
* Called when an app-theme-changed observer notification is
|
|
|
|
* received by this document.
|
|
|
|
*/
|
|
|
|
void OnAppThemeChanged();
|
|
|
|
|
2015-06-03 19:39:18 +03:00
|
|
|
void ReportUseCounters();
|
|
|
|
|
2012-08-04 11:44:00 +04:00
|
|
|
private:
|
2014-06-20 14:32:49 +04:00
|
|
|
void AddOnDemandBuiltInUASheet(mozilla::CSSStyleSheet* aSheet);
|
2012-08-04 11:44:00 +04:00
|
|
|
nsRadioGroupStruct* GetRadioGroupInternal(const nsAString& aName) const;
|
2013-07-26 19:37:03 +04:00
|
|
|
void SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages);
|
2012-08-04 11:44:00 +04:00
|
|
|
|
|
|
|
public:
|
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
|
|
|
// nsIDOMNode
|
2012-10-09 16:31:24 +04:00
|
|
|
NS_FORWARD_NSIDOMNODE_TO_NSINODE_OVERRIDABLE
|
2001-04-13 03:35:24 +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
|
|
|
// nsIDOMDocument
|
|
|
|
NS_DECL_NSIDOMDOCUMENT
|
2001-10-26 06:23:56 +04:00
|
|
|
|
|
|
|
// nsIDOMXMLDocument
|
|
|
|
NS_DECL_NSIDOMXMLDOCUMENT
|
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
|
|
|
|
|
|
|
// nsIDOMDocumentXBL
|
|
|
|
NS_DECL_NSIDOMDOCUMENTXBL
|
2000-05-16 15:35:12 +04:00
|
|
|
|
2002-11-09 03:25:25 +03:00
|
|
|
// nsIDOMEventTarget
|
2014-03-18 08:48:19 +04:00
|
|
|
virtual nsresult PreHandleEvent(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::EventChainPreVisitor& aVisitor) override;
|
2014-03-17 10:56:53 +04:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetOrCreateListenerManager() override;
|
2014-03-17 10:56:53 +04:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetExistingListenerManager() const override;
|
1999-03-29 02:22:54 +04:00
|
|
|
|
2003-10-22 10:09:48 +04:00
|
|
|
// nsIScriptObjectPrincipal
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2008-08-27 03:09:02 +04:00
|
|
|
// nsIApplicationCacheContainer
|
|
|
|
NS_DECL_NSIAPPLICATIONCACHECONTAINER
|
|
|
|
|
2012-05-09 01:47:20 +04:00
|
|
|
// nsIObserver
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2013-07-04 19:39:24 +04:00
|
|
|
NS_DECL_NSIDOMXPATHEVALUATOR
|
|
|
|
|
2002-01-25 09:37:35 +03:00
|
|
|
virtual nsresult Init();
|
|
|
|
|
2015-08-13 14:50:00 +03:00
|
|
|
virtual already_AddRefed<Element> CreateElem(const nsAString& aName,
|
|
|
|
nsIAtom* aPrefix,
|
|
|
|
int32_t aNamespaceID) override;
|
2004-06-25 16:26:02 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Sanitize() override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void EnumerateSubDocuments(nsSubDocEnumFunc aCallback,
|
2015-03-21 19:28:04 +03:00
|
|
|
void *aData) override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool CanSavePresentation(nsIRequest *aNewRequest) override;
|
|
|
|
virtual void Destroy() override;
|
|
|
|
virtual void RemovedFromDocShell() override;
|
|
|
|
virtual already_AddRefed<nsILayoutHistoryState> GetLayoutHistoryState() const override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void BlockOnload() override;
|
|
|
|
virtual void UnblockOnload(bool aFireSync) override;
|
2005-05-13 23:54:28 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddStyleRelevantLink(mozilla::dom::Link* aLink) override;
|
|
|
|
virtual void ForgetLink(mozilla::dom::Link* aLink) override;
|
2005-08-11 00:21:44 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ClearBoxObjectFor(nsIContent* aContent) override;
|
2014-10-15 00:15:21 +04:00
|
|
|
|
|
|
|
virtual already_AddRefed<mozilla::dom::BoxObject>
|
|
|
|
GetBoxObjectFor(mozilla::dom::Element* aElement,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& aRv) override;
|
2005-10-27 18:09:23 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual Element*
|
2012-05-28 08:52:53 +04:00
|
|
|
GetAnonymousElementByAttribute(nsIContent* aElement,
|
|
|
|
nsIAtom* aAttrName,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aAttrValue) const override;
|
2008-11-05 06:58:22 +03:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual Element* ElementFromPointHelper(float aX, float aY,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIgnoreRootScrollFrame,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aFlushLayout) override;
|
2008-11-05 06:58:22 +03:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult NodesFromRectHelper(float aX, float aY,
|
2010-04-08 04:31:26 +04:00
|
|
|
float aTopSize, float aRightSize,
|
|
|
|
float aBottomSize, float aLeftSize,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aFlushLayout,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIDOMNodeList** aReturn) override;
|
2010-04-08 04:31:26 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void FlushSkinBindings() override;
|
2008-03-21 14:44:09 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) override;
|
|
|
|
virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) override;
|
|
|
|
virtual void TryCancelFrameLoaderInitialization(nsIDocShell* aShell) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsIDocument*
|
2008-10-05 00:00:09 +04:00
|
|
|
RequestExternalResource(nsIURI* aURI,
|
|
|
|
nsINode* aRequestingNode,
|
2015-03-21 19:28:04 +03:00
|
|
|
ExternalResourceLoad** aPendingLoad) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) override;
|
2007-02-17 02:02:08 +03:00
|
|
|
|
2010-03-03 10:09:51 +03:00
|
|
|
// Returns our (lazily-initialized) animation controller.
|
|
|
|
// If HasAnimationController is true, this is guaranteed to return non-null.
|
2015-03-21 19:28:04 +03:00
|
|
|
nsSMILAnimationController* GetAnimationController() override;
|
2009-01-15 07:38:07 +03:00
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
virtual mozilla::PendingAnimationTracker*
|
|
|
|
GetPendingAnimationTracker() final override
|
2014-12-18 02:42:41 +03:00
|
|
|
{
|
2015-04-21 04:22:09 +03:00
|
|
|
return mPendingAnimationTracker;
|
2014-12-18 02:42:41 +03:00
|
|
|
}
|
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
virtual mozilla::PendingAnimationTracker*
|
|
|
|
GetOrCreatePendingAnimationTracker() override;
|
2014-12-18 02:42:41 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
void SetImagesNeedAnimating(bool aAnimating) override;
|
2010-11-06 22:13:01 +03:00
|
|
|
|
2014-02-27 03:58:21 +04:00
|
|
|
virtual void SuppressEventHandling(SuppressionType aWhat,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aIncrease) override;
|
2014-02-27 03:58:21 +04:00
|
|
|
|
|
|
|
virtual void UnsuppressEventHandlingAndFireEvents(SuppressionType aWhat,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aFireEvents) override;
|
2009-03-03 23:11:14 +03:00
|
|
|
|
2011-08-08 06:24:28 +04:00
|
|
|
void DecreaseEventSuppression() {
|
2014-02-27 03:58:21 +04:00
|
|
|
MOZ_ASSERT(mEventsSuppressed);
|
2011-08-08 06:24:28 +04:00
|
|
|
--mEventsSuppressed;
|
|
|
|
MaybeRescheduleAnimationFrameNotifications();
|
|
|
|
}
|
2009-03-03 23:11:14 +03:00
|
|
|
|
2014-02-27 03:58:21 +04:00
|
|
|
void ResumeAnimations() {
|
|
|
|
MOZ_ASSERT(mAnimationsPaused);
|
|
|
|
--mAnimationsPaused;
|
|
|
|
MaybeRescheduleAnimationFrameNotifications();
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDocument* GetTemplateContentsOwner() override;
|
2013-03-26 11:15:23 +04:00
|
|
|
|
2012-01-31 00:08:13 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
|
|
|
|
nsIDocument)
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2008-08-18 06:10:28 +04:00
|
|
|
void DoNotifyPossibleTitleChange();
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
nsExternalResourceMap& ExternalResourceMap()
|
|
|
|
{
|
|
|
|
return mExternalResourceMap;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetLoadedAsData(bool aLoadedAsData) { mLoadedAsData = aLoadedAsData; }
|
2011-11-04 00:39:08 +04:00
|
|
|
void SetLoadedAsInteractiveData(bool aLoadedAsInteractiveData)
|
|
|
|
{
|
|
|
|
mLoadedAsInteractiveData = aLoadedAsInteractiveData;
|
|
|
|
}
|
2008-09-18 15:15:47 +04:00
|
|
|
|
|
|
|
nsresult CloneDocHelper(nsDocument* clone) const;
|
|
|
|
|
2009-01-31 15:53:01 +03:00
|
|
|
void MaybeInitializeFinalizeFrameLoaders();
|
|
|
|
|
|
|
|
void MaybeEndOutermostXBLUpdate();
|
2009-07-08 09:23:20 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void PreloadPictureOpened() override;
|
|
|
|
virtual void PreloadPictureClosed() override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
|
|
|
virtual void
|
|
|
|
PreloadPictureImageSource(const nsAString& aSrcsetAttr,
|
|
|
|
const nsAString& aSizesAttr,
|
|
|
|
const nsAString& aTypeAttr,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aMediaAttr) override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
|
|
|
virtual already_AddRefed<nsIURI>
|
|
|
|
ResolvePreloadImage(nsIURI *aBaseURI,
|
|
|
|
const nsAString& aSrcAttr,
|
|
|
|
const nsAString& aSrcsetAttr,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aSizesAttr) override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
2011-07-29 22:30:00 +04:00
|
|
|
virtual void MaybePreLoadImage(nsIURI* uri,
|
2014-11-18 16:46:53 +03:00
|
|
|
const nsAString &aCrossOriginAttr,
|
2015-03-21 19:28:04 +03:00
|
|
|
ReferrerPolicy aReferrerPolicy) override;
|
|
|
|
virtual void ForgetImagePreload(nsIURI* aURI) override;
|
2009-10-30 04:48:38 +03:00
|
|
|
|
2015-06-20 00:11:42 +03:00
|
|
|
virtual void MaybePreconnect(nsIURI* uri,
|
|
|
|
mozilla::CORSMode aCORSMode) override;
|
2015-05-06 03:55:18 +03:00
|
|
|
|
2012-08-28 21:10:08 +04:00
|
|
|
virtual void PreloadStyle(nsIURI* uri, const nsAString& charset,
|
2014-11-18 16:46:47 +03:00
|
|
|
const nsAString& aCrossOriginAttr,
|
2015-08-13 06:19:11 +03:00
|
|
|
ReferrerPolicy aReferrerPolicy,
|
|
|
|
const nsAString& aIntegrity) override;
|
2010-03-03 00:00:39 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual nsresult LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::CSSStyleSheet** sheet) override;
|
2010-03-03 00:00:39 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsISupports* GetCurrentContentSink() override;
|
2009-10-30 04:48:38 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual mozilla::EventStates GetDocumentState() override;
|
2010-03-17 20:10:57 +03:00
|
|
|
|
2010-04-27 13:48:52 +04:00
|
|
|
// Only BlockOnload should call this!
|
|
|
|
void AsyncBlockOnload();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScrollToRef(nsIURI *aDocumentURI) override;
|
|
|
|
virtual void ScrollToRef() override;
|
|
|
|
virtual void ResetScrolledToRefAlready() override;
|
|
|
|
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) override;
|
2010-05-12 04:30:40 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual Element *GetElementById(const nsAString& aElementId) override;
|
2015-05-06 20:57:37 +03:00
|
|
|
virtual const nsTArray<Element*>* GetAllElementsForId(const nsAString& aElementId) const override;
|
2010-08-13 17:35:36 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual Element *LookupImageElement(const nsAString& aElementId) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
virtual void MozSetImageElement(const nsAString& aImageElementId,
|
2015-03-21 19:28:04 +03:00
|
|
|
Element* aElement) override;
|
2010-04-19 19:41:38 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult AddImage(imgIRequest* aImage) override;
|
|
|
|
virtual nsresult RemoveImage(imgIRequest* aImage, uint32_t aFlags) override;
|
|
|
|
virtual nsresult SetImageLockingState(bool aLocked) override;
|
2010-08-04 04:40:29 +04:00
|
|
|
|
2012-03-28 19:53:56 +04:00
|
|
|
// AddPlugin adds a plugin-related element to mPlugins when the element is
|
|
|
|
// added to the tree.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult AddPlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
// RemovePlugin removes a plugin-related element to mPlugins when the
|
|
|
|
// element is removed from the tree.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RemovePlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
// GetPlugins returns the plugin-related elements from
|
|
|
|
// the frame and any subframes.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetPlugins(nsTArray<nsIObjectLoadingContent*>& aPlugins) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
|
2015-05-12 01:07:49 +03:00
|
|
|
// Adds an element to mResponsiveContent when the element is
|
|
|
|
// added to the tree.
|
|
|
|
virtual nsresult AddResponsiveContent(nsIContent* aContent) override;
|
|
|
|
// Removes an element from mResponsiveContent when the element is
|
|
|
|
// removed from the tree.
|
|
|
|
virtual void RemoveResponsiveContent(nsIContent* aContent) override;
|
|
|
|
// Notifies any responsive content added by AddResponsiveContent upon media
|
|
|
|
// features values changing.
|
|
|
|
virtual void NotifyMediaFeatureValuesChanged() override;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetStateObject(nsIVariant** aResult) override;
|
2011-03-25 18:03:33 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsDOMNavigationTiming* GetNavigationTiming() const override;
|
|
|
|
virtual nsresult SetNavigationTiming(nsDOMNavigationTiming* aTiming) override;
|
2011-06-23 14:39:48 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual Element* FindImageMap(const nsAString& aNormalizedMapName) override;
|
2011-05-30 14:59:59 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual Element* GetFullScreenElement() override;
|
2015-10-07 06:04:32 +03:00
|
|
|
virtual nsTArray<Element*> GetFullscreenStack() const override;
|
2015-06-19 03:09:52 +03:00
|
|
|
virtual void AsyncRequestFullScreen(
|
|
|
|
mozilla::UniquePtr<FullscreenRequest>&& aRequest) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RestorePreviousFullScreenState() override;
|
|
|
|
virtual bool IsFullscreenLeaf() override;
|
|
|
|
virtual bool IsFullScreenDoc() override;
|
2015-05-21 00:52:26 +03:00
|
|
|
virtual nsresult
|
|
|
|
RemoteFrameFullscreenChanged(nsIDOMElement* aFrameElement) override;
|
2012-07-31 06:09:31 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult RemoteFrameFullscreenReverted() override;
|
|
|
|
virtual nsIDocument* GetFullscreenRoot() override;
|
|
|
|
virtual void SetFullscreenRoot(nsIDocument* aRoot) override;
|
2012-05-22 00:43:36 +04:00
|
|
|
|
2014-06-25 04:37:03 +04:00
|
|
|
// Returns the size of the mBlockedTrackingNodes array. (nsIDocument.h)
|
|
|
|
//
|
|
|
|
// This array contains nodes that have been blocked to prevent
|
|
|
|
// user tracking. They most likely have had their nsIChannel
|
|
|
|
// canceled by the URL classifier (Safebrowsing).
|
|
|
|
//
|
|
|
|
// A script can subsequently use GetBlockedTrackingNodes()
|
|
|
|
// to get a list of references to these nodes.
|
|
|
|
//
|
|
|
|
// Note:
|
|
|
|
// This expresses how many tracking nodes have been blocked for this
|
|
|
|
// document since its beginning, not how many of them are still around
|
|
|
|
// in the DOM tree. Weak references to blocked nodes are added in the
|
|
|
|
// mBlockedTrackingNodesArray but they are not removed when those nodes
|
|
|
|
// are removed from the tree or even garbage collected.
|
|
|
|
long BlockedTrackingNodeCount() const;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Returns strong references to mBlockedTrackingNodes. (nsIDocument.h)
|
|
|
|
//
|
|
|
|
// This array contains nodes that have been blocked to prevent
|
|
|
|
// user tracking. They most likely have had their nsIChannel
|
|
|
|
// canceled by the URL classifier (Safebrowsing).
|
|
|
|
//
|
|
|
|
already_AddRefed<nsSimpleContentList> BlockedTrackingNodes() const;
|
|
|
|
|
2015-06-10 14:13:12 +03:00
|
|
|
// Do the "fullscreen element ready check" from the fullscreen spec.
|
|
|
|
// It returns true if the given element is allowed to go into fullscreen.
|
|
|
|
bool FullscreenElementReadyCheck(Element* aElement, bool aWasCallerChrome);
|
|
|
|
|
2011-11-04 23:05:16 +04:00
|
|
|
// This is called asynchronously by nsIDocument::AsyncRequestFullScreen()
|
2015-06-10 14:13:12 +03:00
|
|
|
// to move this document into full-screen mode if allowed.
|
2015-06-19 03:09:52 +03:00
|
|
|
void RequestFullScreen(mozilla::UniquePtr<FullscreenRequest>&& aRequest);
|
2011-11-04 23:05:16 +04:00
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Removes all elements from the full-screen stack, removing full-scren
|
|
|
|
// styles from the top element in the stack.
|
2012-05-22 00:43:36 +04:00
|
|
|
void CleanupFullscreenState();
|
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Pushes aElement onto the full-screen stack, and removes full-screen styles
|
|
|
|
// from the former full-screen stack top, and its ancestors, and applies the
|
|
|
|
// styles to aElement. aElement becomes the new "full-screen element".
|
|
|
|
bool FullScreenStackPush(Element* aElement);
|
|
|
|
|
|
|
|
// Remove the top element from the full-screen stack. Removes the full-screen
|
|
|
|
// styles from the former top element, and applies them to the new top
|
|
|
|
// element, if there is one.
|
|
|
|
void FullScreenStackPop();
|
|
|
|
|
|
|
|
// Returns the top element from the full-screen stack.
|
|
|
|
Element* FullScreenStackTop();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
// DOM-exposed fullscreen API
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool MozFullScreenEnabled() override;
|
|
|
|
virtual Element* GetMozFullScreenElement(mozilla::ErrorResult& rv) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
void RequestPointerLock(Element* aElement) override;
|
2013-03-24 14:32:44 +04:00
|
|
|
bool ShouldLockPointer(Element* aElement, Element* aCurrentLock,
|
|
|
|
bool aNoFocusCheck = false);
|
2012-04-12 01:55:21 +04:00
|
|
|
bool SetPointerLock(Element* aElement, int aCursorStyle);
|
2013-03-24 14:32:44 +04:00
|
|
|
static void UnlockPointer(nsIDocument* aDoc = nullptr);
|
2012-04-12 01:55:21 +04:00
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
void SetCurrentOrientation(mozilla::dom::OrientationType aType,
|
|
|
|
uint16_t aAngle) override;
|
|
|
|
uint16_t CurrentOrientationAngle() const override;
|
|
|
|
mozilla::dom::OrientationType CurrentOrientationType() const override;
|
|
|
|
void SetOrientationPendingPromise(mozilla::dom::Promise* aPromise) override;
|
|
|
|
mozilla::dom::Promise* GetOrientationPendingPromise() const override;
|
|
|
|
|
2012-12-16 09:16:47 +04:00
|
|
|
// This method may fire a DOM event; if it does so it will happen
|
|
|
|
// synchronously.
|
|
|
|
void UpdateVisibilityState();
|
|
|
|
// Posts an event to call UpdateVisibilityState
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void PostVisibilityUpdateEvent() override;
|
2011-10-12 01:29:12 +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-01-03 06:19:14 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
2012-12-22 12:27:27 +04:00
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
virtual void EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
|
|
|
|
Element* aCustomElement,
|
|
|
|
mozilla::dom::LifecycleCallbackArgs* aArgs = nullptr,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::dom::CustomElementDefinition* aDefinition = nullptr) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
|
2015-09-18 00:49:00 +03:00
|
|
|
static void ProcessTopElementQueue();
|
2014-02-24 01:01:26 +04:00
|
|
|
|
|
|
|
void GetCustomPrototype(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAtom,
|
|
|
|
JS::MutableHandle<JSObject*> prototype)
|
2012-11-01 22:18:08 +04:00
|
|
|
{
|
2014-02-24 01:01:26 +04:00
|
|
|
if (!mRegistry) {
|
|
|
|
prototype.set(nullptr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mozilla::dom::CustomElementHashKey key(aNamespaceID, aAtom);
|
|
|
|
mozilla::dom::CustomElementDefinition* definition;
|
|
|
|
if (mRegistry->mCustomDefinitions.Get(&key, &definition)) {
|
|
|
|
prototype.set(definition->mPrototype);
|
|
|
|
} else {
|
|
|
|
prototype.set(nullptr);
|
|
|
|
}
|
2012-11-01 22:18:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool RegisterEnabled();
|
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
virtual nsresult RegisterUnresolvedElement(mozilla::dom::Element* aElement,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIAtom* aTypeName = nullptr) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
// WebIDL bits
|
|
|
|
virtual mozilla::dom::DOMImplementation*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetImplementation(mozilla::ErrorResult& rv) override;
|
2014-06-12 00:26:52 +04:00
|
|
|
virtual void
|
2014-02-24 01:01:26 +04:00
|
|
|
RegisterElement(JSContext* aCx, const nsAString& aName,
|
|
|
|
const mozilla::dom::ElementRegistrationOptions& aOptions,
|
2014-06-12 00:26:52 +04:00
|
|
|
JS::MutableHandle<JSObject*> aRetval,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& rv) override;
|
|
|
|
virtual mozilla::dom::StyleSheetList* StyleSheets() override;
|
|
|
|
virtual void SetSelectedStyleSheetSet(const nsAString& aSheetSet) override;
|
|
|
|
virtual void GetLastStyleSheetSet(nsString& aSheetSet) override;
|
|
|
|
virtual mozilla::dom::DOMStringList* StyleSheetSets() override;
|
|
|
|
virtual void EnableStyleSheetsForSet(const nsAString& aSheetSet) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
using nsIDocument::CreateElement;
|
|
|
|
using nsIDocument::CreateElementNS;
|
|
|
|
virtual already_AddRefed<Element> CreateElement(const nsAString& aTagName,
|
|
|
|
const nsAString& aTypeExtension,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& rv) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
virtual already_AddRefed<Element> CreateElementNS(const nsAString& aNamespaceURI,
|
|
|
|
const nsAString& aQualifiedName,
|
|
|
|
const nsAString& aTypeExtension,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& rv) override;
|
|
|
|
virtual void UseRegistryFromDocument(nsIDocument* aDocument) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDocument* MasterDocument() override
|
2014-05-21 21:08:12 +04:00
|
|
|
{
|
2014-10-01 16:13:53 +04:00
|
|
|
return mMasterDocument ? mMasterDocument.get()
|
|
|
|
: this;
|
2014-05-21 21:08:12 +04:00
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetMasterDocument(nsIDocument* master) override
|
2014-05-21 21:08:12 +04:00
|
|
|
{
|
2014-11-06 16:05:36 +03:00
|
|
|
MOZ_ASSERT(master);
|
2014-05-21 21:08:12 +04:00
|
|
|
mMasterDocument = master;
|
2014-11-06 16:05:36 +03:00
|
|
|
UseRegistryFromDocument(mMasterDocument);
|
2014-05-21 21:08:12 +04:00
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsMasterDocument() override
|
2014-05-21 21:08:12 +04:00
|
|
|
{
|
|
|
|
return !mMasterDocument;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual mozilla::dom::ImportManager* ImportManager() override
|
2014-05-21 21:08:12 +04:00
|
|
|
{
|
|
|
|
if (mImportManager) {
|
|
|
|
MOZ_ASSERT(!mMasterDocument, "Only the master document has ImportManager set");
|
2014-10-01 16:13:53 +04:00
|
|
|
return mImportManager.get();
|
2014-05-21 21:08:12 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mMasterDocument) {
|
|
|
|
return mMasterDocument->ImportManager();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ImportManager is created lazily.
|
|
|
|
// If the manager is not yet set it has to be the
|
|
|
|
// master document and this is the first import in it.
|
|
|
|
// Let's create a new manager.
|
|
|
|
mImportManager = new mozilla::dom::ImportManager();
|
2014-10-01 16:13:53 +04:00
|
|
|
return mImportManager.get();
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool HasSubImportLink(nsINode* aLink) override
|
2014-10-01 16:13:53 +04:00
|
|
|
{
|
|
|
|
return mSubImportLinks.Contains(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual uint32_t IndexOfSubImportLink(nsINode* aLink) override
|
2014-10-01 16:13:53 +04:00
|
|
|
{
|
|
|
|
return mSubImportLinks.IndexOf(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddSubImportLink(nsINode* aLink) override
|
2014-10-01 16:13:53 +04:00
|
|
|
{
|
|
|
|
mSubImportLinks.AppendElement(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsINode* GetSubImportLink(uint32_t aIdx) override
|
2014-10-01 16:13:53 +04:00
|
|
|
{
|
|
|
|
return aIdx < mSubImportLinks.Length() ? mSubImportLinks[aIdx].get()
|
|
|
|
: nullptr;
|
2014-05-21 21:08:12 +04:00
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void UnblockDOMContentLoaded() override;
|
2014-04-12 13:02:21 +04:00
|
|
|
|
1998-07-18 03:00:54 +04:00
|
|
|
protected:
|
2009-09-10 17:23:40 +04:00
|
|
|
friend class nsNodeUtils;
|
2013-01-24 13:09:06 +04:00
|
|
|
friend class nsDocumentOnStack;
|
|
|
|
|
|
|
|
void IncreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
++mStackRefCnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DecreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
if (--mStackRefCnt == 0 && mNeedsReleaseAfterStackRefCntRelease) {
|
|
|
|
mNeedsReleaseAfterStackRefCntRelease = false;
|
|
|
|
NS_RELEASE_THIS();
|
|
|
|
}
|
|
|
|
}
|
2008-06-23 03:12:40 +04:00
|
|
|
|
2011-11-04 23:05:16 +04:00
|
|
|
// Returns true if a request for DOM full-screen is currently enabled in
|
|
|
|
// this document. This returns true if there are no windowed plugins in this
|
|
|
|
// doc tree, and if the document is visible, and if the api is not
|
|
|
|
// disabled by pref. aIsCallerChrome must contain the return value of
|
|
|
|
// nsContentUtils::IsCallerChrome() from the context we're checking.
|
2011-11-22 01:23:48 +04:00
|
|
|
// If aLogFailure is true, an appropriate warning message is logged to the
|
|
|
|
// console, and a "mozfullscreenerror" event is dispatched to this document.
|
|
|
|
bool IsFullScreenEnabled(bool aIsCallerChrome, bool aLogFailure);
|
2011-11-04 23:05:16 +04:00
|
|
|
|
2006-10-14 23:14:24 +04:00
|
|
|
/**
|
|
|
|
* Check that aId is not empty and log a message to the console
|
|
|
|
* service if it is.
|
2011-10-17 18:59:28 +04:00
|
|
|
* @returns true if aId looks correct, false otherwise.
|
2006-10-14 23:14:24 +04:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CheckGetElementByIdArg(const nsAString& aId)
|
2010-06-22 06:59:37 +04:00
|
|
|
{
|
|
|
|
if (aId.IsEmpty()) {
|
|
|
|
ReportEmptyGetElementByIdArg();
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2010-06-22 06:59:37 +04:00
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2010-06-22 06:59:37 +04:00
|
|
|
}
|
|
|
|
|
2010-12-20 19:21:58 +03:00
|
|
|
void ReportEmptyGetElementByIdArg();
|
2006-10-14 23:14:24 +04:00
|
|
|
|
2009-01-24 02:08:41 +03:00
|
|
|
void DispatchContentLoadedEvents();
|
|
|
|
|
2004-01-29 23:52:06 +03:00
|
|
|
void RetrieveRelevantHeaders(nsIChannel *aChannel);
|
2003-04-19 20:53:44 +04:00
|
|
|
|
2013-01-18 18:27:03 +04:00
|
|
|
void TryChannelCharset(nsIChannel *aChannel,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t& aCharsetSource,
|
2012-03-24 15:34:42 +04:00
|
|
|
nsACString& aCharset,
|
|
|
|
nsHtml5TreeOpExecutor* aExecutor);
|
2009-09-25 20:50:26 +04:00
|
|
|
|
2005-08-17 05:27:10 +04:00
|
|
|
// Call this before the document does something that will unbind all content.
|
2010-06-04 05:09:20 +04:00
|
|
|
// That will stop us from doing a lot of work as each element is removed.
|
|
|
|
void DestroyElementMaps();
|
2005-08-11 00:21:44 +04:00
|
|
|
|
2009-09-25 20:50:26 +04:00
|
|
|
// Refreshes the hrefs of all the links in the document.
|
|
|
|
void RefreshLinkHrefs();
|
|
|
|
|
|
|
|
nsIContent* GetFirstBaseNodeWithHref();
|
|
|
|
nsresult SetFirstBaseNodeWithHref(nsIContent *node);
|
|
|
|
|
2015-10-13 18:14:43 +03:00
|
|
|
/**
|
|
|
|
* Returns the title element of the document as defined by the HTML
|
|
|
|
* specification, or null if there isn't one. For documents whose root
|
|
|
|
* element is an <svg:svg>, this is the first <svg:title> element that's a
|
|
|
|
* child of the root. For other documents, it's the first HTML title element
|
|
|
|
* in the document.
|
|
|
|
*/
|
|
|
|
Element* GetTitleElement();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
public:
|
|
|
|
// Get our title
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetTitle(nsString& aTitle) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
// Set our title
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv) override;
|
2008-08-18 06:10:28 +04:00
|
|
|
|
2013-03-24 14:32:44 +04:00
|
|
|
static void XPCOMShutdown();
|
2013-04-20 20:04:09 +04:00
|
|
|
|
2015-06-03 19:39:18 +03:00
|
|
|
bool mIsTopLevelContentDocument: 1;
|
|
|
|
bool mIsContentDocument: 1;
|
2013-06-28 03:52:20 +04:00
|
|
|
|
|
|
|
bool IsTopLevelContentDocument();
|
|
|
|
void SetIsTopLevelContentDocument(bool aIsTopLevelContentDocument);
|
|
|
|
|
2015-06-03 19:39:18 +03:00
|
|
|
bool IsContentDocument() const;
|
|
|
|
void SetIsContentDocument(bool aIsContentDocument);
|
|
|
|
|
2013-04-20 20:04:09 +04:00
|
|
|
js::ExpandoAndGeneration mExpandoAndGeneration;
|
|
|
|
|
2014-08-18 01:41:50 +04:00
|
|
|
#ifdef MOZ_EME
|
|
|
|
bool ContainsEMEContent();
|
|
|
|
#endif
|
|
|
|
|
2015-02-03 02:28:49 +03:00
|
|
|
bool ContainsMSEContent();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
protected:
|
2013-04-01 14:26:37 +04:00
|
|
|
already_AddRefed<nsIPresShell> doCreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
|
|
|
nsStyleSet* aStyleSet,
|
|
|
|
nsCompatibility aCompatMode);
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2013-01-09 03:25:47 +04:00
|
|
|
void RemoveDocStyleSheetsFromStyleSets();
|
2015-11-17 09:04:09 +03:00
|
|
|
void RemoveStyleSheetsFromStyleSets(
|
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aSheets,
|
|
|
|
mozilla::SheetType aType);
|
2013-05-10 11:13:37 +04:00
|
|
|
void ResetStylesheetsToURI(nsIURI* aURI);
|
2004-07-16 00:30:30 +04:00
|
|
|
void FillStyleSet(nsStyleSet* aStyleSet);
|
2004-01-22 06:35:09 +03:00
|
|
|
|
2005-07-14 20:13:09 +04:00
|
|
|
// Return whether all the presshells for this document are safe to flush
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsSafeToFlush() const;
|
2013-04-22 05:25:28 +04:00
|
|
|
|
2013-04-06 04:44:15 +04:00
|
|
|
void DispatchPageTransition(mozilla::dom::EventTarget* aDispatchTarget,
|
2009-06-24 17:33:02 +04:00
|
|
|
const nsAString& aType,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aPersisted);
|
2005-10-11 04:18:19 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsPIDOMWindow *GetWindowInternal() const override;
|
|
|
|
virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const override;
|
|
|
|
virtual bool InternalAllowXULXBL() override;
|
2010-04-16 13:05:25 +04:00
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
void UpdateScreenOrientation();
|
|
|
|
|
2010-07-21 19:33:31 +04:00
|
|
|
#define NS_DOCUMENT_NOTIFY_OBSERVERS(func_, params_) \
|
|
|
|
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, nsIDocumentObserver, \
|
|
|
|
func_, params_);
|
2013-04-22 05:25:28 +04:00
|
|
|
|
2006-03-23 11:21:21 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
void VerifyRootContentState();
|
|
|
|
#endif
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsDocument(const char* aContentType);
|
2003-03-26 10:41:30 +03:00
|
|
|
virtual ~nsDocument();
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2010-01-18 12:07:08 +03:00
|
|
|
void EnsureOnloadBlocker();
|
|
|
|
|
2013-10-28 13:09:04 +04:00
|
|
|
void NotifyStyleSheetApplicableStateChanged();
|
|
|
|
|
2015-08-06 08:37:48 +03:00
|
|
|
// Apply the fullscreen state to the document, and trigger related
|
|
|
|
// events. It returns false if the fullscreen element ready check
|
|
|
|
// fails and nothing gets changed.
|
|
|
|
bool ApplyFullscreen(const FullscreenRequest& aRequest);
|
2015-06-10 14:13:12 +03:00
|
|
|
|
2009-03-20 11:15:35 +03:00
|
|
|
nsTArray<nsIObserver*> mCharSetObservers;
|
2002-04-17 08:17:16 +04:00
|
|
|
|
2015-05-20 02:46:17 +03:00
|
|
|
PLDHashTable *mSubDocuments;
|
2002-04-17 08:17:16 +04:00
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
// Array of owning references to all children
|
2005-10-01 00:06:33 +04:00
|
|
|
nsAttrAndChildArray mChildren;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2005-04-28 20:57:24 +04:00
|
|
|
// Pointer to our parser if we're currently in the process of being
|
|
|
|
// parsed into.
|
|
|
|
nsCOMPtr<nsIParser> mParser;
|
|
|
|
|
2007-09-21 06:41:08 +04:00
|
|
|
// Weak reference to our sink for in case we no longer have a parser. This
|
|
|
|
// will allow us to flush out any pending stuff from the sink even if
|
|
|
|
// EndLoad() has already happened.
|
|
|
|
nsWeakPtr mWeakSink;
|
|
|
|
|
2015-11-17 09:04:09 +03:00
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>> mStyleSheets;
|
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>> mOnDemandBuiltInUASheets;
|
|
|
|
nsTArray<RefPtr<mozilla::CSSStyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount];
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2006-06-28 21:36:56 +04:00
|
|
|
// Array of observers
|
2007-12-20 10:30:04 +03:00
|
|
|
nsTObserverArray<nsIDocumentObserver*> mObservers;
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
// Tracker for animations that are waiting to start.
|
|
|
|
// nullptr until GetOrCreatePendingAnimationTracker is called.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::PendingAnimationTracker> mPendingAnimationTracker;
|
2014-12-18 02:42:41 +03:00
|
|
|
|
2006-04-11 07:49:44 +04:00
|
|
|
// Weak reference to the scope object (aka the script global object)
|
|
|
|
// that, unlike mScriptGlobalObject, is never unset once set. This
|
|
|
|
// is a weak reference to avoid leaks due to circular references.
|
|
|
|
nsWeakPtr mScopeObject;
|
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Stack of full-screen elements. When we request full-screen we push the
|
|
|
|
// full-screen element onto this stack, and when we cancel full-screen we
|
|
|
|
// pop one off this stack, restoring the previous full-screen state
|
|
|
|
nsTArray<nsWeakPtr> mFullScreenStack;
|
|
|
|
|
2013-02-26 09:40:53 +04:00
|
|
|
// The root of the doc tree in which this document is in. This is only
|
|
|
|
// non-null when this document is in fullscreen mode.
|
|
|
|
nsWeakPtr mFullscreenRoot;
|
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
private:
|
|
|
|
// Array representing the processing stack in the custom elements
|
|
|
|
// specification. The processing stack is conceptually a stack of
|
|
|
|
// element queues. Each queue is represented by a sequence of
|
|
|
|
// CustomElementData in this array, separated by nullptr that
|
|
|
|
// represent the boundaries of the items in the stack. The first
|
|
|
|
// queue in the stack is the base element queue.
|
2015-10-18 08:24:48 +03:00
|
|
|
static mozilla::Maybe<nsTArray<RefPtr<mozilla::dom::CustomElementData>>> sProcessingStack;
|
2014-02-24 01:01:26 +04:00
|
|
|
|
|
|
|
static bool CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp);
|
|
|
|
|
|
|
|
public:
|
2014-12-23 05:19:08 +03:00
|
|
|
// Enqueue created callback or register upgrade candidate for
|
|
|
|
// newly created custom elements, possibly extending an existing type.
|
|
|
|
// ex. <x-button>, <button is="x-button> (type extension)
|
|
|
|
virtual void SetupCustomElement(Element* aElement,
|
|
|
|
uint32_t aNamespaceID,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString* aTypeExtension) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
|
2014-07-08 06:02:03 +04:00
|
|
|
static bool IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject);
|
2014-03-19 05:20:06 +04:00
|
|
|
|
2014-02-24 01:01:26 +04:00
|
|
|
// The "registry" from the web components spec.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::Registry> mRegistry;
|
2012-11-01 22:18:08 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::EventListenerManager> mListenerManager;
|
|
|
|
RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
|
|
|
|
RefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
|
|
|
|
RefPtr<nsScriptLoader> mScriptLoader;
|
1999-01-23 10:01:40 +03:00
|
|
|
nsDocHeaderData* mHeaderData;
|
2008-06-23 03:12:40 +04:00
|
|
|
/* mIdentifierMap works as follows for IDs:
|
|
|
|
* 1) Attribute changes affect the table immediately (removing and adding
|
|
|
|
* entries as needed).
|
|
|
|
* 2) Removals from the DOM affect the table immediately
|
2009-03-23 17:04:40 +03:00
|
|
|
* 3) Additions to the DOM always update existing entries for names, and add
|
|
|
|
* new ones for IDs.
|
2008-06-23 03:12:40 +04:00
|
|
|
*/
|
|
|
|
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2007-09-27 22:17:32 +04:00
|
|
|
nsClassHashtable<nsStringHashKey, nsRadioGroupStruct> mRadioGroups;
|
2002-07-21 03:09:24 +04:00
|
|
|
|
2011-06-23 14:39:48 +04:00
|
|
|
// Recorded time of change to 'loading' state.
|
|
|
|
mozilla::TimeStamp mLoadingTimeStamp;
|
|
|
|
|
2005-05-05 00:22:32 +04:00
|
|
|
// True if the document has been detached from its content viewer.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsGoingAway:1;
|
2003-03-26 10:41:30 +03:00
|
|
|
// True if the document is being destroyed.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInDestructor:1;
|
2009-08-25 21:15:55 +04:00
|
|
|
|
2008-08-18 06:10:28 +04:00
|
|
|
// True if this document has ever had an HTML or SVG <title> element
|
|
|
|
// bound to it
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mMayHaveTitleElement:1;
|
2001-05-19 06:59:15 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mHasWarnedAboutBoxObjects:1;
|
2008-02-14 23:45:07 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mDelayFrameLoaderInitialization:1;
|
2008-04-18 12:58:06 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mSynchronousDOMContentLoaded:1;
|
2009-01-24 02:08:41 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInXBLUpdate:1;
|
2009-01-31 15:53:01 +03:00
|
|
|
|
2010-08-04 04:40:29 +04:00
|
|
|
// Whether we're currently holding a lock on all of our images.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mLockingImages:1;
|
2010-08-04 04:40:29 +04:00
|
|
|
|
2010-09-08 04:33:02 +04:00
|
|
|
// Whether we currently require our images to animate
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mAnimatingImages:1;
|
2010-09-08 04:33:02 +04:00
|
|
|
|
2011-12-15 08:42:15 +04:00
|
|
|
// Whether we're currently under a FlushPendingNotifications call to
|
|
|
|
// our presshell. This is used to handle flush reentry correctly.
|
|
|
|
bool mInFlush:1;
|
|
|
|
|
2012-03-28 09:17:53 +04:00
|
|
|
// Parser aborted. True if the parser of this document was forcibly
|
|
|
|
// terminated instead of letting it finish at its own pace.
|
|
|
|
bool mParserAborted:1;
|
|
|
|
|
2013-03-24 14:32:44 +04:00
|
|
|
friend class nsPointerLockPermissionRequest;
|
|
|
|
friend class nsCallRequestFullScreen;
|
|
|
|
// When set, trying to lock the pointer doesn't require permission from the
|
|
|
|
// user.
|
|
|
|
bool mAllowRelocking:1;
|
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
// ScreenOrientation "pending promise" as described by
|
|
|
|
// http://www.w3.org/TR/screen-orientation/
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::Promise> mOrientationPendingPromise;
|
2015-08-19 00:55:21 +03:00
|
|
|
|
|
|
|
uint16_t mCurrentOrientationAngle;
|
|
|
|
mozilla::dom::OrientationType mCurrentOrientationType;
|
|
|
|
|
2014-09-03 08:09:42 +04:00
|
|
|
// Whether we're observing the "app-theme-changed" observer service
|
|
|
|
// notification. We need to keep track of this because we might get multiple
|
|
|
|
// OnPageShow notifications in a row without an OnPageHide in between, if
|
|
|
|
// we're getting document.open()/close() called on us.
|
|
|
|
bool mObservingAppThemeChanged:1;
|
|
|
|
|
2013-10-28 13:09:04 +04:00
|
|
|
// Keeps track of whether we have a pending
|
|
|
|
// 'style-sheet-applicable-state-changed' notification.
|
|
|
|
bool mSSApplicableStateNotificationPending:1;
|
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
// The number of pointer lock requests which are cancelled by the user.
|
|
|
|
// The value is saturated to kPointerLockRequestLimit+1 = 3.
|
|
|
|
uint8_t mCancelledPointerLockRequests:2;
|
2013-03-24 14:32:44 +04:00
|
|
|
|
2015-06-03 19:39:18 +03:00
|
|
|
// Whether we have reported use counters for this document with Telemetry yet.
|
|
|
|
// Normally this is only done at document destruction time, but for image
|
|
|
|
// documents (SVG documents) that are not guaranteed to be destroyed, we
|
|
|
|
// report use counters when the image cache no longer has any imgRequestProxys
|
|
|
|
// pointing to them. We track whether we ever reported use counters so
|
|
|
|
// that we only report them once for the document.
|
|
|
|
bool mReportedUseCounters:1;
|
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
uint8_t mPendingFullscreenRequests;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mXMLDeclarationBits;
|
2003-04-19 04:28:09 +04:00
|
|
|
|
2012-03-21 22:07:31 +04:00
|
|
|
nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject> *mBoxObjectTable;
|
2001-01-25 17:19:38 +03:00
|
|
|
|
2013-03-26 11:15:23 +04:00
|
|
|
// A document "without a browsing context" that owns the content of
|
|
|
|
// HTMLTemplateElement.
|
|
|
|
nsCOMPtr<nsIDocument> mTemplateContentsOwner;
|
|
|
|
|
2007-10-26 14:30:44 +04:00
|
|
|
// Our update nesting level
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mUpdateNestLevel;
|
2007-10-26 14:30:44 +04:00
|
|
|
|
2008-08-27 03:09:02 +04:00
|
|
|
// The application cache that this document is associated with, if
|
|
|
|
// any. This can change during the lifetime of the document.
|
|
|
|
nsCOMPtr<nsIApplicationCache> mApplicationCache;
|
|
|
|
|
2009-09-25 20:50:26 +04:00
|
|
|
nsCOMPtr<nsIContent> mFirstBaseNodeWithHref;
|
|
|
|
|
2014-04-03 08:18:36 +04:00
|
|
|
mozilla::EventStates mDocumentState;
|
|
|
|
mozilla::EventStates mGotDocumentState;
|
2010-03-17 20:10:57 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsDOMNavigationTiming> mTiming;
|
2008-02-21 23:39:20 +03:00
|
|
|
private:
|
2006-05-10 21:30:15 +04:00
|
|
|
friend class nsUnblockOnloadEvent;
|
2011-10-12 01:29:12 +04:00
|
|
|
// Recomputes the visibility state but doesn't set the new value.
|
2012-12-26 02:00:15 +04:00
|
|
|
mozilla::dom::VisibilityState GetVisibilityState() const;
|
2015-11-17 09:04:09 +03:00
|
|
|
void NotifyStyleSheetAdded(mozilla::CSSStyleSheet* aSheet, bool aDocumentSheet);
|
|
|
|
void NotifyStyleSheetRemoved(mozilla::CSSStyleSheet* aSheet, bool aDocumentSheet);
|
2006-05-10 21:30:15 +04:00
|
|
|
|
2005-08-23 05:29:02 +04:00
|
|
|
void PostUnblockOnloadEvent();
|
2005-08-23 22:54:35 +04:00
|
|
|
void DoUnblockOnload();
|
2005-08-23 05:29:02 +04:00
|
|
|
|
2010-07-21 19:51:09 +04:00
|
|
|
nsresult CheckFrameOptions();
|
2014-10-07 00:25:04 +04:00
|
|
|
bool IsLoopDocument(nsIChannel* aChannel);
|
2012-09-26 03:28:17 +04:00
|
|
|
nsresult InitCSP(nsIChannel* aChannel);
|
2010-01-23 00:38:21 +03:00
|
|
|
|
2013-12-18 11:22:20 +04:00
|
|
|
/**
|
|
|
|
* Find the (non-anonymous) content in this document for aFrame. It will
|
|
|
|
* be aFrame's content node if that content is in this document and not
|
|
|
|
* anonymous. Otherwise, when aFrame is in a subdocument, we use the frame
|
|
|
|
* element containing the subdocument containing aFrame, and/or find the
|
|
|
|
* nearest non-anonymous ancestor in this document.
|
|
|
|
* Returns null if there is no such element.
|
|
|
|
*/
|
|
|
|
nsIContent* GetContentInThisDocument(nsIFrame* aFrame) const;
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
// Just like EnableStyleSheetsForSet, but doesn't check whether
|
|
|
|
// aSheetSet is null and allows the caller to control whether to set
|
|
|
|
// aSheetSet as the preferred set in the CSSLoader.
|
|
|
|
void EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUpdateCSSLoader);
|
2007-01-11 22:32:31 +03:00
|
|
|
|
2015-07-14 22:28:57 +03:00
|
|
|
// Revoke any pending notifications due to requestAnimationFrame calls
|
2011-03-26 04:05:56 +03:00
|
|
|
void RevokeAnimationFrameNotifications();
|
2011-08-08 06:24:28 +04:00
|
|
|
// Reschedule any notifications we need to handle
|
2015-07-14 22:28:57 +03:00
|
|
|
// requestAnimationFrame, if it's OK to do so.
|
2011-08-08 06:24:28 +04:00
|
|
|
void MaybeRescheduleAnimationFrameNotifications();
|
2011-03-26 04:05:56 +03:00
|
|
|
|
2015-11-10 01:16:02 +03:00
|
|
|
void ClearAllBoxObjects();
|
|
|
|
|
2015-09-01 21:04:58 +03:00
|
|
|
// Returns true if the scheme for the url for this document is "about"
|
|
|
|
bool IsAboutPage();
|
|
|
|
|
2001-01-25 17:19:38 +03:00
|
|
|
// These are not implemented and not supported.
|
|
|
|
nsDocument(const nsDocument& aOther);
|
|
|
|
nsDocument& operator=(const nsDocument& aOther);
|
2002-04-16 15:57:17 +04:00
|
|
|
|
2005-05-13 00:53:33 +04:00
|
|
|
// The layout history state that should be used by nodes in this
|
|
|
|
// document. We only actually store a pointer to it when:
|
|
|
|
// 1) We have no script global object.
|
|
|
|
// 2) We haven't had Destroy() called on us yet.
|
|
|
|
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
|
2005-05-13 23:54:28 +04:00
|
|
|
|
2010-04-27 13:48:52 +04:00
|
|
|
// Currently active onload blockers
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mOnloadBlockCount;
|
2010-04-27 13:48:52 +04:00
|
|
|
// Onload blockers which haven't been activated yet
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mAsyncOnloadBlockCount;
|
2005-05-13 23:54:28 +04:00
|
|
|
nsCOMPtr<nsIRequest> mOnloadBlocker;
|
2010-02-24 19:37:02 +03:00
|
|
|
|
2010-02-24 19:37:03 +03:00
|
|
|
// A hashtable of styled links keyed by address pointer.
|
|
|
|
nsTHashtable<nsPtrHashKey<mozilla::dom::Link> > mStyledLinks;
|
|
|
|
#ifdef DEBUG
|
|
|
|
// Indicates whether mStyledLinks was cleared or not. This is used to track
|
|
|
|
// state so we can provide useful assertions to consumers of ForgetLink and
|
|
|
|
// AddStyleRelevantLink.
|
|
|
|
bool mStyledLinksCleared;
|
|
|
|
#endif
|
2007-01-11 22:32:31 +03:00
|
|
|
|
2015-05-12 01:07:49 +03:00
|
|
|
// A set of responsive images keyed by address pointer.
|
|
|
|
nsTHashtable< nsPtrHashKey<nsIContent> > mResponsiveContent;
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
// Member to store out last-selected stylesheet set.
|
|
|
|
nsString mLastStyleSheetSet;
|
2008-02-26 17:47:51 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<nsFrameLoader> > mInitializableFrameLoaders;
|
2015-02-27 08:35:26 +03:00
|
|
|
nsTArray<nsCOMPtr<nsIRunnable> > mFrameLoaderFinalizers;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsRunnableMethod<nsDocument> > mFrameLoaderRunner;
|
2001-04-12 05:05:42 +04:00
|
|
|
|
2010-04-20 21:22:04 +04:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<nsDocument, void, false> >
|
2009-05-07 00:46:01 +04:00
|
|
|
mPendingTitleChangeEvent;
|
2008-10-05 00:00:09 +04:00
|
|
|
|
|
|
|
nsExternalResourceMap mExternalResourceMap;
|
2009-01-15 07:38:07 +03:00
|
|
|
|
2014-11-24 19:57:49 +03:00
|
|
|
// All images in process of being preloaded. This is a hashtable so
|
|
|
|
// we can remove them as the real image loads start; that way we
|
|
|
|
// make sure to not keep the image load going when no one cares
|
|
|
|
// about it anymore.
|
|
|
|
nsRefPtrHashtable<nsURIHashKey, imgIRequest> mPreloadingImages;
|
2009-07-08 09:23:20 +04:00
|
|
|
|
2015-05-06 03:55:18 +03:00
|
|
|
// A list of preconnects initiated by the preloader. This prevents
|
|
|
|
// the same uri from being used more than once, and allows the dom
|
|
|
|
// builder to not repeat the work of the preloader.
|
|
|
|
nsDataHashtable< nsURIHashKey, bool> mPreloadedPreconnects;
|
|
|
|
|
2014-12-11 02:54:00 +03:00
|
|
|
// Current depth of picture elements from parser
|
|
|
|
int32_t mPreloadPictureDepth;
|
|
|
|
|
|
|
|
// Set if we've found a URL for the current picture
|
|
|
|
nsString mPreloadPictureFoundSource;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
|
2009-10-18 20:39:52 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsContentList> mImageMaps;
|
2011-05-30 14:59:59 +04:00
|
|
|
|
2010-05-12 04:30:40 +04:00
|
|
|
nsCString mScrollToRef;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mScrolledToRefAlready : 1;
|
|
|
|
uint8_t mChangeScrollPosWhenScrollingToRef : 1;
|
2010-05-12 04:30:40 +04:00
|
|
|
|
2010-08-04 04:40:29 +04:00
|
|
|
// Tracking for images in the document.
|
2012-08-22 19:56:38 +04:00
|
|
|
nsDataHashtable< nsPtrHashKey<imgIRequest>, uint32_t> mImageTracker;
|
2010-08-04 04:40:29 +04:00
|
|
|
|
2012-03-28 19:53:56 +04:00
|
|
|
// Tracking for plugins in the document.
|
|
|
|
nsTHashtable< nsPtrHashKey<nsIObjectLoadingContent> > mPlugins;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::UndoManager> mUndoManager;
|
2013-01-04 10:54:26 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::DocumentTimeline> mDocumentTimeline;
|
2014-05-13 11:22:12 +04:00
|
|
|
|
2013-01-04 07:27:06 +04:00
|
|
|
enum ViewportType {
|
|
|
|
DisplayWidthHeight,
|
|
|
|
Specified,
|
|
|
|
Unknown
|
|
|
|
};
|
|
|
|
|
|
|
|
ViewportType mViewportType;
|
|
|
|
|
|
|
|
// These member variables cache information about the viewport so we don't have to
|
|
|
|
// recalculate it each time.
|
|
|
|
bool mValidWidth, mValidHeight;
|
2013-09-03 23:12:23 +04:00
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMinFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMaxFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleFloat;
|
|
|
|
mozilla::CSSToLayoutDeviceScale mPixelRatio;
|
2014-02-25 04:22:45 +04:00
|
|
|
bool mAutoSize, mAllowZoom, mAllowDoubleTapZoom, mValidScaleFloat, mValidMaxScale, mScaleStrEmpty, mWidthStrEmpty;
|
2014-05-29 00:27:38 +04:00
|
|
|
mozilla::CSSSize mViewportSize;
|
2013-01-04 07:27:06 +04:00
|
|
|
|
2013-01-24 13:09:06 +04:00
|
|
|
nsrefcnt mStackRefCnt;
|
|
|
|
bool mNeedsReleaseAfterStackRefCntRelease;
|
|
|
|
|
2014-05-21 21:08:12 +04:00
|
|
|
nsCOMPtr<nsIDocument> mMasterDocument;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::ImportManager> mImportManager;
|
2014-10-01 16:13:53 +04:00
|
|
|
nsTArray<nsCOMPtr<nsINode> > mSubImportLinks;
|
2014-05-21 21:08:12 +04:00
|
|
|
|
2014-07-21 10:25:44 +04:00
|
|
|
// Set to true when the document is possibly controlled by the ServiceWorker.
|
|
|
|
// Used to prevent multiple requests to ServiceWorkerManager.
|
|
|
|
bool mMaybeServiceWorkerControlled;
|
|
|
|
|
2009-07-25 15:27:42 +04:00
|
|
|
#ifdef DEBUG
|
2014-06-26 04:33:24 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mWillReparent;
|
2009-07-25 15:27:42 +04:00
|
|
|
#endif
|
2008-08-18 06:10:28 +04:00
|
|
|
};
|
2008-08-16 15:27:40 +04:00
|
|
|
|
2013-01-24 13:09:06 +04:00
|
|
|
class nsDocumentOnStack
|
|
|
|
{
|
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsDocumentOnStack(nsDocument* aDoc) : mDoc(aDoc)
|
2013-01-24 13:09:06 +04:00
|
|
|
{
|
|
|
|
mDoc->IncreaseStackRefCnt();
|
|
|
|
}
|
|
|
|
~nsDocumentOnStack()
|
|
|
|
{
|
|
|
|
mDoc->DecreaseStackRefCnt();
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
nsDocument* mDoc;
|
|
|
|
};
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsDocument_h___ */
|