2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-03-30 12:03:04 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Base class for all our document implementations.
|
|
|
|
*/
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsDocument_h___
|
|
|
|
#define nsDocument_h___
|
|
|
|
|
2013-08-22 10:30:44 +04:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCRT.h"
|
1999-08-25 14:51:55 +04:00
|
|
|
#include "nsWeakReference.h"
|
1999-09-21 10:44:56 +04:00
|
|
|
#include "nsWeakPtr.h"
|
2009-03-20 11:15:35 +03:00
|
|
|
#include "nsTArray.h"
|
2017-06-20 16:57:08 +03:00
|
|
|
#include "nsIdentifierMapEntry.h"
|
2016-09-28 22:46:44 +03:00
|
|
|
#include "nsIDOMDocument.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"
|
2017-06-24 20:23:08 +03:00
|
|
|
#include "nsRefPtrHashtable.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"
|
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"
|
2016-02-24 10:01:11 +03:00
|
|
|
#include "mozilla/StyleSetHandle.h"
|
2015-09-16 06:49:53 +03:00
|
|
|
#include "PLDHashTable.h"
|
2005-10-01 00:06:33 +04:00
|
|
|
#include "nsAttrAndChildArray.h"
|
2006-07-29 20:02:11 +04:00
|
|
|
#include "nsDOMAttributeMap.h"
|
2011-10-15 11:33:26 +04:00
|
|
|
#include "nsIContentViewer.h"
|
2008-10-05 00:00:09 +04:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2008-11-24 21:32:04 +03:00
|
|
|
#include "nsILoadContext.h"
|
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsISecurityEventSink.h"
|
|
|
|
#include "nsIChannelEventSink.h"
|
2009-07-08 09:23:20 +04:00
|
|
|
#include "imgIRequest.h"
|
2014-03-17 10:56:53 +04:00
|
|
|
#include "mozilla/EventListenerManager.h"
|
2014-04-03 08:18:36 +04:00
|
|
|
#include "mozilla/EventStates.h"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2015-04-21 04:22:09 +03:00
|
|
|
#include "mozilla/PendingAnimationTracker.h"
|
2017-06-24 20:23:08 +03:00
|
|
|
#include "mozilla/dom/BoxObject.h"
|
2012-12-22 12:27:27 +04:00
|
|
|
#include "mozilla/dom/DOMImplementation.h"
|
2017-05-08 09:24:22 +03:00
|
|
|
#include "mozilla/dom/ScriptLoader.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"
|
2015-06-19 03:09:52 +03:00
|
|
|
#include "mozilla/LinkedList.h"
|
2016-10-12 10:26:02 +03:00
|
|
|
#include "CustomElementRegistry.h"
|
2016-10-28 17:24:00 +03:00
|
|
|
#include "mozilla/dom/Performance.h"
|
2017-03-10 21:50:21 +03:00
|
|
|
#include "mozilla/Maybe.h"
|
2017-08-14 09:05:23 +03:00
|
|
|
#include "nsIURIClassifier.h"
|
2011-06-23 14:39:48 +04:00
|
|
|
|
2003-04-19 04:28:09 +04:00
|
|
|
#define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)
|
|
|
|
#define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1)
|
|
|
|
#define XML_DECLARATION_BITS_STANDALONE_EXISTS (1 << 2)
|
|
|
|
#define XML_DECLARATION_BITS_STANDALONE_YES (1 << 3)
|
|
|
|
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
class nsDOMStyleSheetSetList;
|
1999-04-01 00:49:25 +04:00
|
|
|
class nsDocument;
|
2002-07-21 03:09:24 +04:00
|
|
|
class nsIRadioVisitor;
|
|
|
|
class nsIFormControl;
|
|
|
|
struct nsRadioGroupStruct;
|
2005-05-13 23:54:28 +04:00
|
|
|
class nsOnloadBlocker;
|
2006-05-10 21:30:15 +04:00
|
|
|
class nsUnblockOnloadEvent;
|
2011-06-23 14:39:48 +04:00
|
|
|
class nsDOMNavigationTiming;
|
2012-02-02 01:58:01 +04:00
|
|
|
class nsWindowSizes;
|
2012-03-24 15:34:42 +04:00
|
|
|
class nsHtml5TreeOpExecutor;
|
2013-01-24 13:09:06 +04:00
|
|
|
class nsDocumentOnStack;
|
2013-07-26 19:37:03 +04:00
|
|
|
class nsISecurityConsoleMessage;
|
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 {
|
2016-10-13 10:04:15 +03:00
|
|
|
class ImageTracker;
|
2014-06-19 04:57:51 +04:00
|
|
|
struct LifecycleCallbacks;
|
2014-02-24 01:01:26 +04:00
|
|
|
class CallbackFunction;
|
2016-10-28 17:24:00 +03:00
|
|
|
class DOMIntersectionObserver;
|
|
|
|
class Performance;
|
2015-06-19 03:09:52 +03:00
|
|
|
|
|
|
|
struct FullscreenRequest : public LinkedListElement<FullscreenRequest>
|
|
|
|
{
|
|
|
|
explicit FullscreenRequest(Element* aElement);
|
2015-08-27 04:21:29 +03:00
|
|
|
FullscreenRequest(const FullscreenRequest&) = delete;
|
2015-06-19 03:09:52 +03:00
|
|
|
~FullscreenRequest();
|
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
Element* GetElement() const { return mElement; }
|
|
|
|
nsDocument* GetDocument() const { return mDocument; }
|
|
|
|
|
|
|
|
private:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<Element> mElement;
|
|
|
|
RefPtr<nsDocument> mDocument;
|
2015-06-19 03:09:52 +03:00
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
public:
|
2015-06-19 03:09:52 +03:00
|
|
|
// This value should be true if the fullscreen request is
|
|
|
|
// originated from chrome code.
|
|
|
|
bool mIsCallerChrome = false;
|
|
|
|
// This value denotes whether we should trigger a NewOrigin event if
|
|
|
|
// requesting fullscreen in its document causes the origin which is
|
|
|
|
// fullscreen to change. We may want *not* to trigger that event if
|
|
|
|
// we're calling RequestFullScreen() as part of a continuation of a
|
|
|
|
// request in a subdocument in different process, whereupon the caller
|
|
|
|
// need to send some notification itself with the real origin.
|
|
|
|
bool mShouldNotifyNewOrigin = true;
|
|
|
|
};
|
2015-07-13 18:25:42 +03:00
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-01-04 10:54:26 +04:00
|
|
|
|
1999-01-23 10:01:40 +03:00
|
|
|
class nsDocHeaderData
|
|
|
|
{
|
|
|
|
public:
|
2017-10-03 01:05:19 +03:00
|
|
|
nsDocHeaderData(nsAtom* 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
|
|
|
}
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
RefPtr<nsAtom> mField;
|
2003-03-26 10:41:30 +03:00
|
|
|
nsString mData;
|
|
|
|
nsDocHeaderData* mNext;
|
1999-01-23 10:01:40 +03:00
|
|
|
};
|
1998-07-01 15:16:09 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsOnloadBlocker final : public nsIRequest
|
2005-05-13 23:54:28 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsOnloadBlocker() {}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
|
|
|
|
private:
|
|
|
|
~nsOnloadBlocker() {}
|
|
|
|
};
|
2002-04-17 08:17:16 +04:00
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
class nsExternalResourceMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef nsIDocument::ExternalResourceLoad ExternalResourceLoad;
|
|
|
|
nsExternalResourceMap();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request an external resource document. This does exactly what
|
|
|
|
* nsIDocument::RequestExternalResource is documented to do.
|
|
|
|
*/
|
|
|
|
nsIDocument* RequestResource(nsIURI* aURI,
|
|
|
|
nsINode* aRequestingNode,
|
|
|
|
nsDocument* aDisplayDocument,
|
|
|
|
ExternalResourceLoad** aPendingLoad);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerate the resource documents. See
|
|
|
|
* nsIDocument::EnumerateExternalResources.
|
|
|
|
*/
|
|
|
|
void EnumerateResources(nsIDocument::nsSubDocEnumFunc aCallback, void* aData);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Traverse ourselves for cycle-collection
|
|
|
|
*/
|
|
|
|
void Traverse(nsCycleCollectionTraversalCallback* aCallback) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shut ourselves down (used for cycle-collection unlink), as well
|
|
|
|
* as for document destruction.
|
|
|
|
*/
|
|
|
|
void Shutdown()
|
|
|
|
{
|
|
|
|
mPendingLoads.Clear();
|
|
|
|
mMap.Clear();
|
2011-10-17 18:59:28 +04:00
|
|
|
mHaveShutDown = true;
|
2008-10-05 00:00:09 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool HaveShutDown() const
|
2008-10-05 00:00:09 +04:00
|
|
|
{
|
|
|
|
return mHaveShutDown;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Needs to be public so we can traverse them sanely
|
|
|
|
struct ExternalResource
|
|
|
|
{
|
|
|
|
~ExternalResource();
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
nsCOMPtr<nsIContentViewer> mViewer;
|
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
|
|
|
};
|
|
|
|
|
2010-08-12 01:05:26 +04:00
|
|
|
// Hide all our viewers
|
|
|
|
void HideViewers();
|
|
|
|
|
|
|
|
// Show all our viewers
|
|
|
|
void ShowViewers();
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
protected:
|
|
|
|
class PendingLoad : public ExternalResourceLoad,
|
|
|
|
public nsIStreamListener
|
|
|
|
{
|
2014-06-25 06:09:15 +04:00
|
|
|
~PendingLoad() {}
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit PendingLoad(nsDocument* aDisplayDocument) :
|
2008-10-05 00:00:09 +04:00
|
|
|
mDisplayDocument(aDisplayDocument)
|
|
|
|
{}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start aURI loading. This will perform the necessary security checks and
|
|
|
|
* so forth.
|
|
|
|
*/
|
|
|
|
nsresult StartLoad(nsIURI* aURI, nsINode* aRequestingNode);
|
|
|
|
|
|
|
|
/**
|
2011-10-15 11:33:26 +04:00
|
|
|
* Set up an nsIContentViewer based on aRequest. This is guaranteed to
|
2008-10-05 00:00:09 +04:00
|
|
|
* put null in *aViewer and *aLoadGroup on all failures.
|
|
|
|
*/
|
2011-10-15 11:33:26 +04:00
|
|
|
nsresult SetupViewer(nsIRequest* aRequest, nsIContentViewer** aViewer,
|
2008-10-05 00:00:09 +04:00
|
|
|
nsILoadGroup** aLoadGroup);
|
|
|
|
|
|
|
|
private:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsDocument> mDisplayDocument;
|
2008-10-05 00:00:09 +04:00
|
|
|
nsCOMPtr<nsIStreamListener> mTargetListener;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
|
|
|
};
|
|
|
|
friend class PendingLoad;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class LoadgroupCallbacks final : public nsIInterfaceRequestor
|
2008-10-05 00:00:09 +04:00
|
|
|
{
|
2014-06-25 06:09:15 +04:00
|
|
|
~LoadgroupCallbacks() {}
|
2008-10-05 00:00:09 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
|
2008-10-05 00:00:09 +04:00
|
|
|
: mCallbacks(aOtherCallbacks)
|
|
|
|
{}
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
private:
|
2008-11-24 21:32:04 +03:00
|
|
|
// The only reason it's safe to hold a strong ref here without leaking is
|
|
|
|
// that the notificationCallbacks on a loadgroup aren't the docshell itself
|
|
|
|
// but a shim that holds a weak reference to the docshell.
|
2008-10-05 00:00:09 +04:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2008-11-24 21:32:04 +03:00
|
|
|
|
|
|
|
// Use shims for interfaces that docshell implements directly so that we
|
|
|
|
// don't hand out references to the docshell. The shims should all allow
|
|
|
|
// getInterface back on us, but other than that each one should only
|
|
|
|
// implement one interface.
|
2016-07-22 00:39:00 +03:00
|
|
|
|
2008-11-24 21:32:04 +03:00
|
|
|
// XXXbz I wish we could just derive the _allcaps thing from _i
|
|
|
|
#define DECL_SHIM(_i, _allcaps) \
|
2015-03-27 21:52:19 +03:00
|
|
|
class _i##Shim final : public nsIInterfaceRequestor, \
|
|
|
|
public _i \
|
2008-11-24 21:32:04 +03:00
|
|
|
{ \
|
2014-06-25 06:09:15 +04:00
|
|
|
~_i##Shim() {} \
|
2008-11-24 21:32:04 +03:00
|
|
|
public: \
|
|
|
|
_i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr) \
|
|
|
|
: mIfReq(aIfreq), mRealPtr(aRealPtr) \
|
|
|
|
{ \
|
|
|
|
NS_ASSERTION(mIfReq, "Expected non-null here"); \
|
|
|
|
NS_ASSERTION(mRealPtr, "Expected non-null here"); \
|
|
|
|
} \
|
|
|
|
NS_DECL_ISUPPORTS \
|
2012-07-15 08:11:10 +04:00
|
|
|
NS_FORWARD_NSIINTERFACEREQUESTOR(mIfReq->) \
|
|
|
|
NS_FORWARD_##_allcaps(mRealPtr->) \
|
2008-11-24 21:32:04 +03:00
|
|
|
private: \
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mIfReq; \
|
|
|
|
nsCOMPtr<_i> mRealPtr; \
|
|
|
|
};
|
|
|
|
|
|
|
|
DECL_SHIM(nsILoadContext, NSILOADCONTEXT)
|
|
|
|
DECL_SHIM(nsIProgressEventSink, NSIPROGRESSEVENTSINK)
|
|
|
|
DECL_SHIM(nsIChannelEventSink, NSICHANNELEVENTSINK)
|
|
|
|
DECL_SHIM(nsISecurityEventSink, NSISECURITYEVENTSINK)
|
|
|
|
DECL_SHIM(nsIApplicationCacheContainer, NSIAPPLICATIONCACHECONTAINER)
|
|
|
|
#undef DECL_SHIM
|
2008-10-05 00:00:09 +04:00
|
|
|
};
|
2015-02-19 04:34:29 +03:00
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
/**
|
|
|
|
* Add an ExternalResource for aURI. aViewer and aLoadGroup might be null
|
|
|
|
* when this is called if the URI didn't result in an XML document. This
|
|
|
|
* function makes sure to remove the pending load for aURI, if any, from our
|
|
|
|
* hashtable, and to notify its observers, if any.
|
|
|
|
*/
|
2011-10-15 11:33:26 +04:00
|
|
|
nsresult AddExternalResource(nsIURI* aURI, nsIContentViewer* aViewer,
|
2008-10-05 00:00:09 +04:00
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsIDocument* aDisplayDocument);
|
2016-07-22 00:39:00 +03:00
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2017-08-14 09:05:23 +03:00
|
|
|
// For classifying a flash document based on its principal.
|
|
|
|
class PrincipalFlashClassifier;
|
|
|
|
|
2001-10-26 06:23:56 +04:00
|
|
|
// Base class for our document implementations.
|
2003-03-26 10:41:30 +03:00
|
|
|
class nsDocument : public nsIDocument,
|
2016-09-28 22:46:44 +03:00
|
|
|
public 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 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;
|
2017-12-21 04:09:22 +03:00
|
|
|
using nsIDocument::GetElementsByTagName;
|
2015-01-05 20:42:31 +03:00
|
|
|
typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
|
2010-06-23 13:31:35 +04:00
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2012-02-02 01:58:01 +04:00
|
|
|
|
Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.
Here is an example of the output.
> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │ ├──12,772,544 B (12.26%) -- layout
> │ │ ├───4,483,744 B (04.30%) -- frames
> │ │ │ ├──1,653,552 B (01.59%) ── nsInlineFrame
> │ │ │ ├──1,415,760 B (01.36%) ── nsTextFrame
> │ │ │ ├────431,376 B (00.41%) ── nsBlockFrame
> │ │ │ ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │ │ │ ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │ │ │ ├────156,408 B (00.15%) ── nsBulletFrame
> │ │ │ ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │ │ │ ├─────27,656 B (00.03%) ── sundries
> │ │ │ ├─────23,520 B (00.02%) ── nsTableCellFrame
> │ │ │ ├─────16,704 B (00.02%) ── nsImageFrame
> │ │ │ ├─────15,488 B (00.01%) ── nsTableRowFrame
> │ │ │ ├─────13,776 B (00.01%) ── nsTableColFrame
> │ │ │ └─────13,376 B (00.01%) ── nsTableFrame
> │ │ ├───3,412,192 B (03.28%) -- servo-style-structs
> │ │ │ ├──1,288,224 B (01.24%) ── Display
> │ │ │ ├────742,400 B (00.71%) ── Position
> │ │ │ ├────308,736 B (00.30%) ── Font
> │ │ │ ├────226,512 B (00.22%) ── Background
> │ │ │ ├────218,304 B (00.21%) ── TextReset
> │ │ │ ├────214,896 B (00.21%) ── Text
> │ │ │ ├────130,560 B (00.13%) ── Border
> │ │ │ ├─────81,408 B (00.08%) ── UIReset
> │ │ │ ├─────61,440 B (00.06%) ── Padding
> │ │ │ ├─────38,176 B (00.04%) ── UserInterface
> │ │ │ ├─────29,232 B (00.03%) ── Margin
> │ │ │ ├─────21,824 B (00.02%) ── sundries
> │ │ │ ├─────20,080 B (00.02%) ── Color
> │ │ │ ├─────20,080 B (00.02%) ── Column
> │ │ │ └─────10,320 B (00.01%) ── Effects
> │ │ ├───2,227,680 B (02.14%) -- computed-values
> │ │ │ ├──1,182,928 B (01.14%) ── non-dom
> │ │ │ └──1,044,752 B (01.00%) ── dom
> │ │ ├───1,500,016 B (01.44%) ── text-runs
> │ │ ├─────492,640 B (00.47%) ── line-boxes
> │ │ ├─────326,688 B (00.31%) ── frame-properties
> │ │ ├─────301,760 B (00.29%) ── pres-shell
> │ │ ├──────27,648 B (00.03%) ── pres-contexts
> │ │ └─────────176 B (00.00%) ── style-sets
The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.
Other notable things done by the patch are as follows.
- It significantly changes the signatures of the methods measuring nsINode and
its subclasses, in order to handle the tallying of style structs separately
from element-nodes. Likewise for nsIFrame.
- It renames the 'layout/style-structs' sub-tree as
'layout/gecko-style-structs', to clearly distinguish it from the new
'layout/servo-style-structs' sub-tree.
- It adds some FFI functions to access various Rust-side data structures from
C++ code.
- There is a nasty hack used twice to measure Arcs, by stepping backwards from
an interior pointer to a base pointer. It works, but I want to replace it
with something better eventually. The "XXX WARNING" comments have details.
- It makes DMD print a line to the console if it sees a pointer it doesn't
recognise. This is useful for detecting when we are measuring an interior
pointer instead of a base pointer, which is bad but easy to do when Arcs are
involved.
- It removes the Rust code for measuring CVs, because it's now all done on the
C++ side.
MozReview-Commit-ID: BKebACLKtCi
--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 09:37:33 +03:00
|
|
|
NS_DECL_ADDSIZEOFEXCLUDINGTHIS
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Reset(nsIChannel *aChannel, nsILoadGroup *aLoadGroup) override;
|
2006-11-22 21:27:54 +03:00
|
|
|
virtual void ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
2001-03-12 09:39:27 +03:00
|
|
|
|
2017-04-03 23:49:16 +03:00
|
|
|
already_AddRefed<nsIPrincipal> MaybeDowngradePrincipal(nsIPrincipal* aPrincipal);
|
|
|
|
|
2006-01-27 04:03:06 +03:00
|
|
|
// StartDocumentLoad is pure virtual so that subclasses must override it.
|
|
|
|
// The nsDocument StartDocumentLoad does some setup, but does NOT set
|
|
|
|
// *aDocListener; this is the job of subclasses.
|
2004-01-10 02:54:21 +03:00
|
|
|
virtual nsresult StartDocumentLoad(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
nsISupports* aContainer,
|
|
|
|
nsIStreamListener **aDocListener,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aReset = true,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIContentSink* aContentSink = nullptr) override = 0;
|
1999-01-06 03:32:41 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void StopDocumentLoad() override;
|
Landing changes Vidur made while the tree was closed for beta1 work, here's a list of the changes. r=me
[1] Cutting down the size of content. Made nsIJSScriptObject inherit from nsIScriptObjectOwner
[2] Cutting down the size of content. Made nsITextContent inherit from nsIContent.
[3] Cutting down the size of content. Moved implementation of nsIDOMReceiver to nsListenerManager. This is not true aggregation since it isn't transitive, but it's OK for now. It will be necessary for nsListenerManager to have a reference to its content in the future anyway, so the transitivity could be done.
dom/public/nsDOMPropEnums.h,v - bug 12559
dom/public/nsIJSScriptObject.h,v - [1]
dom/public/html/MANIFEST,v - bug 12559
dom/public/html/Makefile.in,v - bug 12559
dom/public/html/makefile.win,v - bug 12559
dom/public/html/nsIDOMHTMLInputElement.h,v - bug 17544
dom/public/idl/html/HTMLAnchorElement.idl,v - bug 12559
dom/public/idl/html/HTMLAreaElement.idl,v - bug 12559
dom/public/idl/html/HTMLInputElement.idl,v - bug 17544
dom/src/base/nsGlobalWindow.cpp,v - bug 30700
dom/src/base/nsGlobalWindow.h,v - [1]
dom/src/base/nsLocation.cpp,v - [1]
dom/src/html/nsJSHTMLAnchorElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLAreaElement.cpp,v - bug 12559
dom/src/html/nsJSHTMLInputElement.cpp,v - bug 17544
layout/base/public/nsIDocument.h,v - bug 27953
layout/base/public/nsITextContent.h,v - [2]
layout/base/src/nsCommentNode.cpp,v - [2]
layout/base/src/nsDocument.cpp,v - bug 27953
layout/base/src/nsDocument.h,v - bug 27953
layout/base/src/nsDocumentViewer.cpp,v - bug 27953
layout/base/src/nsGenericDOMDataNode.cpp,v - [3]
layout/base/src/nsGenericDOMDataNode.h,v - [3]
layout/base/src/nsGenericElement.cpp,v - [3]
layout/base/src/nsGenericElement.h,v - [3]
layout/base/src/nsNameSpaceManager.cpp,v - bug 7834
layout/base/src/nsStyleContext.cpp,v - outline property shouldn't reflow
layout/base/src/nsTextNode.cpp,v - [2]
layout/events/src/nsEventListenerManager.cpp,v - [3]
layout/events/src/nsEventListenerManager.h,v - [3]
layout/html/base/src/nsGfxScrollFrame.cpp,v - nsString->nsAutoString
layout/html/content/src/nsAttributeContent.cpp,v - [2]
layout/html/content/src/nsHTMLAnchorElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAppletElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBaseFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLBodyElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLButtonElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDirectoryElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLDivElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLEmbedElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFieldSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFontElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFormElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLFrameSetElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHRElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHeadingElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLHtmlElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIFrameElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLImageElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInputElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLInsElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLIsIndexElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLIElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLabelElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLayerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLegendElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLLinkElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMapElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMenuElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLMetaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLModElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLObjectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLOptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParagraphElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLParamElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLPreElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLQuoteElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLScriptElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSelectElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpacerElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLSpanElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLStyleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCaptionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableCellElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableColGroupElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableRowElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTableSectionElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTextAreaElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLTitleElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLUListElement.cpp,v - [1][3]
layout/html/content/src/nsHTMLWBRElement.cpp,v - [1][3]
layout/html/document/src/nsHTMLDocument.cpp,v - bug 27953
layout/html/document/src/nsHTMLDocument.h,v - bug 27953
layout/xml/content/src/nsXMLCDATASection.cpp,v - [1][2]
layout/xml/content/src/nsXMLDocumentType.cpp,v - [1][2]
layout/xml/content/src/nsXMLElement.h,v - [1][2]
layout/xml/content/src/nsXMLEntity.cpp,v - [1][2]
layout/xml/content/src/nsXMLNotation.cpp,v - [1][2]
layout/xml/content/src/nsXMLProcessingInstruction.cpp,v - [1][2]
layout/xul/base/src/nsBoxFrame.cpp,v - nsString->nsAutoString
layout/xul/base/src/nsSliderFrame.cpp,v - nsString->nsAutoString
netwerk/protocol/http/src/nsHTTPRequest.cpp,v - nsString->nsAutoString
rdf/content/src/nsXULDocument.cpp,v - bug 27953
rdf/content/src/nsXULDocument.h,v - bug 27953
rdf/content/src/nsXULElement.h,v - [1]
xpcom/base/IIDS.h,v - bug 12559
2000-03-17 16:27:00 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void NotifyPossibleTitleChange(bool aBoundTitleElement) override;
|
2008-08-18 06:10:28 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetDocumentURI(nsIURI* aURI) override;
|
2011-08-09 16:35:00 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetChromeXHRDocURI(nsIURI* aURI) override;
|
2013-09-25 01:56:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetChromeXHRDocBaseURI(nsIURI* aURI) override;
|
2013-09-25 01:56:52 +04:00
|
|
|
|
2015-11-15 06:28:38 +03:00
|
|
|
virtual void ApplySettingsFromCSP(bool aSpeculative) override;
|
|
|
|
|
2017-03-17 02:47:35 +03:00
|
|
|
virtual already_AddRefed<nsIParser> CreatorParserOrNull() override;
|
|
|
|
|
2000-03-21 07:09:58 +03:00
|
|
|
/**
|
2003-10-22 02:11:49 +04:00
|
|
|
* Set the principal responsible for this document.
|
2000-03-21 07:09:58 +03:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetPrincipal(nsIPrincipal *aPrincipal) override;
|
2000-03-21 07:09:58 +03:00
|
|
|
|
2003-01-09 18:45:45 +03:00
|
|
|
/**
|
|
|
|
* Get the Content-Type of this document.
|
|
|
|
*/
|
|
|
|
// NS_IMETHOD GetContentType(nsAString& aContentType);
|
2011-05-28 11:43:53 +04:00
|
|
|
// Already declared in nsIDOMDocument
|
2003-01-09 18:45:45 +03:00
|
|
|
|
|
|
|
/**
|
2003-04-19 20:53:44 +04:00
|
|
|
* Set the Content-Type of this document.
|
2003-01-09 18:45:45 +03:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetContentType(const nsAString& aContentType) override;
|
1998-10-02 01:43:49 +04:00
|
|
|
|
2016-04-26 12:48:29 +03:00
|
|
|
virtual void SetBaseURI(nsIURI* aURI) override;
|
2001-05-01 03:35:09 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/Set the base target of a link in a document.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetBaseTarget(nsAString &aBaseTarget) override;
|
1999-01-15 04:53:50 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
2017-06-18 14:37:50 +03:00
|
|
|
* Set the document's character encoding. This will
|
1998-04-14 00:24:54 +04:00
|
|
|
* trigger a startDocumentLoad if necessary to answer the question.
|
|
|
|
*/
|
2017-06-18 14:37:50 +03:00
|
|
|
virtual void
|
|
|
|
SetDocumentCharacterSet(NotNull<const Encoding*> aEncoding) override;
|
2001-12-26 06:17:59 +03:00
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
virtual Element* AddIDTargetObserver(nsAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 19:28:04 +03:00
|
|
|
void* aData, bool aForImage) override;
|
2017-10-03 01:05:19 +03:00
|
|
|
virtual void RemoveIDTargetObserver(nsAtom* aID, IDTargetObserver aObserver,
|
2015-03-21 19:28:04 +03:00
|
|
|
void* aData, bool aForImage) override;
|
2008-06-25 05:55:01 +04:00
|
|
|
|
1999-01-23 10:01:40 +03:00
|
|
|
/**
|
|
|
|
* Access HTTP header data (this may also get set from other sources, like
|
|
|
|
* HTML META tags).
|
|
|
|
*/
|
2017-10-03 01:05:19 +03:00
|
|
|
virtual void GetHeaderData(nsAtom* aHeaderField, nsAString& aData) const override;
|
|
|
|
virtual void SetHeaderData(nsAtom* aheaderField,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aData) override;
|
1999-01-23 10:01:40 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Create a new presentation shell that will use aContext for
|
2013-04-01 14:26:37 +04:00
|
|
|
* its presentation context (presentation contexts <b>must not</b> be
|
|
|
|
* shared among multiple presentation shells).
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2017-01-04 10:32:18 +03:00
|
|
|
already_AddRefed<nsIPresShell> CreateShell(nsPresContext* aContext,
|
|
|
|
nsViewManager* aViewManager,
|
|
|
|
mozilla::StyleSetHandle aStyleSet)
|
|
|
|
final;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DeleteShell() override;
|
2004-01-10 02:54:21 +03:00
|
|
|
|
2017-02-06 23:47:00 +03:00
|
|
|
virtual bool GetAllowPlugins() override;
|
2012-08-20 22:34:32 +04:00
|
|
|
|
2016-04-18 03:16:04 +03:00
|
|
|
static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
|
2015-01-08 07:53:24 +03:00
|
|
|
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
|
2017-11-20 08:18:43 +03:00
|
|
|
static bool IsWebAnimationsEnabled(mozilla::dom::CallerType aCallerType);
|
2015-04-10 04:34:22 +03:00
|
|
|
virtual mozilla::dom::DocumentTimeline* Timeline() override;
|
2016-01-06 22:21:00 +03:00
|
|
|
virtual void GetAnimations(
|
|
|
|
nsTArray<RefPtr<mozilla::dom::Animation>>& aAnimations) override;
|
2016-10-09 16:36:56 +03:00
|
|
|
mozilla::LinkedList<mozilla::dom::DocumentTimeline>& Timelines() override
|
|
|
|
{
|
|
|
|
return mTimelines;
|
|
|
|
}
|
2014-05-13 11:22:12 +04:00
|
|
|
|
2011-10-30 00:22:19 +04:00
|
|
|
virtual nsresult SetSubDocumentFor(Element* aContent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIDocument* aSubDoc) override;
|
|
|
|
virtual nsIDocument* GetSubDocumentFor(nsIContent* aContent) const override;
|
|
|
|
virtual Element* FindContentForSubDocument(nsIDocument *aDocument) const override;
|
|
|
|
virtual Element* GetRootElementInternal() const override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet) override;
|
2014-05-24 22:46:38 +04:00
|
|
|
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void AddStyleSheet(mozilla::StyleSheet* aSheet) override;
|
|
|
|
virtual void RemoveStyleSheet(mozilla::StyleSheet* aSheet) override;
|
2015-11-17 09:04:09 +03:00
|
|
|
|
|
|
|
virtual void UpdateStyleSheets(
|
2016-09-26 15:03:25 +03:00
|
|
|
nsTArray<RefPtr<mozilla::StyleSheet>>& aOldSheets,
|
|
|
|
nsTArray<RefPtr<mozilla::StyleSheet>>& aNewSheets) override;
|
|
|
|
virtual void AddStyleSheetToStyleSets(mozilla::StyleSheet* aSheet);
|
|
|
|
virtual void RemoveStyleSheetFromStyleSets(mozilla::StyleSheet* aSheet);
|
2015-11-17 09:04:09 +03:00
|
|
|
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void InsertStyleSheetAt(mozilla::StyleSheet* aSheet,
|
2017-12-18 00:29:10 +03:00
|
|
|
size_t aIndex) override;
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void SetStyleSheetApplicableState(mozilla::StyleSheet* aSheet,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aApplicable) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
|
|
|
|
nsIURI* aSheetURI) override;
|
|
|
|
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
|
2016-09-26 15:03:25 +03:00
|
|
|
mozilla::StyleSheet* aSheet) override;
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
|
|
|
|
nsIURI* sheetURI) override;
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual mozilla::StyleSheet* GetFirstAdditionalAuthorSheet() override;
|
2012-09-11 15:51:10 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIChannel* GetChannel() const override {
|
2005-06-01 05:15:23 +04:00
|
|
|
return mChannel;
|
|
|
|
}
|
2004-07-28 11:08:41 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIChannel* GetFailedChannel() const override {
|
2014-06-20 00:55:55 +04:00
|
|
|
return mFailedChannel;
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetFailedChannel(nsIChannel* aChannel) override {
|
2014-06-20 00:55:55 +04:00
|
|
|
mFailedChannel = aChannel;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) override;
|
1998-06-26 02:26:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject) override;
|
2007-10-01 14:02:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIGlobalObject* GetScopeObject() const override;
|
|
|
|
void SetScopeObject(nsIGlobalObject* aGlobal) override;
|
2001-05-17 09:54:16 +04:00
|
|
|
/**
|
|
|
|
* Get the script loader for this document
|
2003-03-26 10:41:30 +03:00
|
|
|
*/
|
2017-05-08 09:24:22 +03:00
|
|
|
virtual mozilla::dom::ScriptLoader* ScriptLoader() override;
|
2001-05-17 09:54:16 +04:00
|
|
|
|
2010-06-04 05:09:20 +04:00
|
|
|
/**
|
|
|
|
* Add/Remove an element to the document's id and name hashes
|
|
|
|
*/
|
2017-10-03 01:05:19 +03:00
|
|
|
virtual void AddToIdTable(Element* aElement, nsAtom* aId) override;
|
|
|
|
virtual void RemoveFromIdTable(Element* aElement, nsAtom* aId) override;
|
|
|
|
virtual void AddToNameTable(Element* aElement, nsAtom* aName) override;
|
|
|
|
virtual void RemoveFromNameTable(Element* aElement, nsAtom* aName) override;
|
2010-06-04 05:09:20 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Add a new observer of document change notifications. Whenever
|
|
|
|
* content is changed, appended, inserted or removed the observers are
|
|
|
|
* informed.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an observer of document change notifications. This will
|
|
|
|
* return false if the observer cannot be found.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RemoveObserver(nsIDocumentObserver* aObserver) override;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2003-10-03 01:29:40 +04:00
|
|
|
// Observation hooks used to propagate notifications to document
|
|
|
|
// observers.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void BeginUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void EndUpdate(nsUpdateType aUpdateType) override;
|
|
|
|
virtual void BeginLoad() override;
|
|
|
|
virtual void EndLoad() override;
|
2009-01-09 20:12:09 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetReadyStateInternal(ReadyState rs) override;
|
2009-01-09 20:12:09 +03:00
|
|
|
|
2011-03-29 07:32:11 +04:00
|
|
|
virtual void ContentStateChanged(nsIContent* aContent,
|
2014-04-03 08:18:36 +04:00
|
|
|
mozilla::EventStates aStateMask)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-04-03 08:18:36 +04:00
|
|
|
virtual void DocumentStatesChanged(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::EventStates aStateMask) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet,
|
2015-11-21 01:34:12 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet,
|
2015-11-05 11:44:10 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2016-09-26 15:03:25 +03:00
|
|
|
virtual void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet,
|
2015-11-05 11:44:10 +03:00
|
|
|
mozilla::css::Rule* aStyleRule) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2017-05-23 05:27:13 +03:00
|
|
|
virtual void FlushPendingNotifications(mozilla::FlushType aType,
|
|
|
|
mozilla::FlushTarget aTarget
|
|
|
|
= mozilla::FlushTarget::Normal) override;
|
2017-01-05 10:31:56 +03:00
|
|
|
virtual void FlushExternalResources(mozilla::FlushType aType) override;
|
2014-01-04 19:02:17 +04:00
|
|
|
virtual void SetXMLDeclaration(const char16_t *aVersion,
|
|
|
|
const char16_t *aEncoding,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int32_t aStandalone) override;
|
2003-10-22 10:09:48 +04:00
|
|
|
virtual void GetXMLDeclaration(nsAString& aVersion,
|
|
|
|
nsAString& aEncoding,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsAString& Standalone) override;
|
|
|
|
virtual bool IsScriptEnabled() override;
|
2004-01-10 02:54:21 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void OnPageShow(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
|
|
|
virtual void OnPageHide(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
|
2013-04-06 04:44:15 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void WillDispatchMutationEvent(nsINode* aTarget) override;
|
|
|
|
virtual void MutationEventDispatched(nsINode* aTarget) override;
|
2005-06-16 03:52:46 +04:00
|
|
|
|
2006-01-19 06:34:18 +03:00
|
|
|
// nsINode
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsNodeOfType(uint32_t aFlags) const override;
|
|
|
|
virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
|
|
|
|
virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
|
|
|
|
virtual uint32_t GetChildCount() const override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
|
|
|
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
|
2017-04-20 22:57:48 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) const override
|
2006-09-05 14:22:54 +04:00
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
2006-01-19 06:34:18 +03:00
|
|
|
|
2002-07-21 03:09:24 +04:00
|
|
|
// nsIRadioGroupContainer
|
|
|
|
NS_IMETHOD WalkRadioGroup(const nsAString& aName,
|
2006-02-08 08:56:13 +03:00
|
|
|
nsIRadioVisitor* aVisitor,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aFlushContent) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
virtual void
|
|
|
|
SetCurrentRadioButton(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::dom::HTMLInputElement* aRadio) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
virtual mozilla::dom::HTMLInputElement*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetCurrentRadioButton(const nsAString& aName) override;
|
2013-08-10 05:17:51 +04:00
|
|
|
NS_IMETHOD
|
|
|
|
GetNextRadioButton(const nsAString& aName,
|
|
|
|
const bool aPrevious,
|
|
|
|
mozilla::dom::HTMLInputElement* aFocusedRadio,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::dom::HTMLInputElement** aRadioOut) override;
|
2012-08-03 14:38:52 +04:00
|
|
|
virtual void AddToRadioGroup(const nsAString& aName,
|
2017-08-03 09:39:00 +03:00
|
|
|
mozilla::dom::HTMLInputElement* aRadio) override;
|
2012-08-03 14:38:52 +04:00
|
|
|
virtual void RemoveFromRadioGroup(const nsAString& aName,
|
2017-08-03 09:39:00 +03:00
|
|
|
mozilla::dom::HTMLInputElement* aRadio) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual uint32_t GetRequiredRadioCount(const nsAString& aName) const override;
|
2014-11-28 04:40:00 +03:00
|
|
|
virtual void RadioRequiredWillChange(const nsAString& aName,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aRequiredAdded) override;
|
|
|
|
virtual bool GetValueMissingState(const nsAString& aName) const override;
|
|
|
|
virtual void SetValueMissingState(const nsAString& aName, bool aValue) override;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2002-07-21 03:09:24 +04:00
|
|
|
// for radio group
|
2012-08-04 11:44:00 +04:00
|
|
|
nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
|
|
|
|
nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
|
2002-07-21 03:09:24 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsViewportInfo GetViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) override;
|
2013-01-04 07:27:06 +04:00
|
|
|
|
2017-01-11 17:52:23 +03:00
|
|
|
enum class UseCounterReportKind {
|
|
|
|
// Flush the document's use counters only; the use counters for any
|
|
|
|
// external resource documents will be flushed when the external
|
|
|
|
// resource documents themselves are destroyed.
|
|
|
|
eDefault,
|
|
|
|
|
|
|
|
// Flush use counters for the document and for its external resource
|
|
|
|
// documents. (Should only be necessary for tests, where we need
|
|
|
|
// flushing to happen synchronously and deterministically.)
|
|
|
|
eIncludeExternalResources,
|
|
|
|
};
|
|
|
|
|
|
|
|
void ReportUseCounters(UseCounterReportKind aKind = UseCounterReportKind::eDefault);
|
2015-06-03 19:39:18 +03:00
|
|
|
|
2016-10-28 17:24:00 +03:00
|
|
|
virtual void AddIntersectionObserver(
|
|
|
|
mozilla::dom::DOMIntersectionObserver* aObserver) override;
|
|
|
|
virtual void RemoveIntersectionObserver(
|
|
|
|
mozilla::dom::DOMIntersectionObserver* aObserver) override;
|
|
|
|
virtual void UpdateIntersectionObservations() override;
|
|
|
|
virtual void ScheduleIntersectionObserverNotification() override;
|
|
|
|
virtual void NotifyIntersectionObservers() override;
|
|
|
|
|
2016-11-08 05:23:12 +03:00
|
|
|
virtual void NotifyLayerManagerRecreated() override;
|
|
|
|
|
2017-02-23 04:19:04 +03:00
|
|
|
virtual void ScheduleSVGForPresAttrEvaluation(nsSVGElement* aSVG) override;
|
|
|
|
virtual void UnscheduleSVGForPresAttrEvaluation(nsSVGElement* aSVG) override;
|
|
|
|
virtual void ResolveScheduledSVGPresAttrs() override;
|
2017-08-03 14:00:41 +03:00
|
|
|
bool IsSynthesized();
|
2016-10-28 17:24:00 +03:00
|
|
|
|
2017-12-09 06:25:14 +03:00
|
|
|
// Check whether web components are enabled for the global of aObject.
|
|
|
|
static bool IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject);
|
|
|
|
// Check whether web components are enabled for the document this node belongs
|
|
|
|
// to.
|
|
|
|
static bool IsWebComponentsEnabled(const nsINode* aNode);
|
2012-08-04 11:44:00 +04:00
|
|
|
private:
|
2016-09-26 15:03:25 +03:00
|
|
|
void AddOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet);
|
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
|
|
|
|
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
|
2016-10-21 05:11:07 +03:00
|
|
|
virtual nsresult GetEventTargetParent(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::EventChainPreVisitor& aVisitor) override;
|
2014-03-17 10:56:53 +04:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetOrCreateListenerManager() override;
|
2014-03-17 10:56:53 +04:00
|
|
|
virtual mozilla::EventListenerManager*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetExistingListenerManager() const override;
|
1999-03-29 02:22:54 +04:00
|
|
|
|
2003-10-22 10:09:48 +04:00
|
|
|
// nsIScriptObjectPrincipal
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
2003-10-22 10:09:48 +04:00
|
|
|
|
2008-08-27 03:09:02 +04:00
|
|
|
// nsIApplicationCacheContainer
|
|
|
|
NS_DECL_NSIAPPLICATIONCACHECONTAINER
|
|
|
|
|
2013-07-04 19:39:24 +04:00
|
|
|
NS_DECL_NSIDOMXPATHEVALUATOR
|
|
|
|
|
2002-01-25 09:37:35 +03:00
|
|
|
virtual nsresult Init();
|
|
|
|
|
2015-08-13 14:50:00 +03:00
|
|
|
virtual already_AddRefed<Element> CreateElem(const nsAString& aName,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* aPrefix,
|
2016-06-06 13:43:39 +03:00
|
|
|
int32_t aNamespaceID,
|
2016-09-01 13:08:50 +03:00
|
|
|
const nsAString* aIs = nullptr) override;
|
2004-06-25 16:26:02 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Sanitize() override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void EnumerateSubDocuments(nsSubDocEnumFunc aCallback,
|
2015-03-21 19:28:04 +03:00
|
|
|
void *aData) override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool CanSavePresentation(nsIRequest *aNewRequest) override;
|
|
|
|
virtual void Destroy() override;
|
|
|
|
virtual void RemovedFromDocShell() override;
|
|
|
|
virtual already_AddRefed<nsILayoutHistoryState> GetLayoutHistoryState() const override;
|
2005-05-05 00:22:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void BlockOnload() override;
|
|
|
|
virtual void UnblockOnload(bool aFireSync) override;
|
2005-05-13 23:54:28 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddStyleRelevantLink(mozilla::dom::Link* aLink) override;
|
|
|
|
virtual void ForgetLink(mozilla::dom::Link* aLink) override;
|
2005-08-11 00:21:44 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ClearBoxObjectFor(nsIContent* aContent) override;
|
2014-10-15 00:15:21 +04:00
|
|
|
|
|
|
|
virtual already_AddRefed<mozilla::dom::BoxObject>
|
|
|
|
GetBoxObjectFor(mozilla::dom::Element* aElement,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& aRv) override;
|
2005-10-27 18:09:23 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual Element*
|
2012-05-28 08:52:53 +04:00
|
|
|
GetAnonymousElementByAttribute(nsIContent* aElement,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* aAttrName,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aAttrValue) const override;
|
2008-11-05 06:58:22 +03:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual Element* ElementFromPointHelper(float aX, float aY,
|
2016-01-16 23:21:43 +03:00
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aFlushLayout) override;
|
|
|
|
|
|
|
|
virtual void ElementsFromPointHelper(float aX, float aY,
|
|
|
|
uint32_t aFlags,
|
|
|
|
nsTArray<RefPtr<mozilla::dom::Element>>& aElements) override;
|
2008-11-05 06:58:22 +03:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult NodesFromRectHelper(float aX, float aY,
|
2010-04-08 04:31:26 +04:00
|
|
|
float aTopSize, float aRightSize,
|
|
|
|
float aBottomSize, float aLeftSize,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aFlushLayout,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIDOMNodeList** aReturn) override;
|
2010-04-08 04:31:26 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void FlushSkinBindings() override;
|
2008-03-21 14:44:09 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) override;
|
|
|
|
virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) override;
|
|
|
|
virtual void TryCancelFrameLoaderInitialization(nsIDocShell* aShell) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsIDocument*
|
2008-10-05 00:00:09 +04:00
|
|
|
RequestExternalResource(nsIURI* aURI,
|
|
|
|
nsINode* aRequestingNode,
|
2015-03-21 19:28:04 +03:00
|
|
|
ExternalResourceLoad** aPendingLoad) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
EnumerateExternalResources(nsSubDocEnumFunc aCallback, void* aData) override;
|
2007-02-17 02:02:08 +03:00
|
|
|
|
2010-03-03 10:09:51 +03:00
|
|
|
// Returns our (lazily-initialized) animation controller.
|
|
|
|
// If HasAnimationController is true, this is guaranteed to return non-null.
|
2015-03-21 19:28:04 +03:00
|
|
|
nsSMILAnimationController* GetAnimationController() override;
|
2009-01-15 07:38:07 +03:00
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
virtual mozilla::PendingAnimationTracker*
|
|
|
|
GetPendingAnimationTracker() final override
|
2014-12-18 02:42:41 +03:00
|
|
|
{
|
2015-04-21 04:22:09 +03:00
|
|
|
return mPendingAnimationTracker;
|
2014-12-18 02:42:41 +03:00
|
|
|
}
|
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
virtual mozilla::PendingAnimationTracker*
|
|
|
|
GetOrCreatePendingAnimationTracker() override;
|
2014-12-18 02:42:41 +03:00
|
|
|
|
2017-02-22 09:00:00 +03:00
|
|
|
virtual void SuppressEventHandling(uint32_t aIncrease) override;
|
2014-02-27 03:58:21 +04:00
|
|
|
|
2017-02-22 09:00:00 +03:00
|
|
|
virtual void UnsuppressEventHandlingAndFireEvents(bool aFireEvents) override;
|
2009-03-03 23:11:14 +03:00
|
|
|
|
2011-08-08 06:24:28 +04:00
|
|
|
void DecreaseEventSuppression() {
|
2014-02-27 03:58:21 +04:00
|
|
|
MOZ_ASSERT(mEventsSuppressed);
|
2011-08-08 06:24:28 +04:00
|
|
|
--mEventsSuppressed;
|
2017-03-27 21:52:36 +03:00
|
|
|
UpdateFrameRequestCallbackSchedulingState();
|
2011-08-08 06:24:28 +04:00
|
|
|
}
|
2009-03-03 23:11:14 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDocument* GetTemplateContentsOwner() override;
|
2013-03-26 11:15:23 +04:00
|
|
|
|
2012-01-31 00:08:13 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
|
|
|
|
nsIDocument)
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2008-08-18 06:10:28 +04:00
|
|
|
void DoNotifyPossibleTitleChange();
|
|
|
|
|
2008-10-05 00:00:09 +04:00
|
|
|
nsExternalResourceMap& ExternalResourceMap()
|
|
|
|
{
|
|
|
|
return mExternalResourceMap;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetLoadedAsData(bool aLoadedAsData) { mLoadedAsData = aLoadedAsData; }
|
2011-11-04 00:39:08 +04:00
|
|
|
void SetLoadedAsInteractiveData(bool aLoadedAsInteractiveData)
|
|
|
|
{
|
|
|
|
mLoadedAsInteractiveData = aLoadedAsInteractiveData;
|
|
|
|
}
|
2008-09-18 15:15:47 +04:00
|
|
|
|
2017-04-20 22:57:48 +03:00
|
|
|
nsresult CloneDocHelper(nsDocument* clone, bool aPreallocateChildren) const;
|
2008-09-18 15:15:47 +04:00
|
|
|
|
2009-01-31 15:53:01 +03:00
|
|
|
void MaybeInitializeFinalizeFrameLoaders();
|
|
|
|
|
|
|
|
void MaybeEndOutermostXBLUpdate();
|
2009-07-08 09:23:20 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void PreloadPictureOpened() override;
|
|
|
|
virtual void PreloadPictureClosed() override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
|
|
|
virtual void
|
|
|
|
PreloadPictureImageSource(const nsAString& aSrcsetAttr,
|
|
|
|
const nsAString& aSizesAttr,
|
|
|
|
const nsAString& aTypeAttr,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsAString& aMediaAttr) override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
|
|
|
virtual already_AddRefed<nsIURI>
|
|
|
|
ResolvePreloadImage(nsIURI *aBaseURI,
|
|
|
|
const nsAString& aSrcAttr,
|
|
|
|
const nsAString& aSrcsetAttr,
|
2017-08-21 13:24:40 +03:00
|
|
|
const nsAString& aSizesAttr,
|
|
|
|
bool *aIsImgSet) override;
|
2014-12-11 02:54:00 +03:00
|
|
|
|
2011-07-29 22:30:00 +04:00
|
|
|
virtual void MaybePreLoadImage(nsIURI* uri,
|
2014-11-18 16:46:53 +03:00
|
|
|
const nsAString &aCrossOriginAttr,
|
2017-08-21 13:24:40 +03:00
|
|
|
ReferrerPolicy aReferrerPolicy,
|
|
|
|
bool aIsImgSet) override;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ForgetImagePreload(nsIURI* aURI) override;
|
2009-10-30 04:48:38 +03:00
|
|
|
|
2015-06-20 00:11:42 +03:00
|
|
|
virtual void MaybePreconnect(nsIURI* uri,
|
|
|
|
mozilla::CORSMode aCORSMode) override;
|
2015-05-06 03:55:18 +03:00
|
|
|
|
2017-08-29 16:01:42 +03:00
|
|
|
virtual void PreloadStyle(nsIURI* uri,
|
|
|
|
const mozilla::Encoding* aEncoding,
|
2014-11-18 16:46:47 +03:00
|
|
|
const nsAString& aCrossOriginAttr,
|
2015-08-13 06:19:11 +03:00
|
|
|
ReferrerPolicy aReferrerPolicy,
|
|
|
|
const nsAString& aIntegrity) override;
|
2010-03-03 00:00:39 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual nsresult LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
|
2016-09-26 15:03:25 +03:00
|
|
|
RefPtr<mozilla::StyleSheet>* aSheet) override;
|
2010-03-03 00:00:39 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsISupports* GetCurrentContentSink() override;
|
2009-10-30 04:48:38 +03:00
|
|
|
|
2010-04-27 13:48:52 +04:00
|
|
|
// Only BlockOnload should call this!
|
|
|
|
void AsyncBlockOnload();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetScrollToRef(nsIURI *aDocumentURI) override;
|
|
|
|
virtual void ScrollToRef() override;
|
|
|
|
virtual void ResetScrolledToRefAlready() override;
|
|
|
|
virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) override;
|
2010-05-12 04:30:40 +04:00
|
|
|
|
2017-12-21 04:09:22 +03:00
|
|
|
virtual Element *GetElementById(const nsAString& aElementId) override;
|
|
|
|
virtual const nsTArray<Element*>* GetAllElementsForId(const nsAString& aElementId) const override;
|
|
|
|
|
|
|
|
virtual Element *LookupImageElement(const nsAString& aElementId) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
virtual void MozSetImageElement(const nsAString& aImageElementId,
|
2015-03-21 19:28:04 +03:00
|
|
|
Element* aElement) override;
|
2010-04-19 19:41:38 +04:00
|
|
|
|
2012-03-28 19:53:56 +04:00
|
|
|
// AddPlugin adds a plugin-related element to mPlugins when the element is
|
|
|
|
// added to the tree.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult AddPlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
// RemovePlugin removes a plugin-related element to mPlugins when the
|
|
|
|
// element is removed from the tree.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RemovePlugin(nsIObjectLoadingContent* aPlugin) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
// GetPlugins returns the plugin-related elements from
|
|
|
|
// the frame and any subframes.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetPlugins(nsTArray<nsIObjectLoadingContent*>& aPlugins) override;
|
2012-03-28 19:53:56 +04:00
|
|
|
|
2015-05-12 01:07:49 +03:00
|
|
|
// Adds an element to mResponsiveContent when the element is
|
|
|
|
// added to the tree.
|
|
|
|
virtual nsresult AddResponsiveContent(nsIContent* aContent) override;
|
|
|
|
// Removes an element from mResponsiveContent when the element is
|
|
|
|
// removed from the tree.
|
|
|
|
virtual void RemoveResponsiveContent(nsIContent* aContent) override;
|
|
|
|
// Notifies any responsive content added by AddResponsiveContent upon media
|
|
|
|
// features values changing.
|
|
|
|
virtual void NotifyMediaFeatureValuesChanged() override;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetStateObject(nsIVariant** aResult) override;
|
2011-03-25 18:03:33 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsDOMNavigationTiming* GetNavigationTiming() const override;
|
|
|
|
virtual nsresult SetNavigationTiming(nsDOMNavigationTiming* aTiming) override;
|
2011-06-23 14:39:48 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual Element* FindImageMap(const nsAString& aNormalizedMapName) override;
|
2011-05-30 14:59:59 +04:00
|
|
|
|
2015-10-07 06:04:32 +03:00
|
|
|
virtual nsTArray<Element*> GetFullscreenStack() const override;
|
2015-06-19 03:09:52 +03:00
|
|
|
virtual void AsyncRequestFullScreen(
|
|
|
|
mozilla::UniquePtr<FullscreenRequest>&& aRequest) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RestorePreviousFullScreenState() override;
|
|
|
|
virtual bool IsFullscreenLeaf() override;
|
2015-05-21 00:52:26 +03:00
|
|
|
virtual nsresult
|
|
|
|
RemoteFrameFullscreenChanged(nsIDOMElement* aFrameElement) override;
|
2012-07-31 06:09:31 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult RemoteFrameFullscreenReverted() override;
|
|
|
|
virtual nsIDocument* GetFullscreenRoot() override;
|
|
|
|
virtual void SetFullscreenRoot(nsIDocument* aRoot) override;
|
2012-05-22 00:43:36 +04:00
|
|
|
|
2014-06-25 04:37:03 +04:00
|
|
|
// Returns the size of the mBlockedTrackingNodes array. (nsIDocument.h)
|
|
|
|
//
|
|
|
|
// This array contains nodes that have been blocked to prevent
|
|
|
|
// user tracking. They most likely have had their nsIChannel
|
|
|
|
// canceled by the URL classifier (Safebrowsing).
|
|
|
|
//
|
|
|
|
// A script can subsequently use GetBlockedTrackingNodes()
|
|
|
|
// to get a list of references to these nodes.
|
|
|
|
//
|
|
|
|
// Note:
|
|
|
|
// This expresses how many tracking nodes have been blocked for this
|
|
|
|
// document since its beginning, not how many of them are still around
|
|
|
|
// in the DOM tree. Weak references to blocked nodes are added in the
|
|
|
|
// mBlockedTrackingNodesArray but they are not removed when those nodes
|
|
|
|
// are removed from the tree or even garbage collected.
|
|
|
|
long BlockedTrackingNodeCount() const;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Returns strong references to mBlockedTrackingNodes. (nsIDocument.h)
|
|
|
|
//
|
|
|
|
// This array contains nodes that have been blocked to prevent
|
|
|
|
// user tracking. They most likely have had their nsIChannel
|
|
|
|
// canceled by the URL classifier (Safebrowsing).
|
|
|
|
//
|
|
|
|
already_AddRefed<nsSimpleContentList> BlockedTrackingNodes() const;
|
|
|
|
|
2016-05-02 07:26:04 +03:00
|
|
|
static bool IsUnprefixedFullscreenEnabled(JSContext* aCx, JSObject* aObject);
|
|
|
|
|
2015-06-10 14:13:12 +03:00
|
|
|
// Do the "fullscreen element ready check" from the fullscreen spec.
|
|
|
|
// It returns true if the given element is allowed to go into fullscreen.
|
|
|
|
bool FullscreenElementReadyCheck(Element* aElement, bool aWasCallerChrome);
|
|
|
|
|
2011-11-04 23:05:16 +04:00
|
|
|
// This is called asynchronously by nsIDocument::AsyncRequestFullScreen()
|
2015-06-10 14:13:12 +03:00
|
|
|
// to move this document into full-screen mode if allowed.
|
2015-06-19 03:09:52 +03:00
|
|
|
void RequestFullScreen(mozilla::UniquePtr<FullscreenRequest>&& aRequest);
|
2011-11-04 23:05:16 +04:00
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Removes all elements from the full-screen stack, removing full-scren
|
|
|
|
// styles from the top element in the stack.
|
2012-05-22 00:43:36 +04:00
|
|
|
void CleanupFullscreenState();
|
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Pushes aElement onto the full-screen stack, and removes full-screen styles
|
|
|
|
// from the former full-screen stack top, and its ancestors, and applies the
|
|
|
|
// styles to aElement. aElement becomes the new "full-screen element".
|
|
|
|
bool FullScreenStackPush(Element* aElement);
|
|
|
|
|
|
|
|
// Remove the top element from the full-screen stack. Removes the full-screen
|
|
|
|
// styles from the former top element, and applies them to the new top
|
|
|
|
// element, if there is one.
|
|
|
|
void FullScreenStackPop();
|
|
|
|
|
|
|
|
// Returns the top element from the full-screen stack.
|
|
|
|
Element* FullScreenStackTop();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
// DOM-exposed fullscreen API
|
2016-11-17 21:49:27 +03:00
|
|
|
bool FullscreenEnabled(mozilla::dom::CallerType aCallerType) override;
|
2016-02-17 03:47:11 +03:00
|
|
|
Element* GetFullscreenElement() override;
|
2012-12-22 12:27:27 +04:00
|
|
|
|
2017-10-19 10:56:51 +03:00
|
|
|
virtual bool AllowPaymentRequest() const override;
|
|
|
|
virtual void SetAllowPaymentRequest(bool aIsAllowPaymentRequest) override;
|
|
|
|
|
2016-11-17 21:49:27 +03:00
|
|
|
void RequestPointerLock(Element* aElement,
|
|
|
|
mozilla::dom::CallerType aCallerType) override;
|
2012-04-12 01:55:21 +04:00
|
|
|
bool SetPointerLock(Element* aElement, int aCursorStyle);
|
2013-03-24 14:32:44 +04:00
|
|
|
static void UnlockPointer(nsIDocument* aDoc = nullptr);
|
2012-04-12 01:55:21 +04:00
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
void SetCurrentOrientation(mozilla::dom::OrientationType aType,
|
|
|
|
uint16_t aAngle) override;
|
|
|
|
uint16_t CurrentOrientationAngle() const override;
|
|
|
|
mozilla::dom::OrientationType CurrentOrientationType() const override;
|
|
|
|
void SetOrientationPendingPromise(mozilla::dom::Promise* aPromise) override;
|
|
|
|
mozilla::dom::Promise* GetOrientationPendingPromise() const override;
|
|
|
|
|
2012-12-16 09:16:47 +04:00
|
|
|
// This method may fire a DOM event; if it does so it will happen
|
|
|
|
// synchronously.
|
|
|
|
void UpdateVisibilityState();
|
|
|
|
// Posts an event to call UpdateVisibilityState
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void PostVisibilityUpdateEvent() override;
|
2011-10-12 01:29:12 +04:00
|
|
|
|
2017-05-17 09:11:07 +03:00
|
|
|
// Since we wouldn't automatically play media from non-visited page, we need
|
|
|
|
// to notify window when the page was first visited.
|
|
|
|
void MaybeActiveMediaComponents();
|
|
|
|
|
2017-08-10 07:13:22 +03:00
|
|
|
virtual void DocAddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const override;
|
2013-10-01 03:20:23 +04:00
|
|
|
// DocAddSizeOfIncludingThis is inherited from nsIDocument.
|
2012-01-03 06:19:14 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
2012-12-22 12:27:27 +04:00
|
|
|
|
|
|
|
// WebIDL bits
|
|
|
|
virtual mozilla::dom::DOMImplementation*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetImplementation(mozilla::ErrorResult& rv) override;
|
2017-12-18 00:29:10 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetSelectedStyleSheetSet(const nsAString& aSheetSet) override;
|
|
|
|
virtual void GetLastStyleSheetSet(nsString& aSheetSet) override;
|
|
|
|
virtual mozilla::dom::DOMStringList* StyleSheetSets() override;
|
|
|
|
virtual void EnableStyleSheetsForSet(const nsAString& aSheetSet) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
virtual already_AddRefed<Element> CreateElement(const nsAString& aTagName,
|
2016-09-01 13:06:33 +03:00
|
|
|
const mozilla::dom::ElementCreationOptionsOrString& aOptions,
|
2016-06-06 13:43:39 +03:00
|
|
|
ErrorResult& rv) override;
|
2014-02-24 01:01:26 +04:00
|
|
|
virtual already_AddRefed<Element> CreateElementNS(const nsAString& aNamespaceURI,
|
|
|
|
const nsAString& aQualifiedName,
|
2017-02-14 19:07:00 +03:00
|
|
|
const mozilla::dom::ElementCreationOptionsOrString& aOptions,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ErrorResult& rv) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void UnblockDOMContentLoaded() override;
|
2014-04-12 13:02:21 +04:00
|
|
|
|
1998-07-18 03:00:54 +04:00
|
|
|
protected:
|
2009-09-10 17:23:40 +04:00
|
|
|
friend class nsNodeUtils;
|
2013-01-24 13:09:06 +04:00
|
|
|
friend class nsDocumentOnStack;
|
|
|
|
|
|
|
|
void IncreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
++mStackRefCnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DecreaseStackRefCnt()
|
|
|
|
{
|
|
|
|
if (--mStackRefCnt == 0 && mNeedsReleaseAfterStackRefCntRelease) {
|
|
|
|
mNeedsReleaseAfterStackRefCntRelease = false;
|
|
|
|
NS_RELEASE_THIS();
|
|
|
|
}
|
|
|
|
}
|
2008-06-23 03:12:40 +04:00
|
|
|
|
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,
|
2017-06-18 14:37:50 +03:00
|
|
|
NotNull<const Encoding*>& aEncoding,
|
2012-03-24 15:34:42 +04:00
|
|
|
nsHtml5TreeOpExecutor* aExecutor);
|
2009-09-25 20:50:26 +04:00
|
|
|
|
2005-08-17 05:27:10 +04:00
|
|
|
// Call this before the document does something that will unbind all content.
|
2010-06-04 05:09:20 +04:00
|
|
|
// That will stop us from doing a lot of work as each element is removed.
|
|
|
|
void DestroyElementMaps();
|
2005-08-11 00:21:44 +04:00
|
|
|
|
2009-09-25 20:50:26 +04:00
|
|
|
// Refreshes the hrefs of all the links in the document.
|
|
|
|
void RefreshLinkHrefs();
|
|
|
|
|
|
|
|
nsIContent* GetFirstBaseNodeWithHref();
|
|
|
|
nsresult SetFirstBaseNodeWithHref(nsIContent *node);
|
|
|
|
|
2015-10-13 18:14:43 +03:00
|
|
|
/**
|
|
|
|
* Returns the title element of the document as defined by the HTML
|
|
|
|
* specification, or null if there isn't one. For documents whose root
|
|
|
|
* element is an <svg:svg>, this is the first <svg:title> element that's a
|
|
|
|
* child of the root. For other documents, it's the first HTML title element
|
|
|
|
* in the document.
|
|
|
|
*/
|
|
|
|
Element* GetTitleElement();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
public:
|
|
|
|
// Get our title
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetTitle(nsString& aTitle) override;
|
2012-12-22 12:27:27 +04:00
|
|
|
// Set our title
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv) override;
|
2008-08-18 06:10:28 +04:00
|
|
|
|
2013-04-20 20:04:09 +04:00
|
|
|
js::ExpandoAndGeneration mExpandoAndGeneration;
|
|
|
|
|
2014-08-18 01:41:50 +04:00
|
|
|
bool ContainsEMEContent();
|
|
|
|
|
2015-02-03 02:28:49 +03:00
|
|
|
bool ContainsMSEContent();
|
|
|
|
|
2012-12-22 12:27:27 +04:00
|
|
|
protected:
|
2013-01-09 03:25:47 +04:00
|
|
|
void RemoveDocStyleSheetsFromStyleSets();
|
2015-11-17 09:04:09 +03:00
|
|
|
void RemoveStyleSheetsFromStyleSets(
|
2016-09-26 15:03:25 +03:00
|
|
|
const nsTArray<RefPtr<mozilla::StyleSheet>>& aSheets,
|
2015-11-17 09:04:09 +03:00
|
|
|
mozilla::SheetType aType);
|
2013-05-10 11:13:37 +04:00
|
|
|
void ResetStylesheetsToURI(nsIURI* aURI);
|
2016-02-24 10:01:11 +03:00
|
|
|
void FillStyleSet(mozilla::StyleSetHandle 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
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
virtual nsPIDOMWindowOuter* GetWindowInternal() const override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const override;
|
|
|
|
virtual bool InternalAllowXULXBL() override;
|
2010-04-16 13:05:25 +04:00
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
void UpdateScreenOrientation();
|
|
|
|
|
2017-02-14 00:39:40 +03:00
|
|
|
virtual mozilla::dom::FlashClassification DocumentFlashClassification() override;
|
2017-03-10 21:50:21 +03:00
|
|
|
virtual bool IsThirdParty() override;
|
2016-11-23 02:01:04 +03:00
|
|
|
|
2017-12-06 07:26:32 +03:00
|
|
|
#define NS_DOCUMENT_NOTIFY_OBSERVERS(func_, params_) do { \
|
|
|
|
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, nsIDocumentObserver, \
|
|
|
|
func_, params_); \
|
|
|
|
/* FIXME(emilio): Apparently we can keep observing from the BFCache? That \
|
|
|
|
looks bogus. */ \
|
|
|
|
if (nsIPresShell* shell = GetObservingShell()) { \
|
|
|
|
shell->func_ params_; \
|
|
|
|
} \
|
|
|
|
} while(0)
|
2013-04-22 05:25:28 +04:00
|
|
|
|
2006-03-23 11:21:21 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
void VerifyRootContentState();
|
|
|
|
#endif
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsDocument(const char* aContentType);
|
2003-03-26 10:41:30 +03:00
|
|
|
virtual ~nsDocument();
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2010-01-18 12:07:08 +03:00
|
|
|
void EnsureOnloadBlocker();
|
|
|
|
|
2013-10-28 13:09:04 +04:00
|
|
|
void NotifyStyleSheetApplicableStateChanged();
|
|
|
|
|
2015-08-06 08:37:48 +03:00
|
|
|
// Apply the fullscreen state to the document, and trigger related
|
|
|
|
// events. It returns false if the fullscreen element ready check
|
|
|
|
// fails and nothing gets changed.
|
|
|
|
bool ApplyFullscreen(const FullscreenRequest& aRequest);
|
2015-06-10 14:13:12 +03:00
|
|
|
|
2016-11-23 02:01:04 +03:00
|
|
|
// Retrieves the classification of the Flash plugins in the document based on
|
|
|
|
// the classification lists.
|
2017-03-10 21:50:21 +03:00
|
|
|
mozilla::dom::FlashClassification PrincipalFlashClassification();
|
2016-11-23 02:01:04 +03:00
|
|
|
|
|
|
|
// Attempts to determine the Flash classification of this page based on the
|
|
|
|
// the classification lists and the classification of parent documents.
|
2017-02-14 00:39:40 +03:00
|
|
|
mozilla::dom::FlashClassification ComputeFlashClassification();
|
2016-11-23 02:01:04 +03:00
|
|
|
|
2015-05-20 02:46:17 +03:00
|
|
|
PLDHashTable *mSubDocuments;
|
2002-04-17 08:17:16 +04:00
|
|
|
|
2003-03-26 10:41:30 +03:00
|
|
|
// Array of owning references to all children
|
2005-10-01 00:06:33 +04:00
|
|
|
nsAttrAndChildArray mChildren;
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2005-04-28 20:57:24 +04:00
|
|
|
// Pointer to our parser if we're currently in the process of being
|
|
|
|
// parsed into.
|
|
|
|
nsCOMPtr<nsIParser> mParser;
|
|
|
|
|
2007-09-21 06:41:08 +04:00
|
|
|
// Weak reference to our sink for in case we no longer have a parser. This
|
|
|
|
// will allow us to flush out any pending stuff from the sink even if
|
|
|
|
// EndLoad() has already happened.
|
|
|
|
nsWeakPtr mWeakSink;
|
|
|
|
|
2016-09-26 15:03:25 +03:00
|
|
|
nsTArray<RefPtr<mozilla::StyleSheet>> mOnDemandBuiltInUASheets;
|
|
|
|
nsTArray<RefPtr<mozilla::StyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount];
|
2003-03-26 10:41:30 +03:00
|
|
|
|
2006-06-28 21:36:56 +04:00
|
|
|
// Array of observers
|
2007-12-20 10:30:04 +03:00
|
|
|
nsTObserverArray<nsIDocumentObserver*> mObservers;
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2016-10-28 17:24:00 +03:00
|
|
|
// Array of intersection observers
|
2017-02-22 21:45:13 +03:00
|
|
|
nsTHashtable<nsPtrHashKey<mozilla::dom::DOMIntersectionObserver>>
|
|
|
|
mIntersectionObservers;
|
2016-10-28 17:24:00 +03:00
|
|
|
|
2015-04-21 04:22:09 +03:00
|
|
|
// Tracker for animations that are waiting to start.
|
|
|
|
// nullptr until GetOrCreatePendingAnimationTracker is called.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::PendingAnimationTracker> mPendingAnimationTracker;
|
2014-12-18 02:42:41 +03:00
|
|
|
|
2006-04-11 07:49:44 +04:00
|
|
|
// Weak reference to the scope object (aka the script global object)
|
|
|
|
// that, unlike mScriptGlobalObject, is never unset once set. This
|
|
|
|
// is a weak reference to avoid leaks due to circular references.
|
|
|
|
nsWeakPtr mScopeObject;
|
|
|
|
|
2011-12-07 01:59:39 +04:00
|
|
|
// Stack of full-screen elements. When we request full-screen we push the
|
|
|
|
// full-screen element onto this stack, and when we cancel full-screen we
|
|
|
|
// pop one off this stack, restoring the previous full-screen state
|
|
|
|
nsTArray<nsWeakPtr> mFullScreenStack;
|
|
|
|
|
2013-02-26 09:40:53 +04:00
|
|
|
// The root of the doc tree in which this document is in. This is only
|
|
|
|
// non-null when this document is in fullscreen mode.
|
|
|
|
nsWeakPtr mFullscreenRoot;
|
|
|
|
|
2017-08-14 09:05:23 +03:00
|
|
|
RefPtr<PrincipalFlashClassifier> mPrincipalFlashClassifier;
|
2017-02-14 00:39:40 +03:00
|
|
|
mozilla::dom::FlashClassification mFlashClassification;
|
2017-03-10 21:50:21 +03:00
|
|
|
// Do not use this value directly. Call the |IsThirdParty()| method, which
|
|
|
|
// caches its result here.
|
|
|
|
mozilla::Maybe<bool> mIsThirdParty;
|
2014-02-24 01:01:26 +04:00
|
|
|
|
|
|
|
public:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::EventListenerManager> mListenerManager;
|
|
|
|
RefPtr<nsDOMStyleSheetSetList> mStyleSheetSetList;
|
2017-05-08 09:24:22 +03:00
|
|
|
RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
|
1999-01-23 10:01:40 +03:00
|
|
|
nsDocHeaderData* mHeaderData;
|
2017-12-21 04:09:22 +03: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
|
|
|
|
* 3) Additions to the DOM always update existing entries for names, and add
|
|
|
|
* new ones for IDs.
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
2012-03-28 09:17:53 +04:00
|
|
|
// Parser aborted. True if the parser of this document was forcibly
|
|
|
|
// terminated instead of letting it finish at its own pace.
|
|
|
|
bool mParserAborted:1;
|
|
|
|
|
2013-03-24 14:32:44 +04:00
|
|
|
friend class nsCallRequestFullScreen;
|
|
|
|
|
2015-08-19 00:55:21 +03:00
|
|
|
// ScreenOrientation "pending promise" as described by
|
|
|
|
// http://www.w3.org/TR/screen-orientation/
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::Promise> mOrientationPendingPromise;
|
2015-08-19 00:55:21 +03:00
|
|
|
|
|
|
|
uint16_t mCurrentOrientationAngle;
|
|
|
|
mozilla::dom::OrientationType mCurrentOrientationType;
|
|
|
|
|
2013-10-28 13:09:04 +04:00
|
|
|
// Keeps track of whether we have a pending
|
|
|
|
// 'style-sheet-applicable-state-changed' notification.
|
|
|
|
bool mSSApplicableStateNotificationPending:1;
|
|
|
|
|
2015-06-03 19:39:18 +03:00
|
|
|
// Whether we have reported use counters for this document with Telemetry yet.
|
|
|
|
// Normally this is only done at document destruction time, but for image
|
|
|
|
// documents (SVG documents) that are not guaranteed to be destroyed, we
|
|
|
|
// report use counters when the image cache no longer has any imgRequestProxys
|
|
|
|
// pointing to them. We track whether we ever reported use counters so
|
|
|
|
// that we only report them once for the document.
|
|
|
|
bool mReportedUseCounters:1;
|
|
|
|
|
2016-02-26 04:51:02 +03:00
|
|
|
// Whether we have filled our pres shell's style set with the document's
|
|
|
|
// additional sheets and sheets from the nsStyleSheetService.
|
|
|
|
bool mStyleSetFilled:1;
|
|
|
|
|
2015-06-19 03:09:52 +03:00
|
|
|
uint8_t mPendingFullscreenRequests;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mXMLDeclarationBits;
|
2003-04-19 04:28:09 +04:00
|
|
|
|
2017-06-24 20:23:08 +03:00
|
|
|
nsRefPtrHashtable<nsPtrHashKey<nsIContent>, mozilla::dom::BoxObject>* 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;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsDOMNavigationTiming> mTiming;
|
2008-02-21 23:39:20 +03:00
|
|
|
private:
|
2006-05-10 21:30:15 +04:00
|
|
|
friend class nsUnblockOnloadEvent;
|
2011-10-12 01:29:12 +04:00
|
|
|
// Recomputes the visibility state but doesn't set the new value.
|
2012-12-26 02:00:15 +04:00
|
|
|
mozilla::dom::VisibilityState GetVisibilityState() const;
|
2016-09-26 15:03:25 +03:00
|
|
|
void NotifyStyleSheetAdded(mozilla::StyleSheet* aSheet, bool aDocumentSheet);
|
|
|
|
void NotifyStyleSheetRemoved(mozilla::StyleSheet* 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
|
|
|
|
2012-09-26 03:28:17 +04:00
|
|
|
nsresult InitCSP(nsIChannel* aChannel);
|
2010-01-23 00:38:21 +03:00
|
|
|
|
2013-12-18 11:22:20 +04:00
|
|
|
/**
|
|
|
|
* Find the (non-anonymous) content in this document for aFrame. It will
|
|
|
|
* be aFrame's content node if that content is in this document and not
|
|
|
|
* anonymous. Otherwise, when aFrame is in a subdocument, we use the frame
|
|
|
|
* element containing the subdocument containing aFrame, and/or find the
|
|
|
|
* nearest non-anonymous ancestor in this document.
|
|
|
|
* Returns null if there is no such element.
|
|
|
|
*/
|
|
|
|
nsIContent* GetContentInThisDocument(nsIFrame* aFrame) const;
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
// Just like EnableStyleSheetsForSet, but doesn't check whether
|
|
|
|
// aSheetSet is null and allows the caller to control whether to set
|
|
|
|
// aSheetSet as the preferred set in the CSSLoader.
|
|
|
|
void EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUpdateCSSLoader);
|
2007-01-11 22:32:31 +03:00
|
|
|
|
2015-11-10 01:16:02 +03:00
|
|
|
void ClearAllBoxObjects();
|
|
|
|
|
2015-09-01 21:04:58 +03:00
|
|
|
// Returns true if the scheme for the url for this document is "about"
|
2017-02-20 04:35:15 +03:00
|
|
|
bool IsAboutPage() const;
|
2015-09-01 21:04:58 +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
|
|
|
|
2015-05-12 01:07:49 +03:00
|
|
|
// A set of responsive images keyed by address pointer.
|
|
|
|
nsTHashtable< nsPtrHashKey<nsIContent> > mResponsiveContent;
|
|
|
|
|
2007-01-11 22:32:31 +03:00
|
|
|
// Member to store out last-selected stylesheet set.
|
|
|
|
nsString mLastStyleSheetSet;
|
2008-02-26 17:47:51 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<nsFrameLoader> > mInitializableFrameLoaders;
|
2015-02-27 08:35:26 +03:00
|
|
|
nsTArray<nsCOMPtr<nsIRunnable> > mFrameLoaderFinalizers;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsRunnableMethod<nsDocument> > mFrameLoaderRunner;
|
2001-04-12 05:05:42 +04:00
|
|
|
|
2016-05-30 18:47:32 +03:00
|
|
|
nsCOMPtr<nsIRunnable> mMaybeEndOutermostXBLUpdateRunner;
|
|
|
|
|
2010-04-20 21:22:04 +04:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<nsDocument, void, false> >
|
2009-05-07 00:46:01 +04:00
|
|
|
mPendingTitleChangeEvent;
|
2008-10-05 00:00:09 +04:00
|
|
|
|
|
|
|
nsExternalResourceMap mExternalResourceMap;
|
2009-01-15 07:38:07 +03:00
|
|
|
|
2014-11-24 19:57:49 +03:00
|
|
|
// All images in process of being preloaded. This is a hashtable so
|
|
|
|
// we can remove them as the real image loads start; that way we
|
|
|
|
// make sure to not keep the image load going when no one cares
|
|
|
|
// about it anymore.
|
|
|
|
nsRefPtrHashtable<nsURIHashKey, imgIRequest> mPreloadingImages;
|
2009-07-08 09:23:20 +04:00
|
|
|
|
2015-05-06 03:55:18 +03:00
|
|
|
// A list of preconnects initiated by the preloader. This prevents
|
|
|
|
// the same uri from being used more than once, and allows the dom
|
|
|
|
// builder to not repeat the work of the preloader.
|
|
|
|
nsDataHashtable< nsURIHashKey, bool> mPreloadedPreconnects;
|
|
|
|
|
2014-12-11 02:54:00 +03:00
|
|
|
// Current depth of picture elements from parser
|
|
|
|
int32_t mPreloadPictureDepth;
|
|
|
|
|
|
|
|
// Set if we've found a URL for the current picture
|
|
|
|
nsString mPreloadPictureFoundSource;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
|
2009-10-18 20:39:52 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsContentList> mImageMaps;
|
2011-05-30 14:59:59 +04:00
|
|
|
|
2010-05-12 04:30:40 +04:00
|
|
|
nsCString mScrollToRef;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mScrolledToRefAlready : 1;
|
|
|
|
uint8_t mChangeScrollPosWhenScrollingToRef : 1;
|
2010-05-12 04:30:40 +04:00
|
|
|
|
2012-03-28 19:53:56 +04:00
|
|
|
// Tracking for plugins in the document.
|
|
|
|
nsTHashtable< nsPtrHashKey<nsIObjectLoadingContent> > mPlugins;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::DocumentTimeline> mDocumentTimeline;
|
2016-10-09 16:36:56 +03:00
|
|
|
mozilla::LinkedList<mozilla::dom::DocumentTimeline> mTimelines;
|
2014-05-13 11:22:12 +04:00
|
|
|
|
2013-01-04 07:27:06 +04:00
|
|
|
enum ViewportType {
|
|
|
|
DisplayWidthHeight,
|
|
|
|
Specified,
|
|
|
|
Unknown
|
|
|
|
};
|
|
|
|
|
|
|
|
ViewportType mViewportType;
|
|
|
|
|
|
|
|
// These member variables cache information about the viewport so we don't have to
|
|
|
|
// recalculate it each time.
|
|
|
|
bool mValidWidth, mValidHeight;
|
2013-09-03 23:12:23 +04:00
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMinFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleMaxFloat;
|
|
|
|
mozilla::LayoutDeviceToScreenScale mScaleFloat;
|
|
|
|
mozilla::CSSToLayoutDeviceScale mPixelRatio;
|
2014-02-25 04:22:45 +04:00
|
|
|
bool mAutoSize, mAllowZoom, mAllowDoubleTapZoom, mValidScaleFloat, mValidMaxScale, mScaleStrEmpty, mWidthStrEmpty;
|
2014-05-29 00:27:38 +04:00
|
|
|
mozilla::CSSSize mViewportSize;
|
2013-01-04 07:27:06 +04:00
|
|
|
|
2013-01-24 13:09:06 +04:00
|
|
|
nsrefcnt mStackRefCnt;
|
|
|
|
bool mNeedsReleaseAfterStackRefCntRelease;
|
|
|
|
|
2014-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;
|
|
|
|
|
2017-02-23 04:19:04 +03:00
|
|
|
// We lazily calculate declaration blocks for SVG elements
|
|
|
|
// with mapped attributes in Servo mode. This list contains all elements which
|
|
|
|
// need lazy resolution
|
|
|
|
nsTHashtable<nsPtrHashKey<nsSVGElement>> mLazySVGPresElements;
|
|
|
|
|
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
|
2017-08-23 06:09:24 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
void RecordNavigationTiming(ReadyState aReadyState);
|
|
|
|
bool mDOMLoadingSet : 1;
|
|
|
|
bool mDOMInteractiveSet : 1;
|
|
|
|
bool mDOMCompleteSet : 1;
|
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___ */
|