diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 9a64d8f29ff..ef29b474ab6 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -1355,8 +1355,7 @@ nsNSElementTearoff::GetNextElementSibling(nsIDOMElement** aResult) nsContentList* nsGenericElement::GetChildrenList() { - nsGenericElement::nsDOMSlots *slots = GetDOMSlots(); - NS_ENSURE_TRUE(slots, nsnull); + nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mChildrenList) { slots->mChildrenList = new nsContentList(this, kNameSpaceID_Wildcard, @@ -1384,8 +1383,7 @@ nsGenericElement::GetClassList(nsresult *aResult) { *aResult = NS_ERROR_OUT_OF_MEMORY; - nsGenericElement::nsDOMSlots *slots = GetDOMSlots(); - NS_ENSURE_TRUE(slots, nsnull); + nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mClassList) { nsCOMPtr classAttr = GetClassAttributeName(); @@ -2315,11 +2313,7 @@ NS_IMETHODIMP nsGenericElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes) { NS_ENSURE_ARG_POINTER(aAttributes); - nsDOMSlots *slots = GetDOMSlots(); - - if (!slots) { - return NS_ERROR_OUT_OF_MEMORY; - } + nsDOMSlots *slots = DOMSlots(); if (!slots->mAttributeMap) { slots->mAttributeMap = new nsDOMAttributeMap(this); @@ -2862,11 +2856,7 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, #endif { if (aBindingParent) { - nsDOMSlots *slots = GetDOMSlots(); - - if (!slots) { - return NS_ERROR_OUT_OF_MEMORY; - } + nsDOMSlots *slots = DOMSlots(); slots->mBindingParent = aBindingParent; // Weak, so no addref happens. } @@ -3292,8 +3282,7 @@ nsGenericElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) nsresult nsGenericElement::GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle) { - nsGenericElement::nsDOMSlots *slots = GetDOMSlots(); - NS_ENSURE_TRUE(slots, NS_ERROR_OUT_OF_MEMORY); + nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mSMILOverrideStyle) { slots->mSMILOverrideStyle = new nsDOMCSSAttributeDeclaration(this, PR_TRUE); @@ -3316,8 +3305,7 @@ nsresult nsGenericElement::SetSMILOverrideStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify) { - nsGenericElement::nsDOMSlots *slots = GetDOMSlots(); - NS_ENSURE_TRUE(slots, NS_ERROR_OUT_OF_MEMORY); + nsGenericElement::nsDOMSlots *slots = DOMSlots(); slots->mSMILOverrideStyleRule = aStyleRule; diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index be3867b3ac3..7c3bb8f3b53 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -976,7 +976,7 @@ protected: // Override from nsINode virtual nsINode::nsSlots* CreateSlots(); - nsDOMSlots *GetDOMSlots() + nsDOMSlots *DOMSlots() { return static_cast(GetSlots()); } diff --git a/content/base/src/nsStyledElement.cpp b/content/base/src/nsStyledElement.cpp index d8d72c770a2..a0cf056e8bc 100644 --- a/content/base/src/nsStyledElement.cpp +++ b/content/base/src/nsStyledElement.cpp @@ -256,7 +256,7 @@ nsStyledElement::GetStyle(nsresult* retval) } } - nsGenericElement::nsDOMSlots *slots = GetDOMSlots(); + nsGenericElement::nsDOMSlots *slots = DOMSlots(); if (!slots->mStyle) { // Just in case... diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 7473b31ca8c..ac36f8d7da2 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -1848,9 +1848,7 @@ NS_IMETHODIMP nsXULElement::GetControllers(nsIControllers** aResult) { if (! Controllers()) { - nsDOMSlots* slots = GetDOMSlots(); - if (!slots) - return NS_ERROR_OUT_OF_MEMORY; + nsDOMSlots* slots = DOMSlots(); nsresult rv; rv = NS_NewXULControllers(nsnull, NS_GET_IID(nsIControllers),