Bug 677101, part b - Remove nsContentUtils.h includes from headers; r=volkmar

This commit is contained in:
Ms2ger 2011-08-11 15:29:50 +02:00
parent 43d40b8987
commit 4ca9cbc0f3
94 changed files with 198 additions and 115 deletions

View File

@ -52,6 +52,7 @@
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMNodeList.h"
#include "nsIEditor.h"
#include "nsIFrame.h"
#include "nsINameSpaceManager.h"

View File

@ -53,6 +53,7 @@
#include "nsIDOMRange.h"
#include "nsISelectionPrivate.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLTableCellElement.h"
#include "nsIDOMHTMLTableElement.h"
@ -65,6 +66,7 @@
#include "nsFrameSelection.h"
#include "nsLayoutErrors.h"
#include "nsArrayUtils.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla::a11y;

View File

@ -51,6 +51,7 @@
#include "nsIMutableArray.h"
#include "nsIXFormsUtilityService.h"
#include "nsIPlaintextEditor.h"
#include "nsINodeList.h"
using namespace mozilla::a11y;

View File

@ -47,6 +47,8 @@
#include "nsIDOMXULPopupElement.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsIDOMNodeList.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla::a11y;

View File

@ -46,6 +46,7 @@
#include "States.h"
#include "nsITreeSelection.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla::a11y;

View File

@ -34,6 +34,10 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsContentUtils.h"
#include "nsIDocument.h"
#include "nsIDocumentObserver.h"
/**
* Helper class to automatically handle batching of document updates. This
* class will call BeginUpdate on construction and EndUpdate on destruction on

View File

@ -51,6 +51,7 @@
#include "nsMappedAttributes.h"
#include "nsUnicharUtils.h"
#include "nsAutoPtr.h"
#include "nsContentUtils.h" // nsAutoScriptBlocker
/*
CACHE_POINTER_SHIFT indicates how many steps to downshift the |this| pointer.

View File

@ -41,8 +41,10 @@
#include "nsIDOMComment.h"
#include "nsGenericDOMDataNode.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsGenericElement.h" // DOMCI_NODE_DATA
#include "nsDOMMemoryReporter.h"
class nsCommentNode : public nsGenericDOMDataNode,

View File

@ -60,6 +60,7 @@
#include "mozAutoDocUpdate.h"
#include "nsMutationEvent.h"
#include "nsPLDOMEvent.h"
#include "nsContentUtils.h" // NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
using namespace mozilla::dom;

View File

@ -51,7 +51,6 @@
#include "nsINodeInfo.h"
#include "nsDOMAttributeMap.h"
#include "nsCycleCollectionParticipant.h"
#include "nsContentUtils.h"
#include "nsStubMutationObserver.h"
// Attribute helper class used to wrap up an attribute with a dom

View File

@ -87,7 +87,6 @@
#include "pldhash.h"
#include "nsAttrAndChildArray.h"
#include "nsDOMAttributeMap.h"
#include "nsContentUtils.h"
#include "nsThreadUtils.h"
#include "nsIDocumentViewer.h"
#include "nsIDOMXPathNSResolver.h"
@ -99,7 +98,7 @@
#include "imgIRequest.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIDOMTouchEvent.h"
#include "nsDataHashtable.h"
#include "TimeStamp.h"
#define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)

View File

@ -57,6 +57,7 @@
#include "nsICharsetConverterManager.h"
#include "nsIChannelPolicy.h"
#include "nsIContentSecurityPolicy.h"
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"
using namespace mozilla;

View File

@ -44,13 +44,12 @@
#define nsGenericDOMDataNode_h___
#include "nsIContent.h"
#include "nsIDOMCharacterData.h"
#include "nsTextFragment.h"
#include "nsDOMError.h"
#include "nsEventListenerManager.h"
#include "nsGenericElement.h"
#include "nsCycleCollectionParticipant.h"
#include "nsContentUtils.h"
#include "nsDOMMemoryReporter.h"
#ifdef MOZ_SMIL

View File

@ -2033,6 +2033,13 @@ nsNSElementTearoff::GetBoundingClientRect(nsIDOMClientRect** aResult)
return mContent->GetBoundingClientRect(aResult);
}
nsresult
nsGenericElement::GetElementsByClassName(const nsAString& aClasses,
nsIDOMNodeList** aReturn)
{
return nsContentUtils::GetElementsByClassName(this, aClasses, aReturn);
}
nsresult
nsGenericElement::GetClientRects(nsIDOMClientRectList** aResult)
{
@ -3543,6 +3550,19 @@ nsINode::doRemoveChildAt(PRUint32 aIndex, PRBool aNotify,
return NS_OK;
}
NS_IMETHODIMP
nsGenericElement::GetTextContent(nsAString &aTextContent)
{
nsContentUtils::GetNodeTextContent(this, PR_TRUE, aTextContent);
return NS_OK;
}
NS_IMETHODIMP
nsGenericElement::SetTextContent(const nsAString& aTextContent)
{
return nsContentUtils::SetNodeTextContent(this, aTextContent, PR_FALSE);
}
/* static */
nsresult
nsGenericElement::DispatchEvent(nsPresContext* aPresContext,

View File

@ -51,7 +51,6 @@
#include "nsIDOMDocumentFragment.h"
#include "nsIDOMNSElement.h"
#include "nsILinkHandler.h"
#include "nsContentUtils.h"
#include "nsNodeUtils.h"
#include "nsAttrAndChildArray.h"
#include "mozFlushType.h"
@ -63,6 +62,8 @@
#include "nsIDOMXPathNSResolver.h"
#include "nsPresContext.h"
#include "nsIDOMDOMStringMap.h"
#include "nsContentList.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA
#ifdef MOZ_SMIL
#include "nsISMILAttr.h"
@ -256,15 +257,8 @@ public:
virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify);
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
NS_IMETHOD GetTextContent(nsAString &aTextContent)
{
nsContentUtils::GetNodeTextContent(this, PR_TRUE, aTextContent);
return NS_OK;
}
NS_IMETHOD SetTextContent(const nsAString& aTextContent)
{
return nsContentUtils::SetNodeTextContent(this, aTextContent, PR_FALSE);
}
NS_IMETHOD GetTextContent(nsAString &aTextContent);
NS_IMETHOD SetTextContent(const nsAString& aTextContent);
// nsIContent interface methods
virtual void UpdateEditableState(PRBool aNotify);
@ -590,10 +584,7 @@ public:
// nsIDOMNSElement methods
nsresult GetElementsByClassName(const nsAString& aClasses,
nsIDOMNodeList** aReturn)
{
return nsContentUtils::GetElementsByClassName(this, aClasses, aReturn);
}
nsIDOMNodeList** aReturn);
nsresult GetClientRects(nsIDOMClientRectList** aResult);
nsresult GetBoundingClientRect(nsIDOMClientRect** aResult);
PRInt32 GetScrollTop();

View File

@ -50,7 +50,7 @@
#include "imgIRequest.h"
#include "prtypes.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsContentUtils.h" // NS_CONTENT_DELETE_LIST_MEMBER
#include "nsString.h"
#include "nsEventStates.h"

View File

@ -41,9 +41,7 @@
#include "nsGenericDOMDataNode.h"
#include "nsIDOMText.h"
#include "nsContentUtils.h"
#include "nsIDOMEventListener.h"
#include "nsIDOMMutationEvent.h"
#include "nsIAttribute.h"
#include "nsIDocument.h"
#include "nsThreadUtils.h"

View File

@ -52,6 +52,7 @@
#include "nsNetUtil.h"
#include "nsComponentManagerUtils.h"
#include "nsNullPrincipal.h"
#include "nsContentUtils.h"
//
// Thanks to Mark Pilgrim and Sam Ruby for the initial whitelist

View File

@ -1348,6 +1348,12 @@ nsXMLHttpRequest::GetCurrentHttpChannel()
return httpChannel;
}
bool
nsXMLHttpRequest::IsSystemXHR()
{
return !!nsContentUtils::IsSystemPrincipal(mPrincipal);
}
nsresult
nsXMLHttpRequest::CheckChannelForCrossSiteRequest(nsIChannel* aChannel)
{

View File

@ -226,9 +226,7 @@ protected:
already_AddRefed<nsIHttpChannel> GetCurrentHttpChannel();
bool IsSystemXHR() {
return !!nsContentUtils::IsSystemPrincipal(mPrincipal);
}
bool IsSystemXHR();
/**
* Check if aChannel is ok for a cross-site request by making sure no

View File

@ -44,6 +44,7 @@
#include "nsIDOMElement.h"
#include "nsTHashtable.h"
#include "nsHTMLCanvasElement.h"
#include "nsContentUtils.h"
namespace mozilla {
@ -211,4 +212,4 @@ CanvasImageCacheShutdownObserver::Observe(nsISupports *aSubject,
return NS_OK;
}
}
} // namespace mozilla

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/ipc/DocumentRendererChild.h"
#include "base/basictypes.h"
#include "gfxImageSurface.h"
@ -53,8 +55,7 @@
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "nsLayoutUtils.h"
#include "mozilla/ipc/DocumentRendererChild.h"
#include "nsContentUtils.h"
using namespace mozilla::ipc;

View File

@ -38,6 +38,8 @@
* ***** END LICENSE BLOCK ***** */
#include "nsDOMNotifyAudioAvailableEvent.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA, NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO
#include "nsContentUtils.h" // NS_DROP_JS_OBJECTS
#include "jstypedarray.h"
nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(nsPresContext* aPresContext,

View File

@ -69,6 +69,7 @@
#include "nsIStringBundle.h"
#include "nsCExternalHandlerService.h"
#include "nsIFileStreams.h"
#include "nsContentUtils.h"
static void
SendJSWarning(nsIDocument* aDocument,

View File

@ -37,20 +37,21 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsILink.h"
#include "Link.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
#include "nsGkAtoms.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsPresContext.h"
#include "nsHTMLDNSPrefetch.h"
#include "Link.h"
using namespace mozilla::dom;
class nsHTMLAnchorElement : public nsGenericHTMLElement,

View File

@ -65,6 +65,7 @@
#include "nsEventDispatcher.h"
#include "nsIDOMProgressEvent.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -46,6 +46,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsIXPConnect.h"
#include "jsapi.h"
#include "nsContentUtils.h"
#include "nsJSUtils.h"
#include "nsMathUtils.h"
#include "mozilla/Preferences.h"

View File

@ -38,6 +38,8 @@
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLElement.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;
class nsHTMLElement : public nsGenericHTMLElement,

View File

@ -34,13 +34,15 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLMenuElement.h"
#include "nsIDOMNSHTMLElement.h"
#include "nsIDOMHTMLMenuItemElement.h"
#include "nsXULContextMenuBuilder.h"
#include "nsGUIEvent.h"
#include "nsEventDispatcher.h"
#include "nsHTMLMenuItemElement.h"
#include "nsHTMLMenuElement.h"
#include "nsContentUtils.h"
enum MenuType
{

View File

@ -37,6 +37,7 @@
#include "nsGUIEvent.h"
#include "nsEventDispatcher.h"
#include "nsHTMLMenuItemElement.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;
@ -218,13 +219,8 @@ nsHTMLMenuItemElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
{
*aResult = nsnull;
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsHTMLMenuItemElement *it = new nsHTMLMenuItemElement(ni.forget(),
NOT_FROM_PARSER);
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsCOMPtr<nsINode> kungFuDeathGrip = it;
nsRefPtr<nsHTMLMenuItemElement> it =
new nsHTMLMenuItemElement(ni.forget(), NOT_FROM_PARSER);
nsresult rv = CopyInnerTo(it);
if (NS_SUCCEEDED(rv)) {
switch (mType) {
@ -239,7 +235,7 @@ nsHTMLMenuItemElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
break;
}
kungFuDeathGrip.swap(*aResult);
it.forget(aResult);
}
return rv;

View File

@ -40,6 +40,7 @@
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsPLDOMEvent.h"
#include "nsContentUtils.h"
class nsHTMLMetaElement : public nsGenericHTMLElement,

View File

@ -44,7 +44,7 @@
#include "nsScriptElement.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsContentUtils.h"
#include "nsUnicharUtils.h" // for nsCaseInsensitiveStringComparator()
#include "jsapi.h"
#include "nsIScriptContext.h"

View File

@ -49,7 +49,6 @@
#include "nsIDOMHTMLOptionsCollection.h"
#include "nsIDOMNSHTMLOptionCollectn.h"
#include "nsISelectControlFrame.h"
#include "nsContentUtils.h"
#include "nsIHTMLCollection.h"
#include "nsIConstraintValidation.h"

View File

@ -42,13 +42,12 @@
#include "nsIDOMHTMLHeadElement.h"
#include "nsIDOMHTMLHtmlElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsRuleData.h"
#include "nsMappedAttributes.h"
#include "nsNetUtil.h"
#include "nsHTMLFormElement.h"
#include "nsHtml5Module.h"
#include "nsContentUtils.h"
// XXX nav4 has type= start= (same as OL/UL)

View File

@ -49,7 +49,7 @@
#include "nsUnicharUtils.h"
#include "nsParserUtils.h"
#include "nsThreadUtils.h"
#include "nsContentUtils.h"
class nsHTMLStyleElement : public nsGenericHTMLElement,
public nsIDOMHTMLStyleElement,

View File

@ -50,7 +50,7 @@
#include "nsRuleData.h"
#include "nsStyleContext.h"
#include "nsIDocument.h"
#include "nsContentUtils.h"
/* for collections */
#include "nsIDOMElement.h"
#include "nsGenericHTMLElement.h"

View File

@ -47,6 +47,7 @@
#include "nsStyleConsts.h"
#include "nsHTMLParts.h"
#include "nsRuleData.h"
#include "nsContentUtils.h"
class nsHTMLTableRowElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableRowElement

View File

@ -45,6 +45,7 @@
#include "nsRuleData.h"
#include "nsDOMError.h"
#include "nsIDocument.h"
#include "nsContentUtils.h"
// you will see the phrases "rowgroup" and "section" used interchangably

View File

@ -43,7 +43,7 @@
#include "nsDOMValidityState.h"
#include "nsIFormControl.h"
#include "nsHTMLFormElement.h"
#include "nsContentUtils.h"
const PRUint16 nsIConstraintValidation::sContentSpecifiedMaxLengthMessage = 256;

View File

@ -66,6 +66,7 @@
#include "nsIEditor.h"
#include "nsTextEditRules.h"
#include "nsEventListenerManager.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -73,6 +73,7 @@
#include "nsIDocShellTreeItem.h"
#include "nsThreadUtils.h"
#include "nsIScrollableFrame.h"
#include "nsContentUtils.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"

View File

@ -41,6 +41,7 @@
#include "nsContentCreatorFunctions.h"
#include "nsHTMLMediaElement.h"
#include "nsIDocShellTreeItem.h"
#include "nsContentUtils.h"
#include "mozilla/dom/Element.h"
namespace mozilla {

View File

@ -48,6 +48,7 @@
#include "nsBuiltinDecoder.h"
#include "nsBuiltinDecoderStateMachine.h"
#include "nsTimeRanges.h"
#include "nsContentUtils.h"
using namespace mozilla;

View File

@ -35,9 +35,11 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsMediaStream.h"
#include "mozilla/Mutex.h"
#include "nsDebug.h"
#include "nsMediaStream.h"
#include "nsMediaDecoder.h"
#include "nsNetUtil.h"
#include "nsThreadUtils.h"
@ -58,6 +60,7 @@
#include "nsURILoader.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Util.h" // for DebugOnly
#include "nsContentUtils.h"
#define HTTP_OK_CODE 200
#define HTTP_PARTIAL_RESPONSE_CODE 206

View File

@ -39,6 +39,7 @@
#include "nsGUIEvent.h"
#include "nsPresContext.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsDOMClassInfoID.h"
nsDOMTimeEvent::nsDOMTimeEvent(nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aPresContext, aEvent ? aEvent : new nsUIEvent(PR_FALSE, 0, 0)),

View File

@ -150,7 +150,9 @@ DOMSVGLength::SetValue(float aUserUnitValue)
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
NS_ENSURE_FINITE(aUserUnitValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aUserUnitValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
// Although the value passed in is in user units, this method does not turn
// this length into a user unit length. Instead it converts the user unit
@ -196,7 +198,9 @@ DOMSVGLength::SetValueInSpecifiedUnits(float aValue)
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
if (HasOwner()) {
InternalItem().SetValueInCurrentUnits(aValue);
@ -261,7 +265,9 @@ DOMSVGLength::NewValueSpecifiedUnits(PRUint16 aUnit, float aValue)
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
if (!SVGLength::IsValidUnitType(aUnit)) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;

View File

@ -41,6 +41,7 @@
#include "nsSVGElement.h"
#include "nsIDOMSVGNumber.h"
#include "nsDOMError.h"
#include "nsContentUtils.h"
// See the architecture comment in DOMSVGAnimatedNumberList.h.

View File

@ -42,6 +42,7 @@
#include "nsIDOMSVGPoint.h"
#include "nsDOMError.h"
#include "nsIDOMSVGMatrix.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
// See the architecture comment in DOMSVGPointList.h.

View File

@ -40,6 +40,7 @@
#include "SVGLength.h"
#include "nsContentCreatorFunctions.h" // For NS_NewSVGElement
#include "nsCharSeparatedTokenizer.h"
#include "nsContentUtils.h"
namespace mozilla {

View File

@ -43,7 +43,7 @@
#include "nsSVGString.h"
#include "nsCOMPtr.h"
#include "nsGkAtoms.h"
#include "nsContentUtils.h"
nsSVGElement::StringInfo nsSVGAElement::sStringInfo[2] =
{

View File

@ -37,6 +37,7 @@
#include "nsIDOMSVGURIReference.h"
#include "nsSVGString.h"
#include "nsSVGTextPositioningElement.h"
#include "nsContentUtils.h"
typedef nsSVGTextPositioningElement nsSVGAltGlyphElementBase;

View File

@ -40,6 +40,7 @@
#include "nsSVGUtils.h"
#include "nsSVGMarkerElement.h"
#include "nsMathUtils.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
#ifdef MOZ_SMIL
#include "nsSMILValue.h"
#include "SVGOrientSMILType.h"

View File

@ -42,6 +42,7 @@
#include "nsSMILAnimationController.h"
#include "nsSMILAnimationFunction.h"
#include "nsISMILAttr.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -50,6 +50,7 @@
#include "nsSVGUtils.h"
#include "nsDOMError.h"
#include "nsSVGRect.h"
#include "nsContentUtils.h"
//----------------------------------------------------------------------
// nsISupports methods

View File

@ -43,7 +43,7 @@
#include "nsIFrame.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGAttrTearoffTable.h"
#include "nsMathUtils.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
#ifdef MOZ_SMIL
#include "nsSMILValue.h"
#include "nsSMILFloatType.h"

View File

@ -42,6 +42,7 @@
#include "nsSVGUtils.h"
#include "nsSVGElement.h"
#include "nsDOMError.h"
#include "nsMathUtils.h"
#ifdef MOZ_SMIL
#include "nsISMILAttr.h"
@ -173,7 +174,9 @@ private:
{ *aResult = mVal->GetBaseValue(mSVGElement); return NS_OK; }
NS_IMETHOD SetValue(float aValue)
{
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValue(aValue, mSVGElement);
return NS_OK;
}
@ -182,7 +185,9 @@ private:
{ *aResult = mVal->mBaseVal; return NS_OK; }
NS_IMETHOD SetValueInSpecifiedUnits(float aValue)
{
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValueInSpecifiedUnits(aValue, mSVGElement);
return NS_OK;
}

View File

@ -43,6 +43,7 @@
#include "nsSVGUtils.h"
#include "nsSVGMarkerElement.h"
#include "gfxMatrix.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
using namespace mozilla;

View File

@ -39,6 +39,7 @@
#include "nsTextFormatter.h"
#include "prdtoa.h"
#include "nsMathUtils.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE
#ifdef MOZ_SMIL
#include "nsSMILValue.h"
#include "nsSMILFloatType.h"

View File

@ -41,6 +41,7 @@
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsSVGElement.h"
#include "nsDOMError.h"
#include "nsMathUtils.h"
#ifdef MOZ_SMIL
#include "nsISMILAttr.h"
@ -110,7 +111,9 @@ public:
{ *aResult = mVal->GetBaseValue(); return NS_OK; }
NS_IMETHOD SetBaseVal(float aValue)
{
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE);
return NS_OK;
}

View File

@ -41,6 +41,7 @@
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsSVGElement.h"
#include "nsDOMError.h"
#include "nsMathUtils.h"
#ifdef MOZ_SMIL
#include "nsISMILAttr.h"
@ -119,7 +120,9 @@ public:
{ *aResult = mVal->GetBaseValue(mIndex); return NS_OK; }
NS_IMETHOD SetBaseVal(float aValue)
{
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValue(aValue, mIndex, mSVGElement, PR_TRUE);
return NS_OK;
}

View File

@ -61,6 +61,7 @@
#include "nsSVGUtils.h"
#include "nsSVGSVGElement.h"
#include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN
#include "nsContentUtils.h"
#ifdef MOZ_SMIL
#include "nsEventDispatcher.h"

View File

@ -47,7 +47,7 @@
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsScriptElement.h"
#include "nsIDOMText.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -42,6 +42,7 @@
#include "nsUnicharUtils.h"
#include "nsIDocument.h"
#include "nsStyleLinkElement.h"
#include "nsContentUtils.h"
typedef nsSVGElement nsSVGStyleElementBase;

View File

@ -40,6 +40,7 @@
#include "nsIDOMSVGTSpanElement.h"
#include "nsSVGSVGElement.h"
#include "nsSVGTextPositioningElement.h"
#include "nsContentUtils.h"
typedef nsSVGTextPositioningElement nsSVGTSpanElementBase;

View File

@ -42,6 +42,7 @@
#include "nsIFrame.h"
#include "nsSVGTextPathElement.h"
#include "nsDOMError.h"
#include "nsContentUtils.h"
nsSVGElement::LengthInfo nsSVGTextPathElement::sLengthInfo[1] =
{

View File

@ -43,6 +43,7 @@
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -37,17 +37,13 @@
* ***** END LICENSE BLOCK ***** */
#include "nsXMLElement.h"
#include "nsContentUtils.h" // nsAutoScriptBlocker
nsresult
NS_NewXMLElement(nsIContent** aInstancePtrResult, already_AddRefed<nsINodeInfo> aNodeInfo)
{
nsXMLElement* it = new nsXMLElement(aNodeInfo);
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(*aInstancePtrResult = it);
return NS_OK;
}

View File

@ -48,6 +48,7 @@
#include "nsParserUtils.h"
#include "nsGkAtoms.h"
#include "nsThreadUtils.h"
#include "nsContentUtils.h"
class nsXMLStylesheetPI : public nsXMLProcessingInstruction,
public nsStyleLinkElement

View File

@ -3177,6 +3177,35 @@ nsXULPrototypeScript::Compile(const PRUnichar* aText,
return rv;
}
void
nsXULPrototypeScript::UnlinkJSObjects()
{
if (mScriptObject.mObject) {
nsContentUtils::DropScriptObjects(mScriptObject.mLangID, this,
&NS_CYCLE_COLLECTION_NAME(nsXULPrototypeNode));
mScriptObject.mObject = nsnull;
}
}
void
nsXULPrototypeScript::Set(void *aObject)
{
NS_ASSERTION(!mScriptObject.mObject, "Leaking script object.");
if (!aObject) {
mScriptObject.mObject = nsnull;
return;
}
nsresult rv = nsContentUtils::HoldScriptObject(mScriptObject.mLangID,
this,
&NS_CYCLE_COLLECTION_NAME(nsXULPrototypeNode),
aObject, PR_FALSE);
if (NS_SUCCEEDED(rv)) {
mScriptObject.mObject = aObject;
}
}
//----------------------------------------------------------------------
//
// nsXULPrototypeText

View File

@ -333,14 +333,7 @@ public:
nsIDocument* aDocument,
nsIScriptGlobalObjectOwner* aGlobalOwner);
void UnlinkJSObjects()
{
if (mScriptObject.mObject) {
nsContentUtils::DropScriptObjects(mScriptObject.mLangID, this,
&NS_CYCLE_COLLECTION_NAME(nsXULPrototypeNode));
mScriptObject.mObject = nsnull;
}
}
void UnlinkJSObjects();
void Set(nsScriptObjectHolder &aHolder)
{
@ -350,23 +343,7 @@ public:
mScriptObject.mLangID = aHolder.getScriptTypeID();
Set((void*)aHolder);
}
void Set(void *aObject)
{
NS_ASSERTION(!mScriptObject.mObject, "Leaking script object.");
if (!aObject) {
mScriptObject.mObject = nsnull;
return;
}
nsresult rv = nsContentUtils::HoldScriptObject(mScriptObject.mLangID,
this,
&NS_CYCLE_COLLECTION_NAME(nsXULPrototypeNode),
aObject, PR_FALSE);
if (NS_SUCCEEDED(rv)) {
mScriptObject.mObject = aObject;
}
}
void Set(void *aObject);
struct ScriptObjectHolder
{

View File

@ -107,6 +107,7 @@
#include "nsXULTemplateQueryProcessorRDF.h"
#include "nsXULTemplateQueryProcessorXML.h"
#include "nsXULTemplateQueryProcessorStorage.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;

View File

@ -44,6 +44,8 @@
#ifndef nsDOMClassInfoID_h__
#define nsDOMClassInfoID_h__
#include "nsIXPCScriptable.h"
#define DOMCI_CLASS(_dom_class) \
eDOMClassInfo_##_dom_class##_id,

View File

@ -118,7 +118,6 @@
#include "nsIDOMHTMLBodyElement.h"
// Misc
#include "TextEditorTest.h"
#include "nsEditorUtils.h"
#include "nsIContentFilter.h"
#include "nsEventDispatcher.h"
@ -128,6 +127,7 @@
#include "nsIPrincipal.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"
using namespace mozilla;

View File

@ -89,7 +89,7 @@
#include "nsFocusManager.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsContentUtils.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"

View File

@ -69,7 +69,6 @@
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
#include "nsContentUtils.h"
#include "nsIWidget.h"
#include "mozilla/TimeStamp.h"
#include "nsIContent.h"

View File

@ -58,7 +58,7 @@
#ifdef MOZ_MEDIA
#include "nsHTMLMediaElement.h"
#endif
#include "nsContentUtils.h"
#include "imgILoader.h"
#include "nsIParser.h"
#include "nsMimeTypes.h"

View File

@ -84,6 +84,7 @@
#include "nsIDOMEventListener.h"
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
#include "nsContentUtils.h"
// Constants
const nscoord kMaxDropDownRows = 20; // This matches the setting for 4.x browsers

View File

@ -42,6 +42,7 @@
#include "nsIAnonymousContentCreator.h"
#include "nsCOMPtr.h"
class nsBaseContentList;
class nsProgressFrame : public nsHTMLContainerFrame,
public nsIAnonymousContentCreator

View File

@ -48,6 +48,7 @@
#include "nsStubMutationObserver.h"
#include "nsITextControlElement.h"
#include "nsIStatefulFrame.h"
#include "nsContentUtils.h" // nsAutoScriptBlocker
class nsIEditor;
class nsISelectionController;

View File

@ -47,6 +47,7 @@
#include "nsIContent.h"
#include "nsStyleContext.h"
class nsBaseContentList;
class nsIFrame;
template <class T, class A> class nsTArray;

View File

@ -44,7 +44,6 @@
*/
#include "mozilla/layout/RenderFrameParent.h"
using mozilla::layout::RenderFrameParent;
#include "nsSubDocumentFrame.h"
#include "nsCOMPtr.h"
@ -89,6 +88,8 @@ using mozilla::layout::RenderFrameParent;
#include "nsLayoutUtils.h"
#include "FrameLayerBuilder.h"
#include "nsObjectFrame.h"
#include "nsIServiceManager.h"
#include "nsContentUtils.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
@ -98,9 +99,9 @@ using mozilla::layout::RenderFrameParent;
#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
using namespace mozilla;
using mozilla::layout::RenderFrameParent;
static nsIDocument*
GetDocumentFromView(nsIView* aView)

View File

@ -58,6 +58,7 @@
#include "nsIImageLoadingContent.h"
#include "nsDisplayList.h"
#include "nsCSSRendering.h"
#include "nsContentUtils.h"
#ifdef ACCESSIBILITY
#include "nsIServiceManager.h"

View File

@ -41,7 +41,7 @@
#include "AnimationCommon.h"
#include "nsCSSPseudoElements.h"
#include "nsStyleContext.h"
#include "nsTHashtable.h"
#include "nsDataHashtable.h"
#include "nsGUIEvent.h"
#include "mozilla/TimeStamp.h"
#include "nsThreadUtils.h"

View File

@ -41,6 +41,7 @@
#include "nsPresContext.h"
#include "nsIMediaList.h"
#include "nsCSSParser.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA
nsDOMMediaQueryList::nsDOMMediaQueryList(nsPresContext *aPresContext,
const nsAString &aMediaQueryList)

View File

@ -43,6 +43,7 @@
#include "nsStyleUtil.h"
#include "nsDOMCSSRGBColor.h"
#include "nsIDOMRect.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA
nsROCSSPrimitiveValue::nsROCSSPrimitiveValue()
: mType(CSS_PX)

View File

@ -47,6 +47,7 @@
#include "gfxRect.h"
#include "gfxMatrix.h"
#include "nsSVGMatrix.h"
#include "nsTextFragment.h"
class nsSVGTextFrame;
class nsSVGTextPathFrame;

View File

@ -48,6 +48,7 @@
#include "nsSVGGradientFrame.h"
#include "gfxContext.h"
#include "gfxPattern.h"
#include "nsContentUtils.h"
//----------------------------------------------------------------------
// Implementation

View File

@ -36,9 +36,10 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGPatternFrame.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGAnimatedRect.h"
#include "nsIDOMSVGAnimTransformList.h"
#include "nsSVGTransformList.h"
#include "nsStyleContext.h"
#include "nsINameSpaceManager.h"
@ -50,12 +51,12 @@
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGPatternElement.h"
#include "nsSVGGeometryFrame.h"
#include "nsSVGPatternFrame.h"
#include "nsSVGAnimatedTransformList.h"
#include "gfxContext.h"
#include "gfxPlatform.h"
#include "gfxPattern.h"
#include "gfxMatrix.h"
#include "nsContentUtils.h"
using namespace mozilla;
@ -336,7 +337,7 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface,
}
// caller now owns the surface
tmpSurface.swap(*surface);
tmpSurface.forget(surface);
return NS_OK;
}

View File

@ -42,6 +42,7 @@
#include "nsIDOMSVGMatrix.h"
#include "nsSVGPaintServerFrame.h"
#include "gfxMatrix.h"
#include "nsIDOMSVGAnimTransformList.h"
class nsIFrame;
class nsSVGLength2;

View File

@ -608,7 +608,7 @@ nsXULTooltipListener::FindTooltip(nsIContent* aTarget, nsIContent** aTooltip)
#ifdef MOZ_XUL
mNeedTitletip = PR_FALSE;
#endif
*aTooltip = tooltipEl.forget().get();
tooltipEl.forget(aTooltip);
return NS_OK;
}
}

View File

@ -61,8 +61,6 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
// Automatic miss. Build the table
mTransitionTable =
new nsObjectHashtable(nsnull, nsnull, DeleteDFAState, nsnull);
if (!mTransitionTable)
return nsnull;
}
// The first transition is always made off the supplied pseudo-element.
@ -72,8 +70,6 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
if (!currState) {
// We had a miss. Make a new state and add it to our hash.
currState = new nsDFAState(mNextState);
if (!currState)
return nsnull;
mNextState++;
mTransitionTable->Put(&key, currState);
}
@ -86,9 +82,6 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
if (!currState) {
// We had a miss. Make a new state and add it to our hash.
currState = new nsDFAState(mNextState);
if (!currState)
return nsnull;
mNextState++;
mTransitionTable->Put(&key, currState);
}
@ -108,8 +101,6 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
// Put the style context in our table, transferring the owning reference to the table.
if (!mCache) {
mCache = new nsObjectHashtable(nsnull, nsnull, ReleaseStyleContext, nsnull);
if (!mCache)
return nsnull;
}
mCache->Put(currState, result);
}

View File

@ -47,7 +47,7 @@
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsParserCIID.h"
#include "nsParserCIID.h"
#include "nsContentUtils.h"
#include "nsIContentSink.h"
#include "nsIHTMLToTextSink.h"
#include "nsIDocumentEncoder.h"

View File

@ -61,7 +61,7 @@
#include "nsCRT.h"
#include "nsIDOMNode.h"
#include "nsIContent.h"
#include "mozilla/dom/Element.h"
#include "nsIFrame.h"
#include "nsFrameTraversal.h"
#include "nsIDOMDocument.h"

View File

@ -85,7 +85,7 @@
#include "nsReadableUtils.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsContentUtils.h"
#include "nsWebShellWindow.h" // get rid of this one, too...
#include "prenv.h"