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