2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2014-02-23 21:01:26 +00:00
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-03-30 08:03:04 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Base class for all our document implementations.
|
|
|
|
*/
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsDocument_h___
|
|
|
|
#define nsDocument_h___
|
|
|
|
|
2013-08-22 06:30:44 +00:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCRT.h"
|
1999-08-25 10:51:55 +00:00
|
|
|
#include "nsWeakReference.h"
|
1999-09-21 06:44:56 +00:00
|
|
|
#include "nsWeakPtr.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
#include "nsVoidArray.h"
|
2009-03-20 08:15:35 +00:00
|
|
|
#include "nsTArray.h"
|
2001-10-26 02:23:56 +00:00
|
|
|
#include "nsIDOMXMLDocument.h"
|
2000-06-02 08:13:29 +00:00
|
|
|
#include "nsIDOMDocumentXBL.h"
|
2004-01-28 21:04:33 +00:00
|
|
|
#include "nsStubDocumentObserver.h"
|
1999-12-03 09:24:22 +00:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
1998-08-28 15:57:59 +00:00
|
|
|
#include "nsIContent.h"
|
1999-08-29 21:58:42 +00:00
|
|
|
#include "nsIPrincipal.h"
|
2005-04-28 16:57:24 +00:00
|
|
|
#include "nsIParser.h"
|
2007-02-16 23:02:08 +00:00
|
|
|
#include "nsBindingManager.h"
|
2006-04-26 12:42:49 +00:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2013-06-18 10:00:38 +00: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 16:46:42 +00:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2001-04-30 23:35:09 +00:00
|
|
|
#include "nsIURI.h"
|
2001-05-17 05:54:16 +00:00
|
|
|
#include "nsScriptLoader.h"
|
2002-07-20 23:09:24 +00:00
|
|
|
#include "nsIRadioGroupContainer.h"
|
2005-05-12 20:53:33 +00:00
|
|
|
#include "nsILayoutHistoryState.h"
|
2005-05-13 19:54:28 +00:00
|
|
|
#include "nsIRequest.h"
|
|
|
|
#include "nsILoadGroup.h"
|
2006-06-28 17:36:56 +00:00
|
|
|
#include "nsTObserverArray.h"
|
2006-07-02 07:23:10 +00:00
|
|
|
#include "nsStubMutationObserver.h"
|
2006-10-24 21:47:40 +00:00
|
|
|
#include "nsIChannel.h"
|
2007-01-04 22:31:26 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2008-06-22 23:12:40 +00:00
|
|
|
#include "nsContentList.h"
|
2008-08-18 02:10:28 +00:00
|
|
|
#include "nsGkAtoms.h"
|
2008-08-26 23:09:02 +00:00
|
|
|
#include "nsIApplicationCache.h"
|
|
|
|
#include "nsIApplicationCacheContainer.h"
|
2004-05-05 00:30:57 +00:00
|
|
|
#include "nsStyleSet.h"
|
2002-04-17 04:17:16 +00:00
|
|
|
#include "pldhash.h"
|
2005-09-30 20:06:33 +00:00
|
|
|
#include "nsAttrAndChildArray.h"
|
2006-07-29 16:02:11 +00:00
|
|
|
#include "nsDOMAttributeMap.h"
|
2011-10-15 07:33:26 +00:00
|
|
|
#include "nsIContentViewer.h"
|
2008-10-04 20:00:09 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2008-11-24 18:32:04 +00:00
|
|
|
#include "nsILoadContext.h"
|
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsISecurityEventSink.h"
|
|
|
|
#include "nsIChannelEventSink.h"
|
2009-07-08 05:23:20 +00:00
|
|
|
#include "imgIRequest.h"
|
2014-03-17 06:56:53 +00:00
|
|
|
#include "mozilla/EventListenerManager.h"
|
2014-04-03 04:18:36 +00:00
|
|
|
#include "mozilla/EventStates.h"
|
2013-06-23 12:03:39 +00:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2014-12-17 23:42:41 +00:00
|
|
|
#include "mozilla/PendingPlayerTracker.h"
|
2012-12-22 08:27:27 +00:00
|
|
|
#include "mozilla/dom/DOMImplementation.h"
|
2014-04-12 08:15:59 +00:00
|
|
|
#include "mozilla/dom/StyleSheetList.h"
|
2011-08-11 13:29:50 +00:00
|
|
|
#include "nsDataHashtable.h"
|
2011-09-15 23:47:29 +00:00
|
|
|
#include "mozilla/TimeStamp.h"
|
2012-06-19 02:30:09 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-07-04 15:39:24 +00:00
|
|
|
#include "nsIDOMXPathEvaluator.h"
|
2013-10-24 18:53:52 +00:00
|
|
|
#include "jsfriendapi.h"
|
2014-05-21 17:08:12 +00:00
|
|
|
#include "ImportManager.h"
|
2011-06-23 10:39:48 +00:00
|
|
|
|
2003-04-19 00:28:09 +00: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 19:32:31 +00:00
|
|
|
class nsDOMStyleSheetSetList;
|
1999-05-07 04:59:23 +00:00
|
|
|
class nsIOutputStream;
|
1999-03-31 20:49:25 +00:00
|
|
|
class nsDocument;
|
2000-08-28 23:46:11 +00:00
|
|
|
class nsIDTD;
|
2002-07-20 23:09:24 +00:00
|
|
|
class nsIRadioVisitor;
|
|
|
|
class nsIFormControl;
|
|
|
|
struct nsRadioGroupStruct;
|
2005-05-13 19:54:28 +00:00
|
|
|
class nsOnloadBlocker;
|
2006-05-10 17:30:15 +00:00
|
|
|
class nsUnblockOnloadEvent;
|
2006-05-19 10:01:22 +00:00
|
|
|
class nsChildContentList;
|
2010-04-19 15:41:39 +00:00
|
|
|
class nsHTMLStyleSheet;
|
|
|
|
class nsHTMLCSSStyleSheet;
|
2011-06-23 10:39:48 +00:00
|
|
|
class nsDOMNavigationTiming;
|
2012-02-01 21:58:01 +00:00
|
|
|
class nsWindowSizes;
|
2012-03-24 11:34:42 +00:00
|
|
|
class nsHtml5TreeOpExecutor;
|
2013-01-24 09:09:06 +00:00
|
|
|
class nsDocumentOnStack;
|
2013-03-24 10:32:44 +00:00
|
|
|
class nsPointerLockPermissionRequest;
|
2013-07-26 15:37:03 +00:00
|
|
|
class nsISecurityConsoleMessage;
|
2014-10-14 20:15:21 +00:00
|
|
|
class nsPIBoxObject;
|
2005-08-10 20:21:44 +00:00
|
|
|
|
2013-01-04 06:54:26 +00:00
|
|
|
namespace mozilla {
|
2014-03-18 04:48:19 +00:00
|
|
|
class EventChainPreVisitor;
|
2013-01-04 06:54:26 +00:00
|
|
|
namespace dom {
|
2014-10-14 20:15:21 +00:00
|
|
|
class BoxObject;
|
2013-01-04 06:54:26 +00:00
|
|
|
class UndoManager;
|
2014-06-19 00:57:51 +00:00
|
|
|
struct LifecycleCallbacks;
|
2014-02-23 21:01:26 +00:00
|
|
|
class CallbackFunction;
|
2013-01-04 06:54:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-22 23:12:40 +00: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 02:59:37 +00:00
|
|
|
class nsIdentifierMapEntry : public nsStringHashKey
|
2008-06-22 23:12:40 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-05-14 17:04:51 +00:00
|
|
|
typedef mozilla::dom::Element Element;
|
2014-11-18 13:46:29 +00:00
|
|
|
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
2014-09-02 00:49:25 +00:00
|
|
|
|
|
|
|
explicit nsIdentifierMapEntry(const nsAString& aKey) :
|
2012-07-30 14:20:58 +00:00
|
|
|
nsStringHashKey(&aKey), mNameContentList(nullptr)
|
2010-06-22 02:59:37 +00:00
|
|
|
{
|
|
|
|
}
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsIdentifierMapEntry(const nsAString* aKey) :
|
2012-07-30 14:20:58 +00:00
|
|
|
nsStringHashKey(aKey), mNameContentList(nullptr)
|
2008-06-22 23:12:40 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) :
|
2010-06-22 02:59:37 +00:00
|
|
|
nsStringHashKey(&aOther.GetKey())
|
2008-06-22 23:12:40 +00:00
|
|
|
{
|
|
|
|
NS_ERROR("Should never be called");
|
|
|
|
}
|
|
|
|
~nsIdentifierMapEntry();
|
|
|
|
|
2013-12-02 10:26:11 +00:00
|
|
|
void AddNameElement(nsINode* aDocument, Element* aElement);
|
2010-05-14 17:04:51 +00:00
|
|
|
void RemoveNameElement(Element* aElement);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsEmpty();
|
2008-06-22 23:12:40 +00:00
|
|
|
nsBaseContentList* GetNameContentList() {
|
|
|
|
return mNameContentList;
|
|
|
|
}
|
2013-03-27 17:15:37 +00:00
|
|
|
bool HasNameElement() const {
|
2013-04-29 13:18:02 +00:00
|
|
|
return mNameContentList && mNameContentList->Length() != 0;
|
2013-03-27 17:15:37 +00:00
|
|
|
}
|
2008-06-22 23:12:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the element if we know the element associated with this
|
|
|
|
* id. Otherwise returns null.
|
|
|
|
*/
|
2010-05-14 17:04:51 +00:00
|
|
|
Element* GetIdElement();
|
2011-11-01 02:50:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the list of all elements associated with this id.
|
|
|
|
*/
|
|
|
|
const nsSmallVoidArray* GetIdElements() const {
|
|
|
|
return &mIdContentList;
|
|
|
|
}
|
2010-08-13 13:35:36 +00: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 14:04:40 +00:00
|
|
|
/**
|
|
|
|
* Append all the elements with this id to aElements
|
|
|
|
*/
|
2008-06-23 01:48:05 +00:00
|
|
|
void AppendAllIdContent(nsCOMArray<nsIContent>* aElements);
|
2008-06-25 01:55:01 +00: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 06:19:26 +00:00
|
|
|
bool AddIdElement(Element* aElement);
|
2008-06-23 01:48:05 +00:00
|
|
|
/**
|
2008-06-25 01:55:01 +00:00
|
|
|
* This can fire ID change callbacks.
|
2008-06-23 01:48:05 +00:00
|
|
|
*/
|
2010-08-13 13:35:36 +00:00
|
|
|
void RemoveIdElement(Element* aElement);
|
|
|
|
/**
|
|
|
|
* Set the image element override for this ID. This will be returned by
|
2011-10-17 14:59:28 +00:00
|
|
|
* GetIdElement(true) if non-null.
|
2010-08-13 13:35:36 +00:00
|
|
|
*/
|
|
|
|
void SetImageElement(Element* aElement);
|
2013-04-20 16:04:09 +00:00
|
|
|
bool HasIdElementExposedAsHTMLDocumentProperty();
|
2008-06-22 23:12:40 +00:00
|
|
|
|
2012-07-30 14:20:58 +00:00
|
|
|
bool HasContentChangeCallback() { return mChangeCallbacks != nullptr; }
|
2010-08-13 13:35:36 +00:00
|
|
|
void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
2011-09-29 06:19:26 +00:00
|
|
|
void* aData, bool aForImage);
|
2010-08-13 13:35:36 +00:00
|
|
|
void RemoveContentChangeCallback(nsIDocument::IDTargetObserver aCallback,
|
2011-09-29 06:19:26 +00:00
|
|
|
void* aData, bool aForImage);
|
2008-06-25 01:55:01 +00:00
|
|
|
|
2008-06-22 23:12:40 +00:00
|
|
|
void Traverse(nsCycleCollectionTraversalCallback* aCallback);
|
|
|
|
|
2008-06-25 01:55:01 +00:00
|
|
|
struct ChangeCallback {
|
|
|
|
nsIDocument::IDTargetObserver mCallback;
|
|
|
|
void* mData;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mForImage;
|
2008-06-25 01:55:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ChangeCallbackEntry : public PLDHashEntryHdr {
|
|
|
|
typedef const ChangeCallback KeyType;
|
|
|
|
typedef const ChangeCallback* KeyTypePointer;
|
|
|
|
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit ChangeCallbackEntry(const ChangeCallback* aKey) :
|
|
|
|
mKey(*aKey) { }
|
2008-06-25 01:55:01 +00:00
|
|
|
ChangeCallbackEntry(const ChangeCallbackEntry& toCopy) :
|
|
|
|
mKey(toCopy.mKey) { }
|
|
|
|
|
|
|
|
KeyType GetKey() const { return mKey; }
|
2011-09-29 06:19:26 +00:00
|
|
|
bool KeyEquals(KeyTypePointer aKey) const {
|
2008-06-25 01:55:01 +00:00
|
|
|
return aKey->mCallback == mKey.mCallback &&
|
2010-08-13 13:35:36 +00:00
|
|
|
aKey->mData == mKey.mData &&
|
|
|
|
aKey->mForImage == mKey.mForImage;
|
2008-06-25 01:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static KeyTypePointer KeyToPointer(KeyType& aKey) { return &aKey; }
|
|
|
|
static PLDHashNumber HashKey(KeyTypePointer aKey)
|
|
|
|
{
|
2012-03-12 22:53:18 +00:00
|
|
|
return mozilla::HashGeneric(aKey->mCallback, aKey->mData);
|
2008-06-25 01:55:01 +00:00
|
|
|
}
|
2011-10-17 14:59:28 +00:00
|
|
|
enum { ALLOW_MEMMOVE = true };
|
2014-08-05 20:27:41 +00:00
|
|
|
|
2008-06-25 01:55:01 +00:00
|
|
|
ChangeCallback mKey;
|
|
|
|
};
|
|
|
|
|
2014-08-05 20:27:41 +00:00
|
|
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
2012-06-18 16:39:29 +00:00
|
|
|
|
2008-06-22 23:12:40 +00:00
|
|
|
private:
|
2010-08-13 13:35:36 +00:00
|
|
|
void FireChangeCallbacks(Element* aOldElement, Element* aNewElement,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aImageOnly = false);
|
2008-06-25 01:55:01 +00:00
|
|
|
|
2011-11-01 02:50:50 +00:00
|
|
|
// empty if there are no elements with this ID.
|
2010-09-01 22:48:24 +00:00
|
|
|
// The elements are stored as weak pointers.
|
2008-06-22 23:12:40 +00:00
|
|
|
nsSmallVoidArray mIdContentList;
|
2011-04-23 07:29:12 +00:00
|
|
|
nsRefPtr<nsBaseContentList> mNameContentList;
|
2008-06-25 01:55:01 +00:00
|
|
|
nsAutoPtr<nsTHashtable<ChangeCallbackEntry> > mChangeCallbacks;
|
2010-09-03 22:40:10 +00:00
|
|
|
nsRefPtr<Element> mImageElement;
|
2008-06-22 23:12:40 +00:00
|
|
|
};
|
1998-05-27 17:51:41 +00:00
|
|
|
|
2014-02-23 21:01:26 +00: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 00:49:25 +00:00
|
|
|
explicit CustomElementHashKey(const CustomElementHashKey* aKey)
|
2014-02-23 21:01:26 +00: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 18:55:44 +00:00
|
|
|
MOZ_ASSERT(mNamespaceID != kNameSpaceID_Unknown,
|
2014-02-23 21:01:26 +00:00
|
|
|
"This equals method is not transitive, nor symmetric. "
|
2014-03-27 18:55:44 +00:00
|
|
|
"A key with a namespace of kNamespaceID_Unknown should "
|
2014-02-23 21:01:26 +00:00
|
|
|
"not be stored in a hashtable.");
|
2014-03-27 18:55:44 +00:00
|
|
|
return (kNameSpaceID_Unknown == aKey->mNamespaceID ||
|
2014-02-23 21:01:26 +00: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.
|
|
|
|
nsRefPtr<mozilla::dom::Element> mThisObject;
|
|
|
|
nsRefPtr<mozilla::dom::CallbackFunction> mCallback;
|
2014-03-01 01:45:31 +00:00
|
|
|
// The type of callback (eCreated, eAttached, etc.)
|
2014-02-23 21:01:26 +00: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 18:53:36 +00:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(CustomElementData)
|
|
|
|
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit CustomElementData(nsIAtom* aType);
|
2014-02-23 21:01:26 +00: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 18:53:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual ~CustomElementData() {}
|
2014-02-23 21:01:26 +00: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 18:55:44 +00: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 02:09:15 +00:00
|
|
|
virtual ~Registry();
|
|
|
|
|
2014-03-27 18:55:44 +00:00
|
|
|
typedef nsClassHashtable<mozilla::dom::CustomElementHashKey,
|
|
|
|
mozilla::dom::CustomElementDefinition>
|
|
|
|
DefinitionMap;
|
|
|
|
typedef nsClassHashtable<mozilla::dom::CustomElementHashKey,
|
|
|
|
nsTArray<nsRefPtr<mozilla::dom::Element>>>
|
|
|
|
CandidateMap;
|
|
|
|
|
|
|
|
// Hashtable for custom element definitions in web components.
|
2015-03-02 17:48:30 +00:00
|
|
|
// Custom prototypes are stored in the compartment where
|
|
|
|
// registerElement was called.
|
2014-03-27 18:55:44 +00: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-23 21:01:26 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1999-01-23 07:01:40 +00:00
|
|
|
class nsDocHeaderData
|
|
|
|
{
|
|
|
|
public:
|
2002-03-23 23:54:46 +00:00
|
|
|
nsDocHeaderData(nsIAtom* aField, const nsAString& aData)
|
2012-07-30 14:20:58 +00:00
|
|
|
: mField(aField), mData(aData), mNext(nullptr)
|
1999-01-23 07:01:40 +00:00
|
|
|
{
|
|
|
|
}
|
2003-03-26 07:41:30 +00:00
|
|
|
|
1999-01-23 07:01:40 +00:00
|
|
|
~nsDocHeaderData(void)
|
|
|
|
{
|
2003-03-26 07:41:30 +00:00
|
|
|
delete mNext;
|
1999-01-23 07:01:40 +00:00
|
|
|
}
|
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
nsCOMPtr<nsIAtom> mField;
|
|
|
|
nsString mData;
|
|
|
|
nsDocHeaderData* mNext;
|
1999-01-23 07:01:40 +00:00
|
|
|
};
|
1998-07-01 11:16:09 +00:00
|
|
|
|
2014-04-12 08:15:59 +00:00
|
|
|
class nsDOMStyleSheetList : public mozilla::dom::StyleSheetList,
|
2004-01-28 21:04:33 +00:00
|
|
|
public nsStubDocumentObserver
|
2001-04-12 01:05:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsDOMStyleSheetList(nsIDocument* aDocument);
|
2001-04-12 01:05:42 +00:00
|
|
|
|
2014-04-12 08:18:54 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2004-01-28 21:04:33 +00:00
|
|
|
// nsIDocumentObserver
|
2010-10-20 07:41:05 +00:00
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED
|
|
|
|
|
|
|
|
// nsIMutationObserver
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
2001-04-12 01:05:42 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsINode* GetParentObject() const override
|
2014-04-12 08:18:54 +00:00
|
|
|
{
|
|
|
|
return mDocument;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual uint32_t Length() override;
|
2014-06-20 10:32:49 +00:00
|
|
|
virtual mozilla::CSSStyleSheet*
|
2015-03-21 16:28:04 +00:00
|
|
|
IndexedGetter(uint32_t aIndex, bool& aFound) override;
|
2008-10-22 14:31:14 +00:00
|
|
|
|
2001-04-12 01:05:42 +00:00
|
|
|
protected:
|
2014-07-08 21:23:16 +00:00
|
|
|
virtual ~nsDOMStyleSheetList();
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mLength;
|
2001-04-12 01:05:42 +00:00
|
|
|
nsIDocument* mDocument;
|
|
|
|
};
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsOnloadBlocker final : public nsIRequest
|
2005-05-13 19:54:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsOnloadBlocker() {}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
|
|
|
|
private:
|
|
|
|
~nsOnloadBlocker() {}
|
|
|
|
};
|
2002-04-17 04:17:16 +00:00
|
|
|
|
2008-10-04 20:00:09 +00: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 14:59:28 +00:00
|
|
|
mHaveShutDown = true;
|
2008-10-04 20:00:09 +00:00
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool HaveShutDown() const
|
2008-10-04 20:00:09 +00: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-11 21:05:26 +00:00
|
|
|
// Hide all our viewers
|
|
|
|
void HideViewers();
|
|
|
|
|
|
|
|
// Show all our viewers
|
|
|
|
void ShowViewers();
|
|
|
|
|
2008-10-04 20:00:09 +00:00
|
|
|
protected:
|
|
|
|
class PendingLoad : public ExternalResourceLoad,
|
|
|
|
public nsIStreamListener
|
|
|
|
{
|
2014-06-25 02:09:15 +00:00
|
|
|
~PendingLoad() {}
|
|
|
|
|
2008-10-04 20:00:09 +00:00
|
|
|
public:
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit PendingLoad(nsDocument* aDisplayDocument) :
|
2008-10-04 20:00:09 +00: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 07:33:26 +00:00
|
|
|
* Set up an nsIContentViewer based on aRequest. This is guaranteed to
|
2008-10-04 20:00:09 +00:00
|
|
|
* put null in *aViewer and *aLoadGroup on all failures.
|
|
|
|
*/
|
2011-10-15 07:33:26 +00:00
|
|
|
nsresult SetupViewer(nsIRequest* aRequest, nsIContentViewer** aViewer,
|
2008-10-04 20:00:09 +00:00
|
|
|
nsILoadGroup** aLoadGroup);
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsRefPtr<nsDocument> mDisplayDocument;
|
|
|
|
nsCOMPtr<nsIStreamListener> mTargetListener;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
|
|
|
};
|
|
|
|
friend class PendingLoad;
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class LoadgroupCallbacks final : public nsIInterfaceRequestor
|
2008-10-04 20:00:09 +00:00
|
|
|
{
|
2014-06-25 02:09:15 +00:00
|
|
|
~LoadgroupCallbacks() {}
|
2008-10-04 20:00:09 +00:00
|
|
|
public:
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
|
2008-10-04 20:00:09 +00:00
|
|
|
: mCallbacks(aOtherCallbacks)
|
|
|
|
{}
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
private:
|
2008-11-24 18:32:04 +00: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-04 20:00:09 +00:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2008-11-24 18:32:04 +00: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 18:52:19 +00:00
|
|
|
class _i##Shim final : public nsIInterfaceRequestor, \
|
|
|
|
public _i \
|
2008-11-24 18:32:04 +00:00
|
|
|
{ \
|
2014-06-25 02:09:15 +00:00
|
|
|
~_i##Shim() {} \
|
2008-11-24 18:32:04 +00: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 04:11:10 +00:00
|
|
|
NS_FORWARD_NSIINTERFACEREQUESTOR(mIfReq->) \
|
|
|
|
NS_FORWARD_##_allcaps(mRealPtr->) \
|
2008-11-24 18:32:04 +00: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-04 20:00:09 +00:00
|
|
|
};
|
2015-02-19 01:34:29 +00:00
|
|
|
|
2008-10-04 20:00:09 +00: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 07:33:26 +00:00
|
|
|
nsresult AddExternalResource(nsIURI* aURI, nsIContentViewer* aViewer,
|
2008-10-04 20:00:09 +00:00
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsIDocument* aDisplayDocument);
|
|
|
|
|
|
|
|
nsClassHashtable<nsURIHashKey, ExternalResource> mMap;
|
|
|
|
nsRefPtrHashtable<nsURIHashKey, PendingLoad> mPendingLoads;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mHaveShutDown;
|
2008-10-04 20:00:09 +00:00
|
|
|
};
|
|
|
|
|
2013-04-08 18:35:30 +00:00
|
|
|
class CSPErrorQueue
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Note this was designed to be passed string literals. If you give it
|
|
|
|
* a dynamically allocated string, it is your responsibility to make sure
|
|
|
|
* it never dies and is properly freed!
|
|
|
|
*/
|
|
|
|
void Add(const char* aMessageName);
|
|
|
|
void Flush(nsIDocument* aDocument);
|
|
|
|
|
|
|
|
CSPErrorQueue()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~CSPErrorQueue()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsAutoTArray<const char*,5> mErrors;
|
|
|
|
};
|
|
|
|
|
2001-10-26 02:23:56 +00: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 07:41:30 +00:00
|
|
|
class nsDocument : public nsIDocument,
|
|
|
|
public nsIDOMXMLDocument, // inherits nsIDOMDocument
|
2000-06-02 08:13:29 +00:00
|
|
|
public nsIDOMDocumentXBL,
|
1999-09-21 14:18:52 +00:00
|
|
|
public nsSupportsWeakReference,
|
2002-07-20 23:09:24 +00:00
|
|
|
public nsIScriptObjectPrincipal,
|
2011-07-19 09:44:55 +00:00
|
|
|
public nsIRadioGroupContainer,
|
2008-08-26 23:09:02 +00:00
|
|
|
public nsIApplicationCacheContainer,
|
2011-04-26 12:30:17 +00:00
|
|
|
public nsStubMutationObserver,
|
2013-07-04 15:39:24 +00:00
|
|
|
public nsIObserver,
|
|
|
|
public nsIDOMXPathEvaluator
|
1998-12-18 17:34:34 +00:00
|
|
|
{
|
2014-05-24 18:46:38 +00:00
|
|
|
friend class nsIDocument;
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
public:
|
2010-06-23 09:31:35 +00:00
|
|
|
typedef mozilla::dom::Element Element;
|
2012-12-22 08:27:27 +00:00
|
|
|
using nsIDocument::GetElementsByTagName;
|
2015-01-05 17:42:31 +00:00
|
|
|
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
2010-06-23 09:31:35 +00:00
|
|
|
|
2007-01-04 22:31:26 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2012-02-01 21:58:01 +00:00
|
|
|
|
|
|
|
NS_DECL_SIZEOF_EXCLUDING_THIS
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void Reset(nsIChannel *aChannel, nsILoadGroup *aLoadGroup) override;
|
2006-11-22 18:27:54 +00:00
|
|
|
virtual void ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
2001-03-12 06:39:27 +00:00
|
|
|
|
2006-01-27 01:03:06 +00: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-09 23:54:21 +00:00
|
|
|
virtual nsresult StartDocumentLoad(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsISupports* aContainer,
|
|
|
|
nsIStreamListener **aDocListener,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aReset = true,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIContentSink* aContentSink = nullptr) override = 0;
|
1999-01-06 00:32:41 +00:00
|
|
|
|
2015-03-21 16:28:04 +00: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 13:27:00 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void NotifyPossibleTitleChange(bool aBoundTitleElement) override;
|
2008-08-18 02:10:28 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetDocumentURI(nsIURI* aURI) override;
|
2011-08-09 12:35:00 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetChromeXHRDocURI(nsIURI* aURI) override;
|
2013-09-24 21:56:52 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetChromeXHRDocBaseURI(nsIURI* aURI) override;
|
2013-09-24 21:56:52 +00:00
|
|
|
|
2000-03-21 04:09:58 +00:00
|
|
|
/**
|
2003-10-21 22:11:49 +00:00
|
|
|
* Set the principal responsible for this document.
|
2000-03-21 04:09:58 +00:00
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetPrincipal(nsIPrincipal *aPrincipal) override;
|
2000-03-21 04:09:58 +00:00
|
|
|
|
2003-01-09 15:45:45 +00:00
|
|
|
/**
|
|
|
|
* Get the Content-Type of this document.
|
|
|
|
*/
|
|
|
|
// NS_IMETHOD GetContentType(nsAString& aContentType);
|
2011-05-28 07:43:53 +00:00
|
|
|
// Already declared in nsIDOMDocument
|
2003-01-09 15:45:45 +00:00
|
|
|
|
|
|
|
/**
|
2003-04-19 16:53:44 +00:00
|
|
|
* Set the Content-Type of this document.
|
2003-01-09 15:45:45 +00:00
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetContentType(const nsAString& aContentType) override;
|
1998-10-01 21:43:49 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult SetBaseURI(nsIURI* aURI) override;
|
2001-04-30 23:35:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/Set the base target of a link in a document.
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void GetBaseTarget(nsAString &aBaseTarget) override;
|
1999-01-15 01:53:50 +00:00
|
|
|
|
1998-04-13 20:24:54 +00: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 16:28:04 +00:00
|
|
|
virtual void SetDocumentCharacterSet(const nsACString& aCharSetID) override;
|
2001-12-26 03:17:59 +00:00
|
|
|
|
2000-06-01 23:10:44 +00:00
|
|
|
/**
|
|
|
|
* Add an observer that gets notified whenever the charset changes.
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult AddCharSetObserver(nsIObserver* aObserver) override;
|
2000-06-01 23:10:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a charset observer.
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void RemoveCharSetObserver(nsIObserver* aObserver) override;
|
2000-06-01 23:10:44 +00:00
|
|
|
|
2010-05-14 17:04:51 +00:00
|
|
|
virtual Element* AddIDTargetObserver(nsIAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 16:28:04 +00:00
|
|
|
void* aData, bool aForImage) override;
|
2010-08-13 13:35:36 +00:00
|
|
|
virtual void RemoveIDTargetObserver(nsIAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 16:28:04 +00:00
|
|
|
void* aData, bool aForImage) override;
|
2008-06-25 01:55:01 +00:00
|
|
|
|
1999-01-23 07:01:40 +00:00
|
|
|
/**
|
|
|
|
* Access HTTP header data (this may also get set from other sources, like
|
|
|
|
* HTML META tags).
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void GetHeaderData(nsIAtom* aHeaderField, nsAString& aData) const override;
|
2003-10-22 06:09:48 +00:00
|
|
|
virtual void SetHeaderData(nsIAtom* aheaderField,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsAString& aData) override;
|
1999-01-23 07:01:40 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* Create a new presentation shell that will use aContext for
|
2013-04-01 10:26:37 +00:00
|
|
|
* its presentation context (presentation contexts <b>must not</b> be
|
|
|
|
* shared among multiple presentation shells).
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
2013-04-01 10:26:37 +00:00
|
|
|
virtual already_AddRefed<nsIPresShell> CreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsStyleSet* aStyleSet) override;
|
|
|
|
virtual void DeleteShell() override;
|
2004-01-09 23:54:21 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult GetAllowPlugins(bool* aAllowPlugins) override;
|
2012-08-20 18:34:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() override;
|
2013-01-04 06:54:26 +00:00
|
|
|
|
2015-01-08 04:53:24 +00:00
|
|
|
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual mozilla::dom::AnimationTimeline* Timeline() override;
|
2014-05-13 07:22:12 +00:00
|
|
|
|
2011-10-29 20:22:19 +00:00
|
|
|
virtual nsresult SetSubDocumentFor(Element* aContent,
|
2015-03-21 16:28:04 +00: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-13 20:24:54 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void EnsureOnDemandBuiltInUASheet(mozilla::CSSStyleSheet* aSheet) override;
|
2014-05-24 18:46:38 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
2014-05-24 18:46:38 +00:00
|
|
|
* Get the (document) style sheets owned by this document.
|
1998-09-02 02:02:30 +00:00
|
|
|
* These are ordered, highest priority last
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual int32_t GetNumberOfStyleSheets() const override;
|
|
|
|
virtual nsIStyleSheet* GetStyleSheetAt(int32_t aIndex) const override;
|
|
|
|
virtual int32_t GetIndexOfStyleSheet(nsIStyleSheet* aSheet) const override;
|
|
|
|
virtual void AddStyleSheet(nsIStyleSheet* aSheet) override;
|
|
|
|
virtual void RemoveStyleSheet(nsIStyleSheet* aSheet) override;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2003-10-22 06:09:48 +00:00
|
|
|
virtual void UpdateStyleSheets(nsCOMArray<nsIStyleSheet>& aOldSheets,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsCOMArray<nsIStyleSheet>& aNewSheets) override;
|
2000-05-27 20:03:14 +00:00
|
|
|
virtual void AddStyleSheetToStyleSets(nsIStyleSheet* aSheet);
|
|
|
|
virtual void RemoveStyleSheetFromStyleSets(nsIStyleSheet* aSheet);
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void InsertStyleSheetAt(nsIStyleSheet* aSheet, int32_t aIndex) override;
|
2002-12-03 05:48:14 +00:00
|
|
|
virtual void SetStyleSheetApplicableState(nsIStyleSheet* aSheet,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aApplicable) override;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheetURI) override;
|
|
|
|
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType, nsIStyleSheet* aSheet) override;
|
|
|
|
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* sheetURI) override;
|
|
|
|
virtual nsIStyleSheet* FirstAdditionalAuthorSheet() override;
|
2012-09-11 11:51:10 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIChannel* GetChannel() const override {
|
2005-06-01 01:15:23 +00:00
|
|
|
return mChannel;
|
|
|
|
}
|
2004-07-28 07:08:41 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIChannel* GetFailedChannel() const override {
|
2014-06-19 20:55:55 +00:00
|
|
|
return mFailedChannel;
|
|
|
|
}
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetFailedChannel(nsIChannel* aChannel) override {
|
2014-06-19 20:55:55 +00:00
|
|
|
mFailedChannel = aChannel;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) override;
|
1998-06-25 22:26:52 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject) override;
|
2007-10-01 10:02:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIGlobalObject* GetScopeObject() const override;
|
|
|
|
void SetScopeObject(nsIGlobalObject* aGlobal) override;
|
2001-05-17 05:54:16 +00:00
|
|
|
/**
|
|
|
|
* Get the script loader for this document
|
2003-03-26 07:41:30 +00:00
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsScriptLoader* ScriptLoader() override;
|
2001-05-17 05:54:16 +00:00
|
|
|
|
2010-06-04 01:09:20 +00:00
|
|
|
/**
|
|
|
|
* Add/Remove an element to the document's id and name hashes
|
|
|
|
*/
|
2015-03-21 16:28:04 +00: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 01:09:20 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* Add a new observer of document change notifications. Whenever
|
|
|
|
* content is changed, appended, inserted or removed the observers are
|
|
|
|
* informed.
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void AddObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an observer of document change notifications. This will
|
|
|
|
* return false if the observer cannot be found.
|
|
|
|
*/
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool RemoveObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2003-10-02 21:29:40 +00:00
|
|
|
// Observation hooks used to propagate notifications to document
|
|
|
|
// observers.
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void BeginUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void EndUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void BeginLoad() override;
|
|
|
|
virtual void EndLoad() override;
|
2009-01-09 17:12:09 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetReadyStateInternal(ReadyState rs) override;
|
2009-01-09 17:12:09 +00:00
|
|
|
|
2011-03-29 03:32:11 +00:00
|
|
|
virtual void ContentStateChanged(nsIContent* aContent,
|
2014-04-03 04:18:36 +00:00
|
|
|
mozilla::EventStates aStateMask)
|
2015-03-21 16:28:04 +00:00
|
|
|
override;
|
2014-04-03 04:18:36 +00:00
|
|
|
virtual void DocumentStatesChanged(
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::EventStates aStateMask) override;
|
2003-10-22 06:09:48 +00:00
|
|
|
|
|
|
|
virtual void StyleRuleChanged(nsIStyleSheet* aStyleSheet,
|
|
|
|
nsIStyleRule* aOldStyleRule,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIStyleRule* aNewStyleRule) override;
|
2003-10-22 06:09:48 +00:00
|
|
|
virtual void StyleRuleAdded(nsIStyleSheet* aStyleSheet,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIStyleRule* aStyleRule) override;
|
2003-10-22 06:09:48 +00:00
|
|
|
virtual void StyleRuleRemoved(nsIStyleSheet* aStyleSheet,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIStyleRule* aStyleRule) override;
|
2003-10-22 06:09:48 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void FlushPendingNotifications(mozFlushType aType) override;
|
|
|
|
virtual void FlushExternalResources(mozFlushType aType) override;
|
2014-01-04 15:02:17 +00:00
|
|
|
virtual void SetXMLDeclaration(const char16_t *aVersion,
|
|
|
|
const char16_t *aEncoding,
|
2015-03-21 16:28:04 +00:00
|
|
|
const int32_t aStandalone) override;
|
2003-10-22 06:09:48 +00:00
|
|
|
virtual void GetXMLDeclaration(nsAString& aVersion,
|
|
|
|
nsAString& aEncoding,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsAString& Standalone) override;
|
|
|
|
virtual bool IsScriptEnabled() override;
|
2004-01-09 23:54:21 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void OnPageShow(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
|
|
|
virtual void OnPageHide(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
2013-04-06 00:44:15 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void WillDispatchMutationEvent(nsINode* aTarget) override;
|
|
|
|
virtual void MutationEventDispatched(nsINode* aTarget) override;
|
2005-06-15 23:52:46 +00:00
|
|
|
|
2006-01-19 03:34:18 +00:00
|
|
|
// nsINode
|
2015-03-21 16:28:04 +00: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 15:56:38 +00:00
|
|
|
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
2015-03-21 16:28:04 +00: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 10:22:54 +00:00
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
2006-01-19 03:34:18 +00:00
|
|
|
|
2002-07-20 23:09:24 +00:00
|
|
|
// nsIRadioGroupContainer
|
|
|
|
NS_IMETHOD WalkRadioGroup(const nsAString& aName,
|
2006-02-08 05:56:13 +00:00
|
|
|
nsIRadioVisitor* aVisitor,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aFlushContent) override;
|
2013-08-10 01:17:51 +00:00
|
|
|
virtual void
|
|
|
|
SetCurrentRadioButton(const nsAString& aName,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::dom::HTMLInputElement* aRadio) override;
|
2013-08-10 01:17:51 +00:00
|
|
|
virtual mozilla::dom::HTMLInputElement*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetCurrentRadioButton(const nsAString& aName) override;
|
2013-08-10 01:17:51 +00:00
|
|
|
NS_IMETHOD
|
|
|
|
GetNextRadioButton(const nsAString& aName,
|
|
|
|
const bool aPrevious,
|
|
|
|
mozilla::dom::HTMLInputElement* aFocusedRadio,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::dom::HTMLInputElement** aRadioOut) override;
|
2012-08-03 10:38:52 +00:00
|
|
|
virtual void AddToRadioGroup(const nsAString& aName,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIFormControl* aRadio) override;
|
2012-08-03 10:38:52 +00:00
|
|
|
virtual void RemoveFromRadioGroup(const nsAString& aName,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIFormControl* aRadio) override;
|
|
|
|
virtual uint32_t GetRequiredRadioCount(const nsAString& aName) const override;
|
2014-11-28 01:40:00 +00:00
|
|
|
virtual void RadioRequiredWillChange(const nsAString& aName,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aRequiredAdded) override;
|
|
|
|
virtual bool GetValueMissingState(const nsAString& aName) const override;
|
|
|
|
virtual void SetValueMissingState(const nsAString& aName, bool aValue) override;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2002-07-20 23:09:24 +00:00
|
|
|
// for radio group
|
2012-08-04 07:44:00 +00:00
|
|
|
nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
|
|
|
|
nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
|
2002-07-20 23:09:24 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsViewportInfo GetViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) override;
|
2013-01-04 03:27:06 +00:00
|
|
|
|
2014-08-29 00:20:27 +00:00
|
|
|
/**
|
|
|
|
* Called when an app-theme-changed observer notification is
|
|
|
|
* received by this document.
|
|
|
|
*/
|
|
|
|
void OnAppThemeChanged();
|
|
|
|
|
2012-08-04 07:44:00 +00:00
|
|
|
private:
|
2014-06-20 10:32:49 +00:00
|
|
|
void AddOnDemandBuiltInUASheet(mozilla::CSSStyleSheet* aSheet);
|
2012-08-04 07:44:00 +00:00
|
|
|
nsRadioGroupStruct* GetRadioGroupInternal(const nsAString& aName) const;
|
2013-07-26 15:37:03 +00:00
|
|
|
void SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages);
|
2012-08-04 07:44:00 +00: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 16:46:42 +00:00
|
|
|
// nsIDOMNode
|
2012-10-09 12:31:24 +00:00
|
|
|
NS_FORWARD_NSIDOMNODE_TO_NSINODE_OVERRIDABLE
|
2001-04-12 23:35:24 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
// nsIDOMDocument
|
|
|
|
NS_DECL_NSIDOMDOCUMENT
|
2001-10-26 02:23:56 +00: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 16:46:42 +00:00
|
|
|
|
|
|
|
// nsIDOMDocumentXBL
|
|
|
|
NS_DECL_NSIDOMDOCUMENTXBL
|
2000-05-16 11:35:12 +00:00
|
|
|
|
2002-11-09 00:25:25 +00:00
|
|
|
// nsIDOMEventTarget
|
2014-03-18 04:48:19 +00:00
|
|
|
virtual nsresult PreHandleEvent(
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::EventChainPreVisitor& aVisitor) override;
|
2014-03-17 06:56:53 +00:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetOrCreateListenerManager() override;
|
2014-03-17 06:56:53 +00:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetExistingListenerManager() const override;
|
1999-03-28 22:22:54 +00:00
|
|
|
|
2003-10-22 06:09:48 +00:00
|
|
|
// nsIScriptObjectPrincipal
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
2003-10-22 06:09:48 +00:00
|
|
|
|
2008-08-26 23:09:02 +00:00
|
|
|
// nsIApplicationCacheContainer
|
|
|
|
NS_DECL_NSIAPPLICATIONCACHECONTAINER
|
|
|
|
|
2012-05-08 21:47:20 +00:00
|
|
|
// nsIObserver
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2013-07-04 15:39:24 +00:00
|
|
|
NS_DECL_NSIDOMXPATHEVALUATOR
|
|
|
|
|
2002-01-25 06:37:35 +00:00
|
|
|
virtual nsresult Init();
|
|
|
|
|
2010-07-23 09:49:57 +00:00
|
|
|
virtual nsresult CreateElem(const nsAString& aName, nsIAtom *aPrefix,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNamespaceID,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIContent **aResult) override;
|
2004-06-25 12:26:02 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void Sanitize() override;
|
2005-05-04 20:22:32 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual void EnumerateSubDocuments(nsSubDocEnumFunc aCallback,
|
2015-03-21 16:28:04 +00:00
|
|
|
void *aData) override;
|
2005-05-04 20:22:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool CanSavePresentation(nsIRequest *aNewRequest) override;
|
|
|
|
virtual void Destroy() override;
|
|
|
|
virtual void RemovedFromDocShell() override;
|
|
|
|
virtual already_AddRefed<nsILayoutHistoryState> GetLayoutHistoryState() const override;
|
2005-05-04 20:22:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void BlockOnload() override;
|
|
|
|
virtual void UnblockOnload(bool aFireSync) override;
|
2005-05-13 19:54:28 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void AddStyleRelevantLink(mozilla::dom::Link* aLink) override;
|
|
|
|
virtual void ForgetLink(mozilla::dom::Link* aLink) override;
|
2005-08-10 20:21:44 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void ClearBoxObjectFor(nsIContent* aContent) override;
|
2014-10-14 20:15:21 +00:00
|
|
|
|
|
|
|
virtual already_AddRefed<mozilla::dom::BoxObject>
|
|
|
|
GetBoxObjectFor(mozilla::dom::Element* aElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::ErrorResult& aRv) override;
|
2005-10-27 14:09:23 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual Element*
|
2012-05-28 04:52:53 +00:00
|
|
|
GetAnonymousElementByAttribute(nsIContent* aElement,
|
|
|
|
nsIAtom* aAttrName,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsAString& aAttrValue) const override;
|
2008-11-05 03:58:22 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual Element* ElementFromPointHelper(float aX, float aY,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIgnoreRootScrollFrame,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aFlushLayout) override;
|
2008-11-05 03:58:22 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual nsresult NodesFromRectHelper(float aX, float aY,
|
2010-04-08 00:31:26 +00:00
|
|
|
float aTopSize, float aRightSize,
|
|
|
|
float aBottomSize, float aLeftSize,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aFlushLayout,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIDOMNodeList** aReturn) override;
|
2010-04-08 00:31:26 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void FlushSkinBindings() override;
|
2008-03-21 11:44:09 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) override;
|
|
|
|
virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) override;
|
|
|
|
virtual void TryCancelFrameLoaderInitialization(nsIDocShell* aShell) override;
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual nsIDocument*
|
2008-10-04 20:00:09 +00:00
|
|
|
RequestExternalResource(nsIURI* aURI,
|
|
|
|
nsINode* aRequestingNode,
|
2015-03-21 16:28:04 +00:00
|
|
|
ExternalResourceLoad** aPendingLoad) override;
|
2014-06-02 12:08:21 +00:00
|
|
|
virtual void
|
2015-03-21 16:28:04 +00:00
|
|
|
EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) override;
|
2007-02-16 23:02:08 +00:00
|
|
|
|
2012-09-25 03:24:44 +00:00
|
|
|
nsTArray<nsCString> mHostObjectURIs;
|
2010-03-03 07:51:09 +00:00
|
|
|
|
2010-03-03 07:09:51 +00:00
|
|
|
// Returns our (lazily-initialized) animation controller.
|
|
|
|
// If HasAnimationController is true, this is guaranteed to return non-null.
|
2015-03-21 16:28:04 +00:00
|
|
|
nsSMILAnimationController* GetAnimationController() override;
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2014-12-17 23:42:41 +00:00
|
|
|
virtual mozilla::PendingPlayerTracker*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetPendingPlayerTracker() final override
|
2014-12-17 23:42:41 +00:00
|
|
|
{
|
|
|
|
return mPendingPlayerTracker;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual mozilla::PendingPlayerTracker*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetOrCreatePendingPlayerTracker() override;
|
2014-12-17 23:42:41 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
void SetImagesNeedAnimating(bool aAnimating) override;
|
2010-11-06 19:13:01 +00:00
|
|
|
|
2014-02-26 23:58:21 +00:00
|
|
|
virtual void SuppressEventHandling(SuppressionType aWhat,
|
2015-03-21 16:28:04 +00:00
|
|
|
uint32_t aIncrease) override;
|
2014-02-26 23:58:21 +00:00
|
|
|
|
|
|
|
virtual void UnsuppressEventHandlingAndFireEvents(SuppressionType aWhat,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aFireEvents) override;
|
2009-03-03 20:11:14 +00:00
|
|
|
|
2011-08-08 02:24:28 +00:00
|
|
|
void DecreaseEventSuppression() {
|
2014-02-26 23:58:21 +00:00
|
|
|
MOZ_ASSERT(mEventsSuppressed);
|
2011-08-08 02:24:28 +00:00
|
|
|
--mEventsSuppressed;
|
|
|
|
MaybeRescheduleAnimationFrameNotifications();
|
|
|
|
}
|
2009-03-03 20:11:14 +00:00
|
|
|
|
2014-02-26 23:58:21 +00:00
|
|
|
void ResumeAnimations() {
|
|
|
|
MOZ_ASSERT(mAnimationsPaused);
|
|
|
|
--mAnimationsPaused;
|
|
|
|
MaybeRescheduleAnimationFrameNotifications();
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIDocument* GetTemplateContentsOwner() override;
|
2013-03-26 07:15:23 +00:00
|
|
|
|
2012-01-30 20:08:13 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
|
|
|
|
nsIDocument)
|
2007-01-04 22:31:26 +00:00
|
|
|
|
2008-08-18 02:10:28 +00:00
|
|
|
void DoNotifyPossibleTitleChange();
|
|
|
|
|
2008-10-04 20:00:09 +00:00
|
|
|
nsExternalResourceMap& ExternalResourceMap()
|
|
|
|
{
|
|
|
|
return mExternalResourceMap;
|
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
void SetLoadedAsData(bool aLoadedAsData) { mLoadedAsData = aLoadedAsData; }
|
2011-11-03 20:39:08 +00:00
|
|
|
void SetLoadedAsInteractiveData(bool aLoadedAsInteractiveData)
|
|
|
|
{
|
|
|
|
mLoadedAsInteractiveData = aLoadedAsInteractiveData;
|
|
|
|
}
|
2008-09-18 11:15:47 +00:00
|
|
|
|
|
|
|
nsresult CloneDocHelper(nsDocument* clone) const;
|
|
|
|
|
2009-01-31 12:53:01 +00:00
|
|
|
void MaybeInitializeFinalizeFrameLoaders();
|
|
|
|
|
|
|
|
void MaybeEndOutermostXBLUpdate();
|
2009-07-08 05:23:20 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void PreloadPictureOpened() override;
|
|
|
|
virtual void PreloadPictureClosed() override;
|
2014-12-10 23:54:00 +00:00
|
|
|
|
|
|
|
virtual void
|
|
|
|
PreloadPictureImageSource(const nsAString& aSrcsetAttr,
|
|
|
|
const nsAString& aSizesAttr,
|
|
|
|
const nsAString& aTypeAttr,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsAString& aMediaAttr) override;
|
2014-12-10 23:54:00 +00:00
|
|
|
|
|
|
|
virtual already_AddRefed<nsIURI>
|
|
|
|
ResolvePreloadImage(nsIURI *aBaseURI,
|
|
|
|
const nsAString& aSrcAttr,
|
|
|
|
const nsAString& aSrcsetAttr,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsAString& aSizesAttr) override;
|
2014-12-10 23:54:00 +00:00
|
|
|
|
2011-07-29 18:30:00 +00:00
|
|
|
virtual void MaybePreLoadImage(nsIURI* uri,
|
2014-11-18 13:46:53 +00:00
|
|
|
const nsAString &aCrossOriginAttr,
|
2015-03-21 16:28:04 +00:00
|
|
|
ReferrerPolicy aReferrerPolicy) override;
|
|
|
|
virtual void ForgetImagePreload(nsIURI* aURI) override;
|
2009-10-30 01:48:38 +00:00
|
|
|
|
2012-08-28 17:10:08 +00:00
|
|
|
virtual void PreloadStyle(nsIURI* uri, const nsAString& charset,
|
2014-11-18 13:46:47 +00:00
|
|
|
const nsAString& aCrossOriginAttr,
|
2015-03-21 16:28:04 +00:00
|
|
|
ReferrerPolicy aReferrerPolicy) override;
|
2010-03-02 21:00:39 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual nsresult LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::CSSStyleSheet** sheet) override;
|
2010-03-02 21:00:39 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsISupports* GetCurrentContentSink() override;
|
2009-10-30 01:48:38 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual mozilla::EventStates GetDocumentState() override;
|
2010-03-17 17:10:57 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void RegisterHostObjectUri(const nsACString& aUri) override;
|
|
|
|
virtual void UnregisterHostObjectUri(const nsACString& aUri) override;
|
2010-03-03 07:51:09 +00:00
|
|
|
|
2010-04-27 09:48:52 +00:00
|
|
|
// Only BlockOnload should call this!
|
|
|
|
void AsyncBlockOnload();
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetScrollToRef(nsIURI *aDocumentURI) override;
|
|
|
|
virtual void ScrollToRef() override;
|
|
|
|
virtual void ResetScrolledToRefAlready() override;
|
|
|
|
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) override;
|
2010-05-12 00:30:40 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Element *GetElementById(const nsAString& aElementId) override;
|
|
|
|
virtual const nsSmallVoidArray* GetAllElementsForId(const nsAString& aElementId) const override;
|
2010-08-13 13:35:36 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Element *LookupImageElement(const nsAString& aElementId) override;
|
2012-12-22 08:27:27 +00:00
|
|
|
virtual void MozSetImageElement(const nsAString& aImageElementId,
|
2015-03-21 16:28:04 +00:00
|
|
|
Element* aElement) override;
|
2010-04-19 15:41:38 +00:00
|
|
|
|
2015-03-21 16:28:04 +00: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 00:40:29 +00:00
|
|
|
|
2012-03-28 15:53:56 +00:00
|
|
|
// AddPlugin adds a plugin-related element to mPlugins when the element is
|
|
|
|
// added to the tree.
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult AddPlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 15:53:56 +00:00
|
|
|
// RemovePlugin removes a plugin-related element to mPlugins when the
|
|
|
|
// element is removed from the tree.
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void RemovePlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 15:53:56 +00:00
|
|
|
// GetPlugins returns the plugin-related elements from
|
|
|
|
// the frame and any subframes.
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void GetPlugins(nsTArray<nsIObjectLoadingContent*>& aPlugins) override;
|
2012-03-28 15:53:56 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult GetStateObject(nsIVariant** aResult) override;
|
2011-03-25 15:03:33 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsDOMNavigationTiming* GetNavigationTiming() const override;
|
|
|
|
virtual nsresult SetNavigationTiming(nsDOMNavigationTiming* aTiming) override;
|
2011-06-23 10:39:48 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Element* FindImageMap(const nsAString& aNormalizedMapName) override;
|
2011-05-30 10:59:59 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Element* GetFullScreenElement() override;
|
2014-07-09 19:30:22 +00:00
|
|
|
virtual void AsyncRequestFullScreen(Element* aElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::dom::FullScreenOptions& aOptions) override;
|
|
|
|
virtual void RestorePreviousFullScreenState() override;
|
|
|
|
virtual bool IsFullscreenLeaf() override;
|
|
|
|
virtual bool IsFullScreenDoc() override;
|
|
|
|
virtual void SetApprovedForFullscreen(bool aIsApproved) override;
|
2012-07-31 02:09:31 +00:00
|
|
|
virtual nsresult RemoteFrameFullscreenChanged(nsIDOMElement* aFrameElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsAString& aNewOrigin) override;
|
2012-07-31 02:09:31 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult RemoteFrameFullscreenReverted() override;
|
|
|
|
virtual nsIDocument* GetFullscreenRoot() override;
|
|
|
|
virtual void SetFullscreenRoot(nsIDocument* aRoot) override;
|
2012-05-21 20:43:36 +00:00
|
|
|
|
2014-06-25 00:37:03 +00: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;
|
|
|
|
|
2013-02-26 05:40:53 +00:00
|
|
|
static void ExitFullscreen(nsIDocument* aDoc);
|
2011-09-04 20:39:05 +00:00
|
|
|
|
2011-11-04 19:05:16 +00:00
|
|
|
// This is called asynchronously by nsIDocument::AsyncRequestFullScreen()
|
2012-07-31 02:09:31 +00:00
|
|
|
// to move this document into full-screen mode if allowed. aWasCallerChrome
|
2011-11-04 19:05:16 +00:00
|
|
|
// should be true when nsIDocument::AsyncRequestFullScreen() was called
|
2012-07-31 02:09:31 +00:00
|
|
|
// by chrome code. aNotifyOnOriginChange denotes whether we should send a
|
|
|
|
// fullscreen-origin-change notification if requesting fullscreen in this
|
|
|
|
// document causes the origin which is fullscreen to change. We may want to
|
|
|
|
// *not* send this notification if we're calling RequestFullscreen() as part
|
|
|
|
// of a continuation of a request in a subdocument, whereupon the caller will
|
|
|
|
// need to send the notification with the origin of the document which
|
|
|
|
// originally requested fullscreen, not *this* document's origin.
|
|
|
|
void RequestFullScreen(Element* aElement,
|
2014-07-09 19:30:22 +00:00
|
|
|
mozilla::dom::FullScreenOptions& aOptions,
|
2012-07-31 02:09:31 +00:00
|
|
|
bool aWasCallerChrome,
|
|
|
|
bool aNotifyOnOriginChange);
|
2011-11-04 19:05:16 +00:00
|
|
|
|
2011-12-06 21:59:39 +00:00
|
|
|
// Removes all elements from the full-screen stack, removing full-scren
|
|
|
|
// styles from the top element in the stack.
|
2012-05-21 20:43:36 +00:00
|
|
|
void CleanupFullscreenState();
|
|
|
|
|
|
|
|
// Add/remove "fullscreen-approved" observer service notification listener.
|
|
|
|
// Chrome sends us a notification when fullscreen is approved for a
|
|
|
|
// document, with the notification subject as the document that was approved.
|
|
|
|
// We maintain this listener while in fullscreen mode.
|
|
|
|
nsresult AddFullscreenApprovedObserver();
|
|
|
|
nsresult RemoveFullscreenApprovedObserver();
|
2011-12-06 21:59:39 +00: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 08:27:27 +00:00
|
|
|
// DOM-exposed fullscreen API
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool MozFullScreenEnabled() override;
|
|
|
|
virtual Element* GetMozFullScreenElement(mozilla::ErrorResult& rv) override;
|
2012-12-22 08:27:27 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
void RequestPointerLock(Element* aElement) override;
|
2013-03-24 10:32:44 +00:00
|
|
|
bool ShouldLockPointer(Element* aElement, Element* aCurrentLock,
|
|
|
|
bool aNoFocusCheck = false);
|
2012-04-11 21:55:21 +00:00
|
|
|
bool SetPointerLock(Element* aElement, int aCursorStyle);
|
2013-03-24 10:32:44 +00:00
|
|
|
static void UnlockPointer(nsIDocument* aDoc = nullptr);
|
2012-04-11 21:55:21 +00:00
|
|
|
|
2012-12-16 05:16:47 +00: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 16:28:04 +00:00
|
|
|
virtual void PostVisibilityUpdateEvent() override;
|
2011-10-11 21:29:12 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void DocAddSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const override;
|
2013-09-30 23:20:23 +00:00
|
|
|
// DocAddSizeOfIncludingThis is inherited from nsIDocument.
|
2012-01-03 02:19:14 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
2012-12-22 08:27:27 +00:00
|
|
|
|
2014-02-23 21:01:26 +00:00
|
|
|
virtual void EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
|
|
|
|
Element* aCustomElement,
|
|
|
|
mozilla::dom::LifecycleCallbackArgs* aArgs = nullptr,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::dom::CustomElementDefinition* aDefinition = nullptr) override;
|
2014-02-23 21:01:26 +00:00
|
|
|
|
|
|
|
static void ProcessTopElementQueue(bool aIsBaseQueue = false);
|
|
|
|
|
|
|
|
void GetCustomPrototype(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAtom,
|
|
|
|
JS::MutableHandle<JSObject*> prototype)
|
2012-11-01 18:18:08 +00:00
|
|
|
{
|
2014-02-23 21:01:26 +00: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 18:18:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool RegisterEnabled();
|
|
|
|
|
2014-02-23 21:01:26 +00:00
|
|
|
virtual nsresult RegisterUnresolvedElement(mozilla::dom::Element* aElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIAtom* aTypeName = nullptr) override;
|
2014-02-23 21:01:26 +00:00
|
|
|
|
2012-12-22 08:27:27 +00:00
|
|
|
// WebIDL bits
|
|
|
|
virtual mozilla::dom::DOMImplementation*
|
2015-03-21 16:28:04 +00:00
|
|
|
GetImplementation(mozilla::ErrorResult& rv) override;
|
2014-06-11 20:26:52 +00:00
|
|
|
virtual void
|
2014-02-23 21:01:26 +00:00
|
|
|
RegisterElement(JSContext* aCx, const nsAString& aName,
|
|
|
|
const mozilla::dom::ElementRegistrationOptions& aOptions,
|
2014-06-11 20:26:52 +00:00
|
|
|
JS::MutableHandle<JSObject*> aRetval,
|
2015-03-21 16:28:04 +00: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-23 21:01:26 +00:00
|
|
|
using nsIDocument::CreateElement;
|
|
|
|
using nsIDocument::CreateElementNS;
|
|
|
|
virtual already_AddRefed<Element> CreateElement(const nsAString& aTagName,
|
|
|
|
const nsAString& aTypeExtension,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::ErrorResult& rv) override;
|
2014-02-23 21:01:26 +00:00
|
|
|
virtual already_AddRefed<Element> CreateElementNS(const nsAString& aNamespaceURI,
|
|
|
|
const nsAString& aQualifiedName,
|
|
|
|
const nsAString& aTypeExtension,
|
2015-03-21 16:28:04 +00:00
|
|
|
mozilla::ErrorResult& rv) override;
|
|
|
|
virtual void UseRegistryFromDocument(nsIDocument* aDocument) override;
|
2012-12-22 08:27:27 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIDocument* MasterDocument() override
|
2014-05-21 17:08:12 +00:00
|
|
|
{
|
2014-10-01 12:13:53 +00:00
|
|
|
return mMasterDocument ? mMasterDocument.get()
|
|
|
|
: this;
|
2014-05-21 17:08:12 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetMasterDocument(nsIDocument* master) override
|
2014-05-21 17:08:12 +00:00
|
|
|
{
|
2014-11-06 13:05:36 +00:00
|
|
|
MOZ_ASSERT(master);
|
2014-05-21 17:08:12 +00:00
|
|
|
mMasterDocument = master;
|
2014-11-06 13:05:36 +00:00
|
|
|
UseRegistryFromDocument(mMasterDocument);
|
2014-05-21 17:08:12 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool IsMasterDocument() override
|
2014-05-21 17:08:12 +00:00
|
|
|
{
|
|
|
|
return !mMasterDocument;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual mozilla::dom::ImportManager* ImportManager() override
|
2014-05-21 17:08:12 +00:00
|
|
|
{
|
|
|
|
if (mImportManager) {
|
|
|
|
MOZ_ASSERT(!mMasterDocument, "Only the master document has ImportManager set");
|
2014-10-01 12:13:53 +00:00
|
|
|
return mImportManager.get();
|
2014-05-21 17:08:12 +00: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 12:13:53 +00:00
|
|
|
return mImportManager.get();
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool HasSubImportLink(nsINode* aLink) override
|
2014-10-01 12:13:53 +00:00
|
|
|
{
|
|
|
|
return mSubImportLinks.Contains(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual uint32_t IndexOfSubImportLink(nsINode* aLink) override
|
2014-10-01 12:13:53 +00:00
|
|
|
{
|
|
|
|
return mSubImportLinks.IndexOf(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void AddSubImportLink(nsINode* aLink) override
|
2014-10-01 12:13:53 +00:00
|
|
|
{
|
|
|
|
mSubImportLinks.AppendElement(aLink);
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsINode* GetSubImportLink(uint32_t aIdx) override
|
2014-10-01 12:13:53 +00:00
|
|
|
{
|
|
|
|
return aIdx < mSubImportLinks.Length() ? mSubImportLinks[aIdx].get()
|
|
|
|
: nullptr;
|
2014-05-21 17:08:12 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void UnblockDOMContentLoaded() override;
|
2014-04-12 09:02:21 +00:00
|
|
|
|
1998-07-17 23:00:54 +00:00
|
|
|
protected:
|
2009-09-10 13:23:40 +00:00
|
|
|
friend class nsNodeUtils;
|
2013-01-24 09:09:06 +00:00
|
|
|
friend class nsDocumentOnStack;
|
|
|
|
|
|
|
|
void IncreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
++mStackRefCnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DecreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
if (--mStackRefCnt == 0 && mNeedsReleaseAfterStackRefCntRelease) {
|
|
|
|
mNeedsReleaseAfterStackRefCntRelease = false;
|
|
|
|
NS_RELEASE_THIS();
|
|
|
|
}
|
|
|
|
}
|
2008-06-22 23:12:40 +00:00
|
|
|
|
2011-11-04 19:05:16 +00: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-21 21:23:48 +00: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 19:05:16 +00:00
|
|
|
|
2006-10-14 19:14:24 +00:00
|
|
|
/**
|
|
|
|
* Check that aId is not empty and log a message to the console
|
|
|
|
* service if it is.
|
2011-10-17 14:59:28 +00:00
|
|
|
* @returns true if aId looks correct, false otherwise.
|
2006-10-14 19:14:24 +00:00
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
inline bool CheckGetElementByIdArg(const nsAString& aId)
|
2010-06-22 02:59:37 +00:00
|
|
|
{
|
|
|
|
if (aId.IsEmpty()) {
|
|
|
|
ReportEmptyGetElementByIdArg();
|
2011-10-17 14:59:28 +00:00
|
|
|
return false;
|
2010-06-22 02:59:37 +00:00
|
|
|
}
|
2011-10-17 14:59:28 +00:00
|
|
|
return true;
|
2010-06-22 02:59:37 +00:00
|
|
|
}
|
|
|
|
|
2010-12-20 16:21:58 +00:00
|
|
|
void ReportEmptyGetElementByIdArg();
|
2006-10-14 19:14:24 +00:00
|
|
|
|
2009-01-23 23:08:41 +00:00
|
|
|
void DispatchContentLoadedEvents();
|
|
|
|
|
2004-01-29 20:52:06 +00:00
|
|
|
void RetrieveRelevantHeaders(nsIChannel *aChannel);
|
2003-04-19 16:53:44 +00:00
|
|
|
|
2013-01-18 14:27:03 +00:00
|
|
|
void TryChannelCharset(nsIChannel *aChannel,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t& aCharsetSource,
|
2012-03-24 11:34:42 +00:00
|
|
|
nsACString& aCharset,
|
|
|
|
nsHtml5TreeOpExecutor* aExecutor);
|
2009-09-25 16:50:26 +00:00
|
|
|
|
2005-08-17 01:27:10 +00:00
|
|
|
// Call this before the document does something that will unbind all content.
|
2010-06-04 01:09:20 +00:00
|
|
|
// That will stop us from doing a lot of work as each element is removed.
|
|
|
|
void DestroyElementMaps();
|
2005-08-10 20:21:44 +00:00
|
|
|
|
2009-09-25 16:50:26 +00:00
|
|
|
// Refreshes the hrefs of all the links in the document.
|
|
|
|
void RefreshLinkHrefs();
|
|
|
|
|
|
|
|
nsIContent* GetFirstBaseNodeWithHref();
|
|
|
|
nsresult SetFirstBaseNodeWithHref(nsIContent *node);
|
|
|
|
|
2008-08-18 02:10:28 +00:00
|
|
|
// Get the first <title> element with the given IsNodeOfType type, or
|
|
|
|
// return null if there isn't one
|
2012-08-22 15:56:38 +00:00
|
|
|
nsIContent* GetTitleContent(uint32_t aNodeType);
|
2008-08-18 02:10:28 +00:00
|
|
|
// Find the first "title" element in the given IsNodeOfType type and
|
|
|
|
// append the concatenation of its text node children to aTitle. Do
|
|
|
|
// nothing if there is no such element.
|
2012-08-22 15:56:38 +00:00
|
|
|
void GetTitleFromElement(uint32_t aNodeType, nsAString& aTitle);
|
2012-12-22 08:27:27 +00:00
|
|
|
public:
|
|
|
|
// Get our title
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void GetTitle(nsString& aTitle) override;
|
2012-12-22 08:27:27 +00:00
|
|
|
// Set our title
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv) override;
|
2008-08-18 02:10:28 +00:00
|
|
|
|
2013-03-24 10:32:44 +00:00
|
|
|
static void XPCOMShutdown();
|
2013-04-20 16:04:09 +00:00
|
|
|
|
2013-06-27 23:52:20 +00:00
|
|
|
bool mIsTopLevelContentDocument:1;
|
|
|
|
|
|
|
|
bool IsTopLevelContentDocument();
|
|
|
|
|
|
|
|
void SetIsTopLevelContentDocument(bool aIsTopLevelContentDocument);
|
|
|
|
|
2013-04-20 16:04:09 +00:00
|
|
|
js::ExpandoAndGeneration mExpandoAndGeneration;
|
|
|
|
|
2014-08-17 21:41:50 +00:00
|
|
|
#ifdef MOZ_EME
|
|
|
|
bool ContainsEMEContent();
|
|
|
|
#endif
|
|
|
|
|
2015-02-02 23:28:49 +00:00
|
|
|
bool ContainsMSEContent();
|
|
|
|
|
2012-12-22 08:27:27 +00:00
|
|
|
protected:
|
2013-04-01 10:26:37 +00:00
|
|
|
already_AddRefed<nsIPresShell> doCreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
|
|
|
nsStyleSet* aStyleSet,
|
|
|
|
nsCompatibility aCompatMode);
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2013-01-08 23:25:47 +00:00
|
|
|
void RemoveDocStyleSheetsFromStyleSets();
|
2012-09-11 11:51:10 +00:00
|
|
|
void RemoveStyleSheetsFromStyleSets(nsCOMArray<nsIStyleSheet>& aSheets,
|
|
|
|
nsStyleSet::sheetType aType);
|
2013-05-10 07:13:37 +00:00
|
|
|
void ResetStylesheetsToURI(nsIURI* aURI);
|
2004-07-15 20:30:30 +00:00
|
|
|
void FillStyleSet(nsStyleSet* aStyleSet);
|
2004-01-22 03:35:09 +00:00
|
|
|
|
2005-07-14 16:13:09 +00:00
|
|
|
// Return whether all the presshells for this document are safe to flush
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsSafeToFlush() const;
|
2013-04-22 01:25:28 +00:00
|
|
|
|
2013-04-06 00:44:15 +00:00
|
|
|
void DispatchPageTransition(mozilla::dom::EventTarget* aDispatchTarget,
|
2009-06-24 13:33:02 +00:00
|
|
|
const nsAString& aType,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aPersisted);
|
2005-10-11 00:18:19 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsPIDOMWindow *GetWindowInternal() const override;
|
|
|
|
virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const override;
|
|
|
|
virtual bool InternalAllowXULXBL() override;
|
2010-04-16 09:05:25 +00:00
|
|
|
|
2010-07-21 15:33:31 +00:00
|
|
|
#define NS_DOCUMENT_NOTIFY_OBSERVERS(func_, params_) \
|
|
|
|
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, nsIDocumentObserver, \
|
|
|
|
func_, params_);
|
2013-04-22 01:25:28 +00:00
|
|
|
|
2006-03-23 08:21:21 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
void VerifyRootContentState();
|
|
|
|
#endif
|
|
|
|
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsDocument(const char* aContentType);
|
2003-03-26 07:41:30 +00:00
|
|
|
virtual ~nsDocument();
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2010-01-18 09:07:08 +00:00
|
|
|
void EnsureOnloadBlocker();
|
|
|
|
|
2013-10-28 09:09:04 +00:00
|
|
|
void NotifyStyleSheetApplicableStateChanged();
|
|
|
|
|
2009-03-20 08:15:35 +00:00
|
|
|
nsTArray<nsIObserver*> mCharSetObservers;
|
2002-04-17 04:17:16 +00:00
|
|
|
|
|
|
|
PLDHashTable *mSubDocuments;
|
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
// Array of owning references to all children
|
2005-09-30 20:06:33 +00:00
|
|
|
nsAttrAndChildArray mChildren;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2005-04-28 16:57:24 +00:00
|
|
|
// Pointer to our parser if we're currently in the process of being
|
|
|
|
// parsed into.
|
|
|
|
nsCOMPtr<nsIParser> mParser;
|
|
|
|
|
2007-09-21 02:41:08 +00: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;
|
|
|
|
|
2002-11-07 02:36:24 +00:00
|
|
|
nsCOMArray<nsIStyleSheet> mStyleSheets;
|
2014-05-24 18:46:38 +00:00
|
|
|
nsCOMArray<nsIStyleSheet> mOnDemandBuiltInUASheets;
|
2012-10-29 11:21:15 +00:00
|
|
|
nsCOMArray<nsIStyleSheet> mAdditionalSheets[SheetTypeCount];
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2006-06-28 17:36:56 +00:00
|
|
|
// Array of observers
|
2007-12-20 07:30:04 +00:00
|
|
|
nsTObserverArray<nsIDocumentObserver*> mObservers;
|
2005-07-30 20:57:07 +00:00
|
|
|
|
2014-12-17 23:42:41 +00:00
|
|
|
// Tracker for animation players that are waiting to start.
|
|
|
|
// nullptr until GetOrCreatePendingPlayerTracker is called.
|
|
|
|
nsRefPtr<mozilla::PendingPlayerTracker> mPendingPlayerTracker;
|
|
|
|
|
2006-04-11 03:49:44 +00: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-06 21:59:39 +00: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 05:40:53 +00: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-23 21:01:26 +00: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.
|
2014-10-16 18:53:36 +00:00
|
|
|
static mozilla::Maybe<nsTArray<nsRefPtr<mozilla::dom::CustomElementData>>> sProcessingStack;
|
2014-02-23 21:01:26 +00:00
|
|
|
|
|
|
|
// Flag to prevent re-entrance into base element queue as described in the
|
|
|
|
// custom elements speicification.
|
|
|
|
static bool sProcessingBaseElementQueue;
|
|
|
|
|
|
|
|
static bool CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void ProcessBaseElementQueue();
|
|
|
|
|
2014-12-23 02:19:08 +00: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 16:28:04 +00:00
|
|
|
const nsAString* aTypeExtension) override;
|
2014-02-23 21:01:26 +00:00
|
|
|
|
2014-07-08 02:02:03 +00:00
|
|
|
static bool IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject);
|
2014-03-19 01:20:06 +00:00
|
|
|
|
2014-02-23 21:01:26 +00:00
|
|
|
// The "registry" from the web components spec.
|
2014-03-27 18:55:44 +00:00
|
|
|
nsRefPtr<mozilla::dom::Registry> mRegistry;
|
2012-11-01 18:18:08 +00:00
|
|
|
|
2014-03-17 06:56:53 +00:00
|
|
|
nsRefPtr<mozilla::EventListenerManager> mListenerManager;
|
2014-04-12 08:18:54 +00:00
|
|
|
nsRefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
|
2007-01-11 19:32:31 +00:00
|
|
|
nsRefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
|
2006-11-04 05:45:02 +00:00
|
|
|
nsRefPtr<nsScriptLoader> mScriptLoader;
|
1999-01-23 07:01:40 +00:00
|
|
|
nsDocHeaderData* mHeaderData;
|
2008-06-22 23:12:40 +00: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 14:04:40 +00:00
|
|
|
* 3) Additions to the DOM always update existing entries for names, and add
|
|
|
|
* new ones for IDs.
|
2008-06-22 23:12:40 +00:00
|
|
|
*/
|
|
|
|
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
|
2003-03-26 07:41:30 +00:00
|
|
|
|
2007-09-27 18:17:32 +00:00
|
|
|
nsClassHashtable<nsStringHashKey, nsRadioGroupStruct> mRadioGroups;
|
2002-07-20 23:09:24 +00:00
|
|
|
|
2011-06-23 10:39:48 +00:00
|
|
|
// Recorded time of change to 'loading' state.
|
|
|
|
mozilla::TimeStamp mLoadingTimeStamp;
|
|
|
|
|
2005-05-04 20:22:32 +00:00
|
|
|
// True if the document has been detached from its content viewer.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsGoingAway:1;
|
2003-03-26 07:41:30 +00:00
|
|
|
// True if the document is being destroyed.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mInDestructor:1;
|
2009-08-25 17:15:55 +00:00
|
|
|
|
2008-08-18 02:10:28 +00:00
|
|
|
// True if this document has ever had an HTML or SVG <title> element
|
|
|
|
// bound to it
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mMayHaveTitleElement:1;
|
2001-05-19 02:59:15 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mHasWarnedAboutBoxObjects:1;
|
2008-02-14 20:45:07 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDelayFrameLoaderInitialization:1;
|
2008-04-18 08:58:06 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mSynchronousDOMContentLoaded:1;
|
2009-01-23 23:08:41 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mInXBLUpdate:1;
|
2009-01-31 12:53:01 +00:00
|
|
|
|
2010-08-04 00:40:29 +00:00
|
|
|
// Whether we're currently holding a lock on all of our images.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mLockingImages:1;
|
2010-08-04 00:40:29 +00:00
|
|
|
|
2010-09-08 00:33:02 +00:00
|
|
|
// Whether we currently require our images to animate
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mAnimatingImages:1;
|
2010-09-08 00:33:02 +00:00
|
|
|
|
2011-12-15 04:42:15 +00: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 05:17:53 +00: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;
|
|
|
|
|
2012-05-21 20:43:36 +00:00
|
|
|
// Whether this document has been approved for fullscreen, either by explicit
|
|
|
|
// approval via the fullscreen-approval UI, or because it received
|
|
|
|
// approval because its document's host already had the "fullscreen"
|
|
|
|
// permission granted when the document requested fullscreen.
|
|
|
|
//
|
|
|
|
// Note if a document's principal doesn't have a host, the permission manager
|
|
|
|
// can't store permissions for it, so we can only manage approval using this
|
|
|
|
// flag.
|
|
|
|
//
|
|
|
|
// Note we must track this separately from the "fullscreen" permission,
|
|
|
|
// so that pending pointer lock requests can determine whether documents
|
|
|
|
// whose principal doesn't have a host (i.e. those which can't store
|
|
|
|
// permissions in the permission manager) have been approved for fullscreen.
|
|
|
|
bool mIsApprovedForFullscreen:1;
|
|
|
|
|
2013-02-26 05:40:53 +00:00
|
|
|
// Whether this document has a fullscreen approved observer. Only documents
|
|
|
|
// which request fullscreen and which don't have a pre-existing approval for
|
|
|
|
// fullscreen will have an observer.
|
|
|
|
bool mHasFullscreenApprovedObserver:1;
|
|
|
|
|
2013-03-24 10:32:44 +00:00
|
|
|
friend class nsPointerLockPermissionRequest;
|
|
|
|
friend class nsCallRequestFullScreen;
|
|
|
|
// When set, trying to lock the pointer doesn't require permission from the
|
|
|
|
// user.
|
|
|
|
bool mAllowRelocking:1;
|
|
|
|
|
|
|
|
bool mAsyncFullscreenPending:1;
|
|
|
|
|
2014-09-03 04:09:42 +00: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 09:09:04 +00:00
|
|
|
// Keeps track of whether we have a pending
|
|
|
|
// 'style-sheet-applicable-state-changed' notification.
|
|
|
|
bool mSSApplicableStateNotificationPending:1;
|
|
|
|
|
2013-03-24 10:32:44 +00:00
|
|
|
uint32_t mCancelledPointerLockRequests;
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t mXMLDeclarationBits;
|
2003-04-19 00:28:09 +00:00
|
|
|
|
2012-03-21 18:07:31 +00:00
|
|
|
nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject> *mBoxObjectTable;
|
2001-01-25 14:19:38 +00:00
|
|
|
|
2013-03-26 07:15:23 +00:00
|
|
|
// A document "without a browsing context" that owns the content of
|
|
|
|
// HTMLTemplateElement.
|
|
|
|
nsCOMPtr<nsIDocument> mTemplateContentsOwner;
|
|
|
|
|
2007-10-26 10:30:44 +00:00
|
|
|
// Our update nesting level
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mUpdateNestLevel;
|
2007-10-26 10:30:44 +00:00
|
|
|
|
2008-08-26 23:09:02 +00: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 16:50:26 +00:00
|
|
|
nsCOMPtr<nsIContent> mFirstBaseNodeWithHref;
|
|
|
|
|
2014-04-03 04:18:36 +00:00
|
|
|
mozilla::EventStates mDocumentState;
|
|
|
|
mozilla::EventStates mGotDocumentState;
|
2010-03-17 17:10:57 +00:00
|
|
|
|
2011-06-23 10:39:48 +00:00
|
|
|
nsRefPtr<nsDOMNavigationTiming> mTiming;
|
2008-02-21 20:39:20 +00:00
|
|
|
private:
|
2006-05-10 17:30:15 +00:00
|
|
|
friend class nsUnblockOnloadEvent;
|
2011-10-11 21:29:12 +00:00
|
|
|
// Recomputes the visibility state but doesn't set the new value.
|
2012-12-25 22:00:15 +00:00
|
|
|
mozilla::dom::VisibilityState GetVisibilityState() const;
|
2013-03-27 15:20:54 +00:00
|
|
|
void NotifyStyleSheetAdded(nsIStyleSheet* aSheet, bool aDocumentSheet);
|
|
|
|
void NotifyStyleSheetRemoved(nsIStyleSheet* aSheet, bool aDocumentSheet);
|
2006-05-10 17:30:15 +00:00
|
|
|
|
2005-08-23 01:29:02 +00:00
|
|
|
void PostUnblockOnloadEvent();
|
2005-08-23 18:54:35 +00:00
|
|
|
void DoUnblockOnload();
|
2005-08-23 01:29:02 +00:00
|
|
|
|
2010-07-21 15:51:09 +00:00
|
|
|
nsresult CheckFrameOptions();
|
2014-10-06 20:25:04 +00:00
|
|
|
bool IsLoopDocument(nsIChannel* aChannel);
|
2012-09-25 23:28:17 +00:00
|
|
|
nsresult InitCSP(nsIChannel* aChannel);
|
2010-01-22 21:38:21 +00:00
|
|
|
|
2013-04-08 18:35:30 +00:00
|
|
|
void FlushCSPWebConsoleErrorQueue()
|
|
|
|
{
|
|
|
|
mCSPWebConsoleErrorQueue.Flush(this);
|
|
|
|
}
|
|
|
|
|
2013-12-18 07:22:20 +00: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 19:32:31 +00: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 06:19:26 +00:00
|
|
|
bool aUpdateCSSLoader);
|
2007-01-11 19:32:31 +00:00
|
|
|
|
2011-03-26 01:05:56 +00:00
|
|
|
// Revoke any pending notifications due to mozRequestAnimationFrame calls
|
|
|
|
void RevokeAnimationFrameNotifications();
|
2011-08-08 02:24:28 +00:00
|
|
|
// Reschedule any notifications we need to handle
|
|
|
|
// mozRequestAnimationFrame, if it's OK to do so.
|
|
|
|
void MaybeRescheduleAnimationFrameNotifications();
|
2011-03-26 01:05:56 +00:00
|
|
|
|
2001-01-25 14:19:38 +00:00
|
|
|
// These are not implemented and not supported.
|
|
|
|
nsDocument(const nsDocument& aOther);
|
|
|
|
nsDocument& operator=(const nsDocument& aOther);
|
2002-04-16 11:57:17 +00:00
|
|
|
|
2005-05-12 20:53:33 +00: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 19:54:28 +00:00
|
|
|
|
2010-04-27 09:48:52 +00:00
|
|
|
// Currently active onload blockers
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mOnloadBlockCount;
|
2010-04-27 09:48:52 +00:00
|
|
|
// Onload blockers which haven't been activated yet
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mAsyncOnloadBlockCount;
|
2005-05-13 19:54:28 +00:00
|
|
|
nsCOMPtr<nsIRequest> mOnloadBlocker;
|
2010-02-24 16:37:02 +00:00
|
|
|
|
2010-02-24 16:37:03 +00: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 19:32:31 +00:00
|
|
|
|
|
|
|
// Member to store out last-selected stylesheet set.
|
|
|
|
nsString mLastStyleSheetSet;
|
2008-02-26 14:47:51 +00:00
|
|
|
|
2008-03-21 11:44:09 +00:00
|
|
|
nsTArray<nsRefPtr<nsFrameLoader> > mInitializableFrameLoaders;
|
2015-02-27 05:35:26 +00:00
|
|
|
nsTArray<nsCOMPtr<nsIRunnable> > mFrameLoaderFinalizers;
|
2009-01-31 12:53:01 +00:00
|
|
|
nsRefPtr<nsRunnableMethod<nsDocument> > mFrameLoaderRunner;
|
2001-04-12 01:05:42 +00:00
|
|
|
|
2010-04-20 17:22:04 +00:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<nsDocument, void, false> >
|
2009-05-06 20:46:01 +00:00
|
|
|
mPendingTitleChangeEvent;
|
2008-10-04 20:00:09 +00:00
|
|
|
|
|
|
|
nsExternalResourceMap mExternalResourceMap;
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2014-11-24 16:57:49 +00: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 05:23:20 +00:00
|
|
|
|
2014-12-10 23:54:00 +00:00
|
|
|
// Current depth of picture elements from parser
|
|
|
|
int32_t mPreloadPictureDepth;
|
|
|
|
|
|
|
|
// Set if we've found a URL for the current picture
|
|
|
|
nsString mPreloadPictureFoundSource;
|
|
|
|
|
2012-12-22 08:27:27 +00:00
|
|
|
nsRefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
|
2009-10-18 16:39:52 +00:00
|
|
|
|
2011-05-30 10:59:59 +00:00
|
|
|
nsRefPtr<nsContentList> mImageMaps;
|
|
|
|
|
2010-05-12 00:30:40 +00:00
|
|
|
nsCString mScrollToRef;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t mScrolledToRefAlready : 1;
|
|
|
|
uint8_t mChangeScrollPosWhenScrollingToRef : 1;
|
2010-05-12 00:30:40 +00:00
|
|
|
|
2010-08-04 00:40:29 +00:00
|
|
|
// Tracking for images in the document.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsDataHashtable< nsPtrHashKey<imgIRequest>, uint32_t> mImageTracker;
|
2010-08-04 00:40:29 +00:00
|
|
|
|
2012-03-28 15:53:56 +00:00
|
|
|
// Tracking for plugins in the document.
|
|
|
|
nsTHashtable< nsPtrHashKey<nsIObjectLoadingContent> > mPlugins;
|
|
|
|
|
2013-01-04 06:54:26 +00:00
|
|
|
nsRefPtr<mozilla::dom::UndoManager> mUndoManager;
|
|
|
|
|
2014-05-13 07:22:12 +00:00
|
|
|
nsRefPtr<mozilla::dom::AnimationTimeline> mAnimationTimeline;
|
|
|
|
|
2013-01-04 03:27:06 +00:00
|
|
|
enum ViewportType {
|
|
|
|
DisplayWidthHeight,
|
2013-12-03 15:10:26 +00:00
|
|
|
DisplayWidthHeightNoZoom,
|
2013-01-04 03:27:06 +00:00
|
|
|
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 19:12:23 +00:00
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMinFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMaxFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleFloat;
|
|
|
|
mozilla::CSSToLayoutDeviceScale mPixelRatio;
|
2014-02-25 00:22:45 +00:00
|
|
|
bool mAutoSize, mAllowZoom, mAllowDoubleTapZoom, mValidScaleFloat, mValidMaxScale, mScaleStrEmpty, mWidthStrEmpty;
|
2014-05-28 20:27:38 +00:00
|
|
|
mozilla::CSSSize mViewportSize;
|
2013-01-04 03:27:06 +00:00
|
|
|
|
2013-01-24 09:09:06 +00:00
|
|
|
nsrefcnt mStackRefCnt;
|
|
|
|
bool mNeedsReleaseAfterStackRefCntRelease;
|
|
|
|
|
2013-04-08 18:35:30 +00:00
|
|
|
CSPErrorQueue mCSPWebConsoleErrorQueue;
|
|
|
|
|
2014-05-21 17:08:12 +00:00
|
|
|
nsCOMPtr<nsIDocument> mMasterDocument;
|
|
|
|
nsRefPtr<mozilla::dom::ImportManager> mImportManager;
|
2014-10-01 12:13:53 +00:00
|
|
|
nsTArray<nsCOMPtr<nsINode> > mSubImportLinks;
|
2014-05-21 17:08:12 +00:00
|
|
|
|
2014-07-21 06:25:44 +00: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 11:27:42 +00:00
|
|
|
#ifdef DEBUG
|
2014-06-26 00:33:24 +00:00
|
|
|
public:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mWillReparent;
|
2009-07-25 11:27:42 +00:00
|
|
|
#endif
|
2008-08-18 02:10:28 +00:00
|
|
|
};
|
2008-08-16 11:27:40 +00:00
|
|
|
|
2013-01-24 09:09:06 +00:00
|
|
|
class nsDocumentOnStack
|
|
|
|
{
|
|
|
|
public:
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsDocumentOnStack(nsDocument* aDoc) : mDoc(aDoc)
|
2013-01-24 09:09:06 +00:00
|
|
|
{
|
|
|
|
mDoc->IncreaseStackRefCnt();
|
|
|
|
}
|
|
|
|
~nsDocumentOnStack()
|
|
|
|
{
|
|
|
|
mDoc->DecreaseStackRefCnt();
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
nsDocument* mDoc;
|
|
|
|
};
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#endif /* nsDocument_h___ */
|