mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1145017. Use the new proto setup for custom element prototypes when possible. r=wchen,bholley (67789348c)
- Bug 1183450, properly wrappercache URL object, r=baku (ce6ef8436)
- space cleanup (2de44c12c)
- Bug 1155477 - Convert nsINode::Slots::mChildNodes to an nsRefPtr; r=baku (721d52f31)
- Bug 1156009 - Mark nsChildContentList::mNode as MOZ_NON_OWNING_REF; r=baku (acaba6531)
- remaining of 1155477 (d1dc03fc0)
- spacing like gecko, even if bad (7ff16eeae)
- Bug 1155475 - Mark nsINode::Slots::mWeakReference as MOZ_NON_OWNING_REF; r=baku (59b241ae6)
- Bug 1156011 - Mark nsINode::mFirstChild as MOZ_NON_OWNING_REF; r=baku (5255acaa5)
- Bug 1156013 - Mark nsINode::mSubtreeRoot as MOZ_NON_OWNING_REF; r=baku (4da7e61cf)
- Bug 1156012 - Mark nsINode::m{Next,Previous}Sibling as MOZ_NON_OWNING_REF; r=baku (33022b4e0)
- Bug 1156010 - Mark nsINode::mParent as MOZ_OWNING_REF; r=smaug (3c975656a)
- fix typo (c06ca0d92)
- Bug 1165184 - Move nsChildContentList to its own header. r=peterv (408a2cb2e)
- Bug 1167390 - Mark nsNodeWeakReference::mNode as MOZ_NON_OWNING_REF. r=smaug (5a2ab3838)
- missing bit 1117172 part 3 (ab0b032b9)
- Bug 1184065, properly support WrapperCache on DestinationInsertionPointList, r=wchen (4afc484a7)
- missing bit of Bug 1095098 - followup - add back some static analysis attributes lost in a rebase; r=me (08d509ef7)
- Bug 1156790 - mark various nsCOMPtr_helper-esque classes as final; r=mccr8 (826d1f5ca)
This commit is contained in:
+37
-20
@@ -413,28 +413,43 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
|
||||
JSObject*
|
||||
Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx, aGivenProto));
|
||||
JS::Rooted<JSObject*> givenProto(aCx, aGivenProto);
|
||||
JS::Rooted<JSObject*> customProto(aCx);
|
||||
|
||||
if (!givenProto) {
|
||||
// Custom element prototype swizzling.
|
||||
CustomElementData* data = GetCustomElementData();
|
||||
if (data) {
|
||||
// If this is a registered custom element then fix the prototype.
|
||||
nsDocument* document = static_cast<nsDocument*>(OwnerDoc());
|
||||
document->GetCustomPrototype(NodeInfo()->NamespaceID(), data->mType, &customProto);
|
||||
if (customProto &&
|
||||
NodePrincipal()->SubsumesConsideringDomain(nsContentUtils::ObjectPrincipal(customProto))) {
|
||||
// Just go ahead and create with the right proto up front. Set
|
||||
// customProto to null to flag that we don't need to do any post-facto
|
||||
// proto fixups here.
|
||||
givenProto = customProto;
|
||||
customProto = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx, givenProto));
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Custom element prototype swizzling.
|
||||
CustomElementData* data = GetCustomElementData();
|
||||
if (obj && data) {
|
||||
// If this is a registered custom element then fix the prototype.
|
||||
nsDocument* document = static_cast<nsDocument*>(OwnerDoc());
|
||||
JS::Rooted<JSObject*> prototype(aCx);
|
||||
document->GetCustomPrototype(NodeInfo()->NamespaceID(), data->mType, &prototype);
|
||||
if (prototype) {
|
||||
// We want to set the custom prototype in the compartment where it was
|
||||
// registered. In the case that |obj| and |prototype| are in different
|
||||
// compartments, this will set the prototype on the |obj|'s wrapper and
|
||||
// thus only visible in the wrapper's compartment.
|
||||
JSAutoCompartment ac(aCx, prototype);
|
||||
if (!JS_WrapObject(aCx, &obj) || !JS_SetPrototype(aCx, obj, prototype)) {
|
||||
dom::Throw(aCx, NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
if (customProto) {
|
||||
// We want to set the custom prototype in the compartment where it was
|
||||
// registered. In the case that |obj| and |prototype| are in different
|
||||
// compartments, this will set the prototype on the |obj|'s wrapper and
|
||||
// thus only visible in the wrapper's compartment, since we know obj's
|
||||
// principal does not subsume customProto's in this case.
|
||||
JSAutoCompartment ac(aCx, customProto);
|
||||
JS::Rooted<JSObject*> wrappedObj(aCx, obj);
|
||||
if (!JS_WrapObject(aCx, &wrappedObj) ||
|
||||
!JS_SetPrototype(aCx, wrappedObj, customProto)) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,10 +1066,12 @@ Element::CreateShadowRoot(ErrorResult& aError)
|
||||
return shadowRoot.forget();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION(DestinationInsertionPointList, mParent, mDestinationPoints)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DestinationInsertionPointList, mParent,
|
||||
mDestinationPoints)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(DestinationInsertionPointList)
|
||||
NS_INTERFACE_TABLE(DestinationInsertionPointList, nsINodeList)
|
||||
NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
|
||||
NS_INTERFACE_TABLE(DestinationInsertionPointList, nsINodeList, nsIDOMNodeList)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(DestinationInsertionPointList)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@
|
||||
#include "mozilla/dom/DirectionalityUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsINodeList.h"
|
||||
#include "nsNodeUtils.h"
|
||||
#include "nsAttrAndChildArray.h"
|
||||
#include "mozFlushType.h"
|
||||
@@ -1356,7 +1357,7 @@ public:
|
||||
explicit DestinationInsertionPointList(Element* aElement);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DestinationInsertionPointList)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DestinationInsertionPointList)
|
||||
|
||||
// nsIDOMNodeList
|
||||
NS_DECL_NSIDOMNODELIST
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
|
||||
#include "nsStyledElement.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsChildContentList.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@@ -313,7 +314,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
||||
if (binding) {
|
||||
// XXX sXBL/XBL2 issue
|
||||
// If this is an anonymous XBL element use the binding
|
||||
// document for the base URI.
|
||||
// document for the base URI.
|
||||
// XXX Will fail with xml:base
|
||||
base = binding->PrototypeBinding()->DocURI();
|
||||
break;
|
||||
@@ -326,7 +327,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
||||
base = explicitBaseURI;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Otherwise check for xml:base attribute
|
||||
elem->GetAttr(kNameSpaceID_XML, nsGkAtoms::base, attr);
|
||||
if (!attr.IsEmpty()) {
|
||||
@@ -334,7 +335,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
||||
}
|
||||
elem = elem->GetParent();
|
||||
} while(elem);
|
||||
|
||||
|
||||
// Now resolve against all xml:base attrs
|
||||
for (uint32_t i = baseAttrs.Length() - 1; i != uint32_t(-1); --i) {
|
||||
nsCOMPtr<nsIURI> newBase;
|
||||
@@ -455,7 +456,7 @@ FragmentOrElement::Children()
|
||||
FragmentOrElement::nsDOMSlots *slots = DOMSlots();
|
||||
|
||||
if (!slots->mChildrenList) {
|
||||
slots->mChildrenList = new nsContentList(this, kNameSpaceID_Wildcard,
|
||||
slots->mChildrenList = new nsContentList(this, kNameSpaceID_Wildcard,
|
||||
nsGkAtoms::_asterisk, nsGkAtoms::_asterisk,
|
||||
false);
|
||||
}
|
||||
@@ -1679,7 +1680,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
||||
if (!root) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Subtree has been traversed already, and aNode has
|
||||
// been handled in a way that doesn't require revisiting it.
|
||||
if (root->IsPurpleRoot()) {
|
||||
@@ -1733,7 +1734,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentDoc || !foundBlack) {
|
||||
if (!currentDoc || !foundBlack) {
|
||||
root->SetIsPurpleRoot(true);
|
||||
if (domOnlyCycle) {
|
||||
if (!gNodesToUnbind) {
|
||||
@@ -1773,7 +1774,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
||||
nsIContent* n = nodesToClear[i];
|
||||
MarkNodeChildren(n);
|
||||
// Can't remove currently handled purple node,
|
||||
// unless aRemovingAllowed is true.
|
||||
// unless aRemovingAllowed is true.
|
||||
if ((n != aNode || aRemovingAllowed) && n->IsPurple()) {
|
||||
n->RemovePurple();
|
||||
}
|
||||
@@ -1791,7 +1792,7 @@ FragmentOrElement::CanSkipThis(nsINode* aNode)
|
||||
return true;
|
||||
}
|
||||
nsIDocument* c = aNode->GetUncomposedDoc();
|
||||
return
|
||||
return
|
||||
((c && nsCCUncollectableMarker::InGeneration(c->GetMarkedCCGeneration())) ||
|
||||
aNode->InCCBlackTree()) && !NeedsScriptTraverse(aNode);
|
||||
}
|
||||
@@ -2457,7 +2458,7 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
|
||||
delete attValue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
aBuilder.Append(" ");
|
||||
|
||||
if (MOZ_LIKELY(attNs == kNameSpaceID_None) ||
|
||||
@@ -2517,12 +2518,12 @@ ShouldEscape(nsIContent* aParent)
|
||||
static const nsIAtom* nonEscapingElements[] = {
|
||||
nsGkAtoms::style, nsGkAtoms::script, nsGkAtoms::xmp,
|
||||
nsGkAtoms::iframe, nsGkAtoms::noembed, nsGkAtoms::noframes,
|
||||
nsGkAtoms::plaintext,
|
||||
nsGkAtoms::plaintext,
|
||||
// Per the current spec noscript should be escaped in case
|
||||
// scripts are disabled or if document doesn't have
|
||||
// browsing context. However the latter seems to be a spec bug
|
||||
// and Gecko hasn't traditionally done the former.
|
||||
nsGkAtoms::noscript
|
||||
nsGkAtoms::noscript
|
||||
};
|
||||
static mozilla::BloomFilter<12, nsIAtom> sFilter;
|
||||
static bool sInitialized = false;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "nsAttrAndChildArray.h" // member
|
||||
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
|
||||
#include "nsIContent.h" // base class
|
||||
#include "nsINodeList.h" // base class
|
||||
#include "nsIWeakReference.h" // base class
|
||||
#include "nsNodeUtils.h" // class member nsNodeUtils::CloneNodeImpl
|
||||
#include "nsIHTMLCollection.h"
|
||||
@@ -39,50 +38,6 @@ class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
/**
|
||||
* Class that implements the nsIDOMNodeList interface (a list of children of
|
||||
* the content), by holding a reference to the content and delegating GetLength
|
||||
* and Item to its existing child list.
|
||||
* @see nsIDOMNodeList
|
||||
*/
|
||||
class nsChildContentList final : public nsINodeList
|
||||
{
|
||||
public:
|
||||
explicit nsChildContentList(nsINode* aNode)
|
||||
: mNode(aNode)
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList)
|
||||
|
||||
// nsWrapperCache
|
||||
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
// nsIDOMNodeList interface
|
||||
NS_DECL_NSIDOMNODELIST
|
||||
|
||||
// nsINodeList interface
|
||||
virtual int32_t IndexOf(nsIContent* aContent) override;
|
||||
virtual nsIContent* Item(uint32_t aIndex) override;
|
||||
|
||||
void DropReference()
|
||||
{
|
||||
mNode = nullptr;
|
||||
}
|
||||
|
||||
virtual nsINode* GetParentObject() override
|
||||
{
|
||||
return mNode;
|
||||
}
|
||||
|
||||
private:
|
||||
~nsChildContentList() {}
|
||||
|
||||
// The node whose children make up the list (weak reference)
|
||||
nsINode* mNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* A class that implements nsIWeakReference
|
||||
*/
|
||||
@@ -110,7 +65,7 @@ public:
|
||||
private:
|
||||
~nsNodeWeakReference();
|
||||
|
||||
nsINode* mNode;
|
||||
nsINode* MOZ_NON_OWNING_REF mNode;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+2
-11
@@ -23,22 +23,13 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(URL)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(URL)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSearchParams)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(URL)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSearchParams)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(URL, mParent, mSearchParams)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(URL)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(URL)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URL)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class URL final : public URLSearchParamsObserver
|
||||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(URL)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(URL)
|
||||
|
||||
URL(nsISupports* aParent, already_AddRefed<nsIURI> aURI);
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ EXPORTS += [
|
||||
'nsAttrValue.h',
|
||||
'nsAttrValueInlines.h',
|
||||
'nsCaseTreatment.h',
|
||||
'nsChildContentList.h',
|
||||
'nsContentCID.h',
|
||||
'nsContentCreatorFunctions.h',
|
||||
'nsContentList.h',
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef nsChildContentList_h__
|
||||
#define nsChildContentList_h__
|
||||
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsINodeList.h" // base class
|
||||
#include "js/TypeDecls.h" // for Handle, Value, JSObject, JSContext
|
||||
|
||||
class nsIContent;
|
||||
class nsINode;
|
||||
|
||||
/**
|
||||
* Class that implements the nsIDOMNodeList interface (a list of children of
|
||||
* the content), by holding a reference to the content and delegating GetLength
|
||||
* and Item to its existing child list.
|
||||
* @see nsIDOMNodeList
|
||||
*/
|
||||
class nsChildContentList final : public nsINodeList
|
||||
{
|
||||
public:
|
||||
explicit nsChildContentList(nsINode* aNode)
|
||||
: mNode(aNode)
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList)
|
||||
|
||||
// nsWrapperCache
|
||||
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
// nsIDOMNodeList interface
|
||||
NS_DECL_NSIDOMNODELIST
|
||||
|
||||
// nsINodeList interface
|
||||
virtual int32_t IndexOf(nsIContent* aContent) override;
|
||||
virtual nsIContent* Item(uint32_t aIndex) override;
|
||||
|
||||
void DropReference()
|
||||
{
|
||||
mNode = nullptr;
|
||||
}
|
||||
|
||||
virtual nsINode* GetParentObject() override
|
||||
{
|
||||
return mNode;
|
||||
}
|
||||
|
||||
private:
|
||||
~nsChildContentList() {}
|
||||
|
||||
// The node whose children make up the list.
|
||||
// This is a non-owning ref which is safe because it's set to nullptr by
|
||||
// DropReference() by the node slots get destroyed.
|
||||
nsINode* MOZ_NON_OWNING_REF mNode;
|
||||
};
|
||||
|
||||
#endif /* nsChildContentList_h__ */
|
||||
@@ -104,15 +104,20 @@
|
||||
#include "nsDOMMutationObserver.h"
|
||||
#include "GeometryUtils.h"
|
||||
#include "nsIAnimationObserver.h"
|
||||
#include "nsChildContentList.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsINode::nsSlots::nsSlots()
|
||||
: mWeakReference(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
nsINode::nsSlots::~nsSlots()
|
||||
{
|
||||
if (mChildNodes) {
|
||||
mChildNodes->DropReference();
|
||||
NS_RELEASE(mChildNodes);
|
||||
}
|
||||
|
||||
if (mWeakReference) {
|
||||
@@ -132,7 +137,6 @@ nsINode::nsSlots::Unlink()
|
||||
{
|
||||
if (mChildNodes) {
|
||||
mChildNodes->DropReference();
|
||||
NS_RELEASE(mChildNodes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,12 +372,8 @@ nsINodeList*
|
||||
nsINode::ChildNodes()
|
||||
{
|
||||
nsSlots* slots = Slots();
|
||||
if (!slots->mChildNodes) {
|
||||
slots->mChildNodes = new nsChildContentList(this);
|
||||
if (slots->mChildNodes) {
|
||||
NS_ADDREF(slots->mChildNodes);
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(!slots->mChildNodes);
|
||||
slots->mChildNodes = new nsChildContentList(this);
|
||||
|
||||
return slots->mChildNodes;
|
||||
}
|
||||
|
||||
+31
-22
@@ -42,6 +42,7 @@ class nsIDOMNodeList;
|
||||
class nsIEditor;
|
||||
class nsIFrame;
|
||||
class nsIMutationObserver;
|
||||
class nsINode;
|
||||
class nsINodeList;
|
||||
class nsIPresShell;
|
||||
class nsIPrincipal;
|
||||
@@ -385,6 +386,10 @@ protected:
|
||||
* WrapNode is called from WrapObject to actually wrap this node, WrapObject
|
||||
* does some additional checks and fix-up that's common to all nodes. WrapNode
|
||||
* should just call the DOM binding's Wrap function.
|
||||
*
|
||||
* aGivenProto is the prototype to use (or null if the default one should be
|
||||
* used) and should just be passed directly on to the DOM binding's Wrap
|
||||
* function.
|
||||
*/
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) = 0;
|
||||
|
||||
@@ -707,7 +712,7 @@ public:
|
||||
{
|
||||
return InsertChildAt(aKid, GetChildCount(), aNotify);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a child from this node. This method handles calling UnbindFromTree
|
||||
* on the child appropriately.
|
||||
@@ -870,7 +875,7 @@ public:
|
||||
virtual void* UnsetProperty(uint16_t aCategory,
|
||||
nsIAtom *aPropertyName,
|
||||
nsresult *aStatus = nullptr);
|
||||
|
||||
|
||||
bool HasProperties() const
|
||||
{
|
||||
return HasFlag(NODE_HAS_PROPERTIES);
|
||||
@@ -902,7 +907,7 @@ public:
|
||||
{
|
||||
return mParent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the parent nsINode for this node if it is an Element.
|
||||
* @return the parent node
|
||||
@@ -1025,12 +1030,7 @@ public:
|
||||
class nsSlots
|
||||
{
|
||||
public:
|
||||
nsSlots()
|
||||
: mChildNodes(nullptr),
|
||||
mWeakReference(nullptr),
|
||||
mEditableDescendantCount(0)
|
||||
{
|
||||
}
|
||||
nsSlots();
|
||||
|
||||
// If needed we could remove the vtable pointer this dtor causes by
|
||||
// putting a DestroySlots function on nsINode
|
||||
@@ -1048,15 +1048,14 @@ public:
|
||||
* An object implementing nsIDOMNodeList for this content (childNodes)
|
||||
* @see nsIDOMNodeList
|
||||
* @see nsGenericHTMLElement::GetChildNodes
|
||||
*
|
||||
* MSVC 7 doesn't like this as an nsRefPtr
|
||||
*/
|
||||
nsChildContentList* mChildNodes;
|
||||
nsRefPtr<nsChildContentList> mChildNodes;
|
||||
|
||||
/**
|
||||
* Weak reference to this node
|
||||
* Weak reference to this node. This is cleared by the destructor of
|
||||
* nsNodeWeakReference.
|
||||
*/
|
||||
nsNodeWeakReference* mWeakReference;
|
||||
nsNodeWeakReference* MOZ_NON_OWNING_REF mWeakReference;
|
||||
|
||||
/**
|
||||
* Number of descendant nodes in the uncomposed document that have been
|
||||
@@ -1238,7 +1237,7 @@ protected:
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
void GetTextContent(nsAString& aTextContent,
|
||||
mozilla::ErrorResult& aError)
|
||||
@@ -1293,7 +1292,7 @@ public:
|
||||
nsresult GetUserData(const nsAString& aKey, nsIVariant** aResult)
|
||||
{
|
||||
NS_IF_ADDREF(*aResult = GetUserData(aKey));
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -1454,7 +1453,7 @@ private:
|
||||
NodeIsCCMarkedRoot,
|
||||
// Maybe set if this node is in black subtree.
|
||||
NodeIsCCBlackTree,
|
||||
// Maybe set if the node is a root of a subtree
|
||||
// Maybe set if the node is a root of a subtree
|
||||
// which needs to be kept in the purple buffer.
|
||||
NodeIsPurpleRoot,
|
||||
// Set if the node has an explicit base URI stored
|
||||
@@ -1971,23 +1970,33 @@ protected:
|
||||
|
||||
nsRefPtr<mozilla::dom::NodeInfo> mNodeInfo;
|
||||
|
||||
nsINode* mParent;
|
||||
// mParent is an owning ref most of the time, except for the case of document
|
||||
// nodes, so it cannot be represented by nsCOMPtr, so mark is as
|
||||
// MOZ_OWNING_REF.
|
||||
nsINode* MOZ_OWNING_REF mParent;
|
||||
|
||||
private:
|
||||
// Boolean flags.
|
||||
uint32_t mBoolFlags;
|
||||
|
||||
protected:
|
||||
nsIContent* mNextSibling;
|
||||
nsIContent* mPreviousSibling;
|
||||
nsIContent* mFirstChild;
|
||||
// These references are non-owning and safe, as they are managed by
|
||||
// nsAttrAndChildArray.
|
||||
nsIContent* MOZ_NON_OWNING_REF mNextSibling;
|
||||
nsIContent* MOZ_NON_OWNING_REF mPreviousSibling;
|
||||
// This reference is non-owning and safe, since in the case of documents,
|
||||
// it is set to null when the document gets destroyed, and in the case of
|
||||
// other nodes, the children keep the parents alive.
|
||||
nsIContent* MOZ_NON_OWNING_REF mFirstChild;
|
||||
|
||||
union {
|
||||
// Pointer to our primary frame. Might be null.
|
||||
nsIFrame* mPrimaryFrame;
|
||||
|
||||
// Pointer to the root of our subtree. Might be null.
|
||||
nsINode* mSubtreeRoot;
|
||||
// This reference is non-owning and safe, since it either points to the
|
||||
// object itself, or is reset by ClearSubtreeRootPointer.
|
||||
nsINode* MOZ_NON_OWNING_REF mSubtreeRoot;
|
||||
};
|
||||
|
||||
// Storage for more members that are usually not needed; allocated lazily.
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
{ 0xadb5e54c, 0x6e96, 0x4102, \
|
||||
{ 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a } }
|
||||
|
||||
class nsIContent;
|
||||
class nsINode;
|
||||
|
||||
/**
|
||||
* An internal interface for a reasonably fast indexOf.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
template<class T>
|
||||
class nsQueryObject : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsQueryObject final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
explicit nsQueryObject(T* aRawPtr)
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class MOZ_STACK_CLASS nsQueryObjectWithError : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsQueryObjectWithError final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsQueryObjectWithError(T* aRawPtr, nsresult* aErrorPtr)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "nsIArray.h"
|
||||
|
||||
// helper class for do_QueryElementAt
|
||||
class MOZ_STACK_CLASS nsQueryArrayElementAt : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsQueryArrayElementAt final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsQueryArrayElementAt(nsIArray* aArray, uint32_t aIndex,
|
||||
|
||||
@@ -168,7 +168,7 @@ private:
|
||||
nsISupports* MOZ_OWNING_REF mRawPtr;
|
||||
};
|
||||
|
||||
class nsQueryInterfaceWithError
|
||||
class nsQueryInterfaceWithError final
|
||||
{
|
||||
public:
|
||||
nsQueryInterfaceWithError(nsISupports* aRawPtr, nsresult* aError)
|
||||
@@ -217,7 +217,7 @@ do_QueryInterface(already_AddRefed<T>&, nsresult*)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Using servicemanager with COMPtrs
|
||||
class nsGetServiceByCID
|
||||
class nsGetServiceByCID final
|
||||
{
|
||||
public:
|
||||
explicit nsGetServiceByCID(const nsCID& aCID) : mCID(aCID) {}
|
||||
@@ -228,7 +228,7 @@ private:
|
||||
const nsCID& mCID;
|
||||
};
|
||||
|
||||
class nsGetServiceByCIDWithError
|
||||
class nsGetServiceByCIDWithError final
|
||||
{
|
||||
public:
|
||||
nsGetServiceByCIDWithError(const nsCID& aCID, nsresult* aErrorPtr)
|
||||
@@ -244,7 +244,7 @@ private:
|
||||
nsresult* mErrorPtr;
|
||||
};
|
||||
|
||||
class nsGetServiceByContractID
|
||||
class nsGetServiceByContractID final
|
||||
{
|
||||
public:
|
||||
explicit nsGetServiceByContractID(const char* aContractID)
|
||||
@@ -258,7 +258,7 @@ private:
|
||||
const char* mContractID;
|
||||
};
|
||||
|
||||
class nsGetServiceByContractIDWithError
|
||||
class nsGetServiceByContractIDWithError final
|
||||
{
|
||||
public:
|
||||
nsGetServiceByContractIDWithError(const char* aContractID, nsresult* aErrorPtr)
|
||||
|
||||
@@ -26,7 +26,7 @@ nsresult CallGetClassObject(const char* aContractID, const nsIID& aIID,
|
||||
void** aResult);
|
||||
|
||||
|
||||
class MOZ_STACK_CLASS nsCreateInstanceByCID : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsCreateInstanceByCID final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter,
|
||||
@@ -46,7 +46,7 @@ private:
|
||||
nsresult* mErrorPtr;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS nsCreateInstanceByContractID : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsCreateInstanceByContractID final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsCreateInstanceByContractID(const char* aContractID, nsISupports* aOuter,
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
nsresult* mErrorPtr;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS nsCreateInstanceFromFactory : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsCreateInstanceFromFactory final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsCreateInstanceFromFactory(nsIFactory* aFactory, nsISupports* aOuter,
|
||||
@@ -124,7 +124,7 @@ do_CreateInstance(nsIFactory* aFactory, nsISupports* aOuter,
|
||||
}
|
||||
|
||||
|
||||
class MOZ_STACK_CLASS nsGetClassObjectByCID : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsGetClassObjectByCID final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsGetClassObjectByCID(const nsCID& aCID, nsresult* aErrorPtr)
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
nsresult* mErrorPtr;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS nsGetClassObjectByContractID : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsGetClassObjectByContractID final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsGetClassObjectByContractID(const char* aContractID, nsresult* aErrorPtr)
|
||||
|
||||
@@ -22,7 +22,7 @@ CallGetInterface(T* aSource, DestinationType** aDestination)
|
||||
reinterpret_cast<void**>(aDestination));
|
||||
}
|
||||
|
||||
class MOZ_STACK_CLASS nsGetInterface : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsGetInterface final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsGetInterface(nsISupports* aSource, nsresult* aError)
|
||||
|
||||
@@ -30,7 +30,7 @@ CallQueryReferent(T* aSource, DestinationType** aDestination)
|
||||
}
|
||||
|
||||
|
||||
class MOZ_STACK_CLASS nsQueryReferent : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsQueryReferent final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsQueryReferent(nsIWeakReference* aWeakPtr, nsresult* aError)
|
||||
|
||||
@@ -34,7 +34,7 @@ do_GetService(const char* aContractID, nsresult* aError)
|
||||
return nsGetServiceByContractIDWithError(aContractID, aError);
|
||||
}
|
||||
|
||||
class MOZ_STACK_CLASS nsGetServiceFromCategory : public nsCOMPtr_helper
|
||||
class MOZ_STACK_CLASS nsGetServiceFromCategory final : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
nsGetServiceFromCategory(const char* aCategory, const char* aEntry,
|
||||
|
||||
Reference in New Issue
Block a user