author | Jeff Walden <jwalden@mit.edu> |
Wed, 12 Oct 2011 12:21:53 -0700 | |
changeset 78645 | 9408e8c33a1ccc5348a140e8c81ea4c63e0492bf |
parent 78644 | 4fb9f6e41c9f3659260dd7468af737ddb10513f5 |
child 78646 | ceb6b4df17d5398bc702e0787a0f3982563e4434 |
push id | 21321 |
push user | mak77@bonardo.net |
push date | Thu, 13 Oct 2011 13:50:30 +0000 |
treeherder | mozilla-central@d6d3a1f90e2e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | epic-fail |
milestone | 10.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/nsAccessibleWrap.cpp @@ -33,18 +33,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsAccessible.h" #include "nsAccessibleWrap.h" #include "nsAccUtils.h" #include "nsApplicationAccessibleWrap.h" #include "nsIAccessibleRelation.h" #include "nsRootAccessible.h" #include "nsDocAccessibleWrap.h" @@ -66,17 +64,16 @@ #include "nsMaiInterfaceHypertext.h" #include "nsMaiInterfaceHyperlinkImpl.h" #include "nsMaiInterfaceTable.h" #include "nsXPCOMStrings.h" #include "nsComponentManagerUtils.h" #include "nsMaiInterfaceDocument.h" #include "nsMaiInterfaceImage.h" -using namespace mozilla; using namespace mozilla::a11y; nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals = eUnknown; //defined in nsApplicationAccessibleWrap.cpp extern "C" GType g_atk_hyperlink_impl_type; @@ -520,17 +517,17 @@ GetMaiAtkType(PRUint16 interfacesBits) static PRUint16 typeRegCount = 0; if (typeRegCount++ >= 4095) { return G_TYPE_INVALID; } type = g_type_register_static(MAI_TYPE_ATK_OBJECT, atkTypeName, &tinfo, GTypeFlags(0)); - for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) { + for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(atk_if_infos); index++) { if (interfacesBits & (1 << index)) { g_type_add_interface_static(type, GetAtkTypeForMai((MaiInterfaceType)index), &atk_if_infos[index]); } } return type; @@ -961,17 +958,17 @@ refRelationSetCB(AtkObject *aAtkObj) nsIAccessibleRelation::RELATION_CONTROLLER_FOR, nsIAccessibleRelation::RELATION_EMBEDS, nsIAccessibleRelation::RELATION_FLOWS_TO, nsIAccessibleRelation::RELATION_FLOWS_FROM, nsIAccessibleRelation::RELATION_DESCRIBED_BY, nsIAccessibleRelation::RELATION_DESCRIPTION_FOR, }; - for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(relationTypes); i++) { AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]); AtkRelation* atkRelation = atk_relation_set_get_relation_by_type(relation_set, atkType); if (atkRelation) atk_relation_set_remove(relation_set, atkRelation); Relation rel(accWrap->RelationByType(relationTypes[i])); nsTArray<AtkObject*> targets;
--- a/accessible/src/base/nsARIAMap.cpp +++ b/accessible/src/base/nsARIAMap.cpp @@ -32,26 +32,23 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsARIAMap.h" #include "nsIAccessibleRole.h" #include "States.h" #include "nsIContent.h" -using namespace mozilla; using namespace mozilla::a11y; /** * This list of WAI-defined roles are currently hardcoded. * Eventually we will most likely be loading an RDF resource that contains this information * Using RDF will also allow for role extensibility. See bug 280138. * * Definition of nsRoleMapEntry and nsStateMapEntry contains comments explaining this table. @@ -572,17 +569,17 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] // on states eNoLiveAttr, kNoReqStates, eARIASelectable, eARIACheckedMixed } }; -PRUint32 nsARIAMap::gWAIRoleMapLength = ArrayLength(nsARIAMap::gWAIRoleMap); +PRUint32 nsARIAMap::gWAIRoleMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIRoleMap); nsRoleMapEntry nsARIAMap::gLandmarkRoleMap = { "", nsIAccessibleRole::ROLE_NOTHING, kUseNativeRole, eNoValue, eNoAction, eNoLiveAttr, @@ -729,17 +726,17 @@ nsAttributeCharacteristics nsARIAMap::gW {&nsGkAtoms::aria_setsize, ATTR_BYPASSOBJ }, /* handled via groupPosition */ {&nsGkAtoms::aria_sort, ATTR_VALTOKEN }, {&nsGkAtoms::aria_valuenow, ATTR_BYPASSOBJ }, {&nsGkAtoms::aria_valuemin, ATTR_BYPASSOBJ }, {&nsGkAtoms::aria_valuemax, ATTR_BYPASSOBJ }, {&nsGkAtoms::aria_valuetext, ATTR_BYPASSOBJ } }; -PRUint32 nsARIAMap::gWAIUnivAttrMapLength = ArrayLength(nsARIAMap::gWAIUnivAttrMap); +PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap); //////////////////////////////////////////////////////////////////////////////// // nsStateMapEntry nsStateMapEntry::nsStateMapEntry() : mAttributeName(nsnull), mIsToken(PR_FALSE),
--- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - // NOTE: alphabetically ordered #include "nsAccessibilityService.h" #include "nsCoreUtils.h" #include "nsAccUtils.h" #include "nsApplicationAccessibleWrap.h" #include "nsARIAGridAccessibleWrap.h" #include "nsARIAMap.h" #include "FocusManager.h" @@ -108,17 +106,16 @@ #ifndef DISABLE_XFORMS_HOOKS #include "nsXFormsFormControlsAccessible.h" #include "nsXFormsWidgetsAccessible.h" #endif #include "mozilla/FunctionTimer.h" #include "mozilla/dom/Element.h" -using namespace mozilla; using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// // nsAccessibilityService //////////////////////////////////////////////////////////////////////////////// nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull; bool nsAccessibilityService::gIsShutdown = true; @@ -652,17 +649,17 @@ nsAccessibilityService::GetAccessibleFor NS_IF_ADDREF(*aAccessible = GetAccessible(node)); return NS_OK; } NS_IMETHODIMP nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString) { - if ( aRole >= ArrayLength(kRoleNames)) { + if ( aRole >= NS_ARRAY_LENGTH(kRoleNames)) { aString.AssignLiteral("unknown"); return NS_OK; } CopyUTF8toUTF16(kRoleNames[aRole], aString); return NS_OK; } @@ -783,34 +780,34 @@ nsAccessibilityService::GetStringStates( return NS_OK; } // nsIAccessibleRetrieval::getStringEventType() NS_IMETHODIMP nsAccessibilityService::GetStringEventType(PRUint32 aEventType, nsAString& aString) { - NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames), + NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == NS_ARRAY_LENGTH(kEventTypeNames), "nsIAccessibleEvent constants are out of sync to kEventTypeNames"); - if (aEventType >= ArrayLength(kEventTypeNames)) { + if (aEventType >= NS_ARRAY_LENGTH(kEventTypeNames)) { aString.AssignLiteral("unknown"); return NS_OK; } CopyUTF8toUTF16(kEventTypeNames[aEventType], aString); return NS_OK; } // nsIAccessibleRetrieval::getStringRelationType() NS_IMETHODIMP nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType, nsAString& aString) { - if (aRelationType >= ArrayLength(kRelationTypeNames)) { + if (aRelationType >= NS_ARRAY_LENGTH(kRelationTypeNames)) { aString.AssignLiteral("unknown"); return NS_OK; } CopyUTF8toUTF16(kRelationTypeNames[aRelationType], aString); return NS_OK; }
--- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "AccIterator.h" #include "States.h" #include "nsAccCache.h" #include "nsAccessibilityService.h" #include "nsAccTreeWalker.h" #include "nsAccUtils.h" #include "nsRootAccessible.h" #include "nsTextEquivUtils.h" @@ -74,34 +72,34 @@ #include "nsIURI.h" #include "nsIWebNavigation.h" #include "nsFocusManager.h" #include "mozilla/dom/Element.h" #ifdef MOZ_XUL #include "nsIXULDocument.h" #endif -using namespace mozilla; +namespace dom = mozilla::dom; using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// // Static member initialization static nsIAtom** kRelationAttrs[] = { &nsGkAtoms::aria_labelledby, &nsGkAtoms::aria_describedby, &nsGkAtoms::aria_owns, &nsGkAtoms::aria_controls, &nsGkAtoms::aria_flowto, &nsGkAtoms::_for, &nsGkAtoms::control }; -static const PRUint32 kRelationAttrsLen = ArrayLength(kRelationAttrs); +static const PRUint32 kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs); //////////////////////////////////////////////////////////////////////////////// // Constructor/desctructor nsDocAccessible:: nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent, nsIWeakReference *aShell) : nsHyperTextAccessibleWrap(aRootContent, aShell),
--- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #define CreateEvent CreateEventA #include "nsIDOMDocument.h" #include "nsAccessibilityService.h" #include "nsApplicationAccessibleWrap.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "Relation.h" @@ -80,17 +78,17 @@ #include "nsFocusManager.h" #ifdef MOZ_XUL #include "nsXULTreeAccessible.h" #include "nsIXULDocument.h" #include "nsIXULWindow.h" #endif -using namespace mozilla; +namespace dom = mozilla::dom; using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// // nsISupports // Expanded version of NS_IMPL_ISUPPORTS_INHERITED2 // so we can QI directly to concrete nsRootAccessible NS_IMPL_QUERY_HEAD(nsRootAccessible) @@ -252,17 +250,17 @@ nsresult nsRootAccessible::AddEventListe // nsIDOMEventTarget interface allows to register event listeners to // receive untrusted events (synthetic events generated by untrusted code). // For example, XBL bindings implementations for elements that are hosted in // non chrome document fire untrusted events. nsCOMPtr<nsIDOMEventTarget> nstarget(do_QueryInterface(mDocument)); if (nstarget) { for (const char* const* e = docEvents, - * const* e_end = ArrayEnd(docEvents); + * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents); e < e_end; ++e) { nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE, PR_TRUE, 2); NS_ENSURE_SUCCESS(rv, rv); } } if (!mCaretAccessible) { @@ -272,17 +270,17 @@ nsresult nsRootAccessible::AddEventListe return nsDocAccessible::AddEventListeners(); } nsresult nsRootAccessible::RemoveEventListeners() { nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mDocument)); if (target) { for (const char* const* e = docEvents, - * const* e_end = ArrayEnd(docEvents); + * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents); e < e_end; ++e) { nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE); NS_ENSURE_SUCCESS(rv, rv); } } // Do this before removing clearing caret accessible, so that it can use // shutdown the caret accessible's selection listener
--- a/browser/components/migration/src/nsIEProfileMigrator.cpp +++ b/browser/components/migration/src/nsIEProfileMigrator.cpp @@ -34,18 +34,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include <stdio.h> #include <string.h> #include <windows.h> #include "nsAppDirectoryServiceDefs.h" #include "nsBrowserProfileMigratorUtils.h" #include "nsCOMPtr.h" #include "nsCRTGlue.h" #include "nsNetCID.h" @@ -106,18 +104,16 @@ NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\Main") #define REGISTRY_IE_TYPEDURL_KEY \ NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\TypedURLs") #define REGISTRY_IE_TOOLBAR_KEY \ NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\Toolbar") #define REGISTRY_IE_SEARCHURL_KEY \ NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\SearchUrl") -using namespace mozilla; - const int sInitialCookieBufferSize = 1024; // but it can grow const int sUsernameLengthLimit = 80; const int sHostnameLengthLimit = 255; //*********************************************************************** //*** Replacements for comsupp.lib calls used by pstorec.dll //*********************************************************************** void __stdcall _com_issue_error(HRESULT hr) @@ -1672,17 +1668,17 @@ nsIEProfileMigrator::ParseFavoritesFolde return rv; } nsresult nsIEProfileMigrator::CopyPreferences(bool aReplace) { bool regKeyOpen = false; const regEntry *entry, - *endEntry = ArrayEnd(gRegEntries); + *endEntry = gRegEntries + NS_ARRAY_LENGTH(gRegEntries); nsCOMPtr<nsIPrefBranch> prefs; { // scope pserve why not nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID)); if (pserve) pserve->GetBranch("", getter_AddRefs(prefs)); @@ -2167,17 +2163,17 @@ nsIEProfileMigrator::CopyProxyPreference { "https=", 6, PR_FALSE, "network.proxy.ssl", "network.proxy.ssl_port" }, { "socks=", 6, PR_FALSE, "network.proxy.socks", "network.proxy.socks_port" }, }; PRInt32 startIndex = 0, count = 0; bool foundSpecificProxy = false; - for (PRUint32 i = 0; i < ArrayLength(data); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(data); ++i) { PRInt32 offset = buf.Find(NS_ConvertASCIItoUTF16(data[i].prefix)); if (offset >= 0) { foundSpecificProxy = PR_TRUE; data[i].proxyConfigured = PR_TRUE; startIndex = offset + data[i].prefixLength; @@ -2190,17 +2186,17 @@ nsIEProfileMigrator::CopyProxyPreference data[i].portPref, aPrefs); } } if (!foundSpecificProxy) { // No proxy config for any specific type was found, assume // the ProxyServer value is of the form host:port and that // it applies to all protocols. - for (PRUint32 i = 0; i < ArrayLength(data); ++i) + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(data); ++i) SetProxyPref(buf, data[i].hostPref, data[i].portPref, aPrefs); aPrefs->SetBoolPref("network.proxy.share_proxy_settings", PR_TRUE); } } } return NS_OK;
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp +++ b/browser/components/migration/src/nsOperaProfileMigrator.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsAppDirectoryServiceDefs.h" #include "nsBrowserProfileMigratorUtils.h" #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsDocShellCID.h" #include "nsINavBookmarksService.h" #include "nsBrowserCompsCID.h" #include "nsIBrowserProfileMigrator.h" @@ -65,18 +63,16 @@ #include "nsISupportsPrimitives.h" #include "nsNetUtil.h" #include "nsOperaProfileMigrator.h" #include "nsToolkitCompsCID.h" #ifdef XP_WIN #include <windows.h> #endif -using namespace mozilla; - #define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties" #ifdef XP_WIN #define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera") #define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini") #define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat") #define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr") #elif defined(XP_MACOSX) @@ -481,17 +477,17 @@ nsOperaProfileMigrator::CopyProxySetting PRInt32 networkProxyType = 0; const char* protocols[] = { "HTTP", "HTTPS", "FTP" }; const char* protocols_l[] = { "http", "https", "ftp" }; char toggleBuf[15], serverBuf[20], serverPrefBuf[20], serverPortPrefBuf[25]; PRInt32 enabled; - for (PRUint32 i = 0; i < ArrayLength(protocols); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(protocols); ++i) { sprintf(toggleBuf, "Use %s", protocols[i]); GetInteger(aParser, "Proxy", toggleBuf, &enabled); if (enabled) { // Enable the "manual configuration" setting if we have at least // one protocol using a Proxy. networkProxyType = 1; }
--- a/browser/components/shell/src/nsGNOMEShellService.cpp +++ b/browser/components/shell/src/nsGNOMEShellService.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsGNOMEShellService.h" #include "nsShellService.h" #include "nsIServiceManager.h" #include "nsILocalFile.h" #include "nsIProperties.h" #include "nsDirectoryServiceDefs.h" #include "nsIPrefService.h" @@ -65,18 +63,16 @@ #include <glib.h> #include <glib-object.h> #include <gtk/gtk.h> #include <gdk/gdk.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <limits.h> #include <stdlib.h> -using namespace mozilla; - struct ProtocolAssociation { const char *name; bool essential; }; struct MimeTypeAssociation { @@ -238,17 +234,17 @@ nsGNOMEShellService::IsDefaultBrowser(bo nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); bool enabled; nsCAutoString handler; nsCOMPtr<nsIGIOMimeApp> gioApp; - for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) { if (!appProtocols[i].essential) continue; if (gconf) { handler.Truncate(); gconf->GetAppForProtocol(nsDependentCString(appProtocols[i].name), &enabled, handler); @@ -294,17 +290,17 @@ nsGNOMEShellService::SetDefaultBrowser(b appKeyValue = tmp; g_free(tmp); } else { appKeyValue = mAppPath; } appKeyValue.AppendLiteral(" %s"); - for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) { if (appProtocols[i].essential || aClaimAllTypes) { gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name), appKeyValue); } } } if (giovfs) { @@ -327,26 +323,26 @@ nsGNOMEShellService::SetDefaultBrowser(b NS_ConvertUTF16toUTF8 id(brandShortName); nsCOMPtr<nsIGIOMimeApp> appInfo; rv = giovfs->CreateAppFromCommand(mAppPath, id, getter_AddRefs(appInfo)); NS_ENSURE_SUCCESS(rv, rv); // set handler for the protocols - for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) { if (appProtocols[i].essential || aClaimAllTypes) { appInfo->SetAsDefaultForURIScheme(nsDependentCString(appProtocols[i].name)); } } // set handler for .html and xhtml files and MIME types: if (aClaimAllTypes) { // Add mime types for html, xhtml extension and set app to just created appinfo. - for (unsigned int i = 0; i < ArrayLength(appTypes); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) { appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType)); appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions)); } } } return NS_OK; }
--- a/caps/src/nsNullPrincipal.cpp +++ b/caps/src/nsNullPrincipal.cpp @@ -37,31 +37,27 @@ * ***** END LICENSE BLOCK ***** */ /** * This is the principal that has no rights and can't be accessed by * anything other than itself and chrome; null principals are not * same-origin with anything but themselves. */ -#include "mozilla/Util.h" - #include "nsNullPrincipal.h" #include "nsNullPrincipalURI.h" #include "nsMemory.h" #include "nsIUUIDGenerator.h" #include "nsID.h" #include "nsNetUtil.h" #include "nsIClassInfoImpl.h" #include "nsNetCID.h" #include "nsDOMError.h" #include "nsScriptSecurityManager.h" -using namespace mozilla; - NS_IMPL_CLASSINFO(nsNullPrincipal, NULL, nsIClassInfo::MAIN_THREAD_ONLY, NS_NULLPRINCIPAL_CID) NS_IMPL_QUERY_INTERFACE2_CI(nsNullPrincipal, nsIPrincipal, nsISerializable) NS_IMPL_CI_INTERFACE_GETTER2(nsNullPrincipal, nsIPrincipal, nsISerializable) @@ -110,17 +106,17 @@ nsNullPrincipal::Init() nsID id; rv = uuidgen->GenerateUUIDInPlace(&id); NS_ENSURE_SUCCESS(rv, rv); char chars[NSID_LENGTH]; id.ToProvidedString(chars); PRUint32 suffixLen = NSID_LENGTH - 1; - PRUint32 prefixLen = ArrayLength(NS_NULLPRINCIPAL_PREFIX) - 1; + PRUint32 prefixLen = NS_ARRAY_LENGTH(NS_NULLPRINCIPAL_PREFIX) - 1; // Use an nsCString so we only do the allocation once here and then share // with nsJSPrincipals nsCString str; str.SetCapacity(prefixLen + suffixLen); str.Append(NS_NULLPRINCIPAL_PREFIX); str.Append(chars);
--- a/caps/src/nsScriptSecurityManager.cpp +++ b/caps/src/nsScriptSecurityManager.cpp @@ -35,19 +35,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "xpcprivate.h" #include "nsScriptSecurityManager.h" #include "nsIServiceManager.h" #include "nsIScriptObjectPrincipal.h" #include "nsIScriptContext.h" #include "nsIURL.h" #include "nsINestedURI.h" #include "nspr.h" @@ -942,17 +939,17 @@ nsScriptSecurityManager::CheckPropertyAc subjectOriginUnicode.get(), className.get(), IDToString(cx, aProperty), objectOriginUnicode.get(), subjectDomainUnicode.get(), objectDomainUnicode.get() }; - PRUint32 length = ArrayLength(formatStrings); + PRUint32 length = NS_ARRAY_LENGTH(formatStrings); // XXXbz Our localization system is stupid and can't handle not showing // some strings that get passed in. Which means that we have to get // our length precisely right: it has to be exactly the number of // strings our format string wants. This means we'll have to move // strings in the array as needed, sadly... if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin || !objectPrincipal) { @@ -964,17 +961,17 @@ nsScriptSecurityManager::CheckPropertyAc length -= 2; if (!subjectDomainUnicode.IsEmpty()) { stringName.AppendLiteral("SubjectDomain"); length += 1; } if (!objectDomainUnicode.IsEmpty()) { stringName.AppendLiteral("ObjectDomain"); length += 1; - if (length != ArrayLength(formatStrings)) { + if (length != NS_ARRAY_LENGTH(formatStrings)) { // We have an object domain but not a subject domain. // Scoot our string over one slot. See the XXX comment // above for why we need to do this. formatStrings[length-1] = formatStrings[length]; } } } @@ -1586,17 +1583,17 @@ nsScriptSecurityManager::CheckLoadURIWit NS_ENSURE_SUCCESS(rv, rv); if (!hasFlags) { nsXPIDLString message; NS_ConvertASCIItoUTF16 ucsTargetScheme(targetScheme); const PRUnichar* formatStrings[] = { ucsTargetScheme.get() }; rv = sStrBundle-> FormatStringFromName(NS_LITERAL_STRING("ProtocolFlagError").get(), formatStrings, - ArrayLength(formatStrings), + NS_ARRAY_LENGTH(formatStrings), getter_Copies(message)); if (NS_SUCCEEDED(rv)) { nsCOMPtr<nsIConsoleService> console( do_GetService("@mozilla.org/consoleservice;1")); NS_ENSURE_TRUE(console, NS_ERROR_FAILURE); console->LogStringMessage(message.get()); #ifdef DEBUG @@ -1627,17 +1624,17 @@ nsScriptSecurityManager::ReportError(JSC // Localize the error message nsXPIDLString message; NS_ConvertASCIItoUTF16 ucsSourceSpec(sourceSpec); NS_ConvertASCIItoUTF16 ucsTargetSpec(targetSpec); const PRUnichar *formatStrings[] = { ucsSourceSpec.get(), ucsTargetSpec.get() }; rv = sStrBundle->FormatStringFromName(PromiseFlatString(messageTag).get(), formatStrings, - ArrayLength(formatStrings), + NS_ARRAY_LENGTH(formatStrings), getter_Copies(message)); NS_ENSURE_SUCCESS(rv, rv); // If a JS context was passed in, set a JS exception. // Otherwise, print the error message directly to the JS console // and to standard output if (cx) { @@ -1706,17 +1703,17 @@ nsScriptSecurityManager::CheckLoadURIStr PRUint32 flags[] = { nsIURIFixup::FIXUP_FLAG_NONE, nsIURIFixup::FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP, nsIURIFixup::FIXUP_FLAGS_MAKE_ALTERNATE_URI, nsIURIFixup::FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP | nsIURIFixup::FIXUP_FLAGS_MAKE_ALTERNATE_URI }; - for (PRUint32 i = 0; i < ArrayLength(flags); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(flags); ++i) { rv = fixup->CreateFixupURI(aTargetURIStr, flags[i], getter_AddRefs(target)); NS_ENSURE_SUCCESS(rv, rv); rv = CheckLoadURIWithPrincipal(aPrincipal, target, aFlags); NS_ENSURE_SUCCESS(rv, rv); } @@ -2679,17 +2676,17 @@ nsScriptSecurityManager::FormatCapabilit newcaps += capstr; else { nsXPIDLString extensionCap; const PRUnichar* formatArgs[] = { rawcap.get() }; rv = sStrBundle->FormatStringFromName( NS_LITERAL_STRING("ExtensionCapability").get(), formatArgs, - ArrayLength(formatArgs), + NS_ARRAY_LENGTH(formatArgs), getter_Copies(extensionCap)); if (NS_SUCCEEDED(rv)) newcaps += extensionCap; else newcaps += rawcap; } newcaps += NS_LITERAL_STRING("\n"); @@ -2768,17 +2765,17 @@ nsScriptSecurityManager::CheckConfirmDia NS_ConvertUTF8toUTF16 location(val); NS_ConvertASCIItoUTF16 capability(aCapability); FormatCapabilityString(capability); const PRUnichar *formatStrings[] = { location.get(), capability.get() }; nsXPIDLString message; rv = sStrBundle->FormatStringFromName(NS_LITERAL_STRING("EnableCapabilityQuery").get(), formatStrings, - ArrayLength(formatStrings), + NS_ARRAY_LENGTH(formatStrings), getter_Copies(message)); if (NS_FAILED(rv)) return PR_FALSE; PRInt32 buttonPressed = 1; // If the user exits by clicking the close box, assume No (button 1) rv = prompter->ConfirmEx(title.get(), message.get(), (nsIPrompt::BUTTON_DELAY_ENABLE) + (nsIPrompt::BUTTON_POS_1_DEFAULT) + @@ -2891,17 +2888,17 @@ nsScriptSecurityManager::EnableCapabilit NS_ConvertUTF8toUTF16 location(val); NS_ConvertUTF8toUTF16 cap(capability); const PRUnichar *formatStrings[] = { location.get(), cap.get() }; nsXPIDLString message; rv = sStrBundle->FormatStringFromName(NS_LITERAL_STRING("EnableCapabilityDenied").get(), formatStrings, - ArrayLength(formatStrings), + NS_ARRAY_LENGTH(formatStrings), getter_Copies(message)); if (NS_FAILED(rv)) return rv; SetPendingException(cx, message.get()); return NS_ERROR_FAILURE; // XXX better error code? } @@ -3057,17 +3054,17 @@ nsScriptSecurityManager::CanCreateWrappe GetPrincipalDomainOrigin(subjectPrincipal, origin); } NS_ConvertUTF8toUTF16 originUnicode(origin); NS_ConvertUTF8toUTF16 className(objClassInfo.GetName()); const PRUnichar* formatStrings[] = { className.get(), originUnicode.get() }; - PRUint32 length = ArrayLength(formatStrings); + PRUint32 length = NS_ARRAY_LENGTH(formatStrings); if (originUnicode.IsEmpty()) { --length; } else { strName.AppendLiteral("ForOrigin"); } nsXPIDLString errorMsg; // We need to keep our existing failure rv and not override it // with a likely success code from the following string bundle @@ -3851,17 +3848,17 @@ nsScriptSecurityManager::InitPrincipals( * codebase principals are disabled. Don't use trustedCodebase except with unspoofable * URLs such as HTTPS URLs. */ static const char idSuffix[] = ".id"; for (PRUint32 c = 0; c < aPrefCount; c++) { PRInt32 prefNameLen = PL_strlen(aPrefNames[c]) - - (ArrayLength(idSuffix) - 1); + (NS_ARRAY_LENGTH(idSuffix) - 1); if (PL_strcasecmp(aPrefNames[c] + prefNameLen, idSuffix) != 0) continue; nsAdoptingCString id = Preferences::GetCString(aPrefNames[c]); if (!id) { return NS_ERROR_FAILURE; }
--- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -357,16 +357,21 @@ LIB_SUFFIX = @LIB_SUFFIX@ DLL_SUFFIX = @DLL_SUFFIX@ BIN_SUFFIX = @BIN_SUFFIX@ ASM_SUFFIX = @ASM_SUFFIX@ IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@ LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@ USE_N32 = @USE_N32@ HAVE_64BIT_OS = @HAVE_64BIT_OS@ +# Temp hack. It is not my intention to leave this crap in here for ever. +# Im talking to fur right now to solve the problem without introducing +# NS_USE_NATIVE to the build system -ramiro. +NS_USE_NATIVE = @NS_USE_NATIVE@ + CC = @CC@ CXX = @CXX@ CC_VERSION = @CC_VERSION@ CXX_VERSION = @CXX_VERSION@ GNU_AS = @GNU_AS@ GNU_LD = @GNU_LD@
--- a/configure.in +++ b/configure.in @@ -2483,16 +2483,17 @@ ia64*-hpux*) TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"' SYSTEM_MAKEDEPEND= MOZ_FIX_LINK_PATHS= # $ORIGIN/.. is for shared libraries under components/ to locate shared # libraries one level up (e.g. libnspr4.so) if test "$SOLARIS_SUNPRO_CC"; then LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs" LIBS="-lCrun -lCstd -lc $LIBS" + NS_USE_NATIVE=1 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__" CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions -norunpath -D__FUNCTION__=__func__ -template=no%extdef" _MOZ_EXCEPTIONS_FLAGS_ON='-features=except' _MOZ_EXCEPTIONS_FLAGS_OFF='-features=no%except' LDFLAGS="-xildoff $LDFLAGS" if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then _SAVE_LDFLAGS=$LDFLAGS @@ -8203,16 +8204,17 @@ AC_SUBST(AS_DASH_C_FLAG) AC_SUBST(LD) AC_SUBST(RC) AC_SUBST(RCFLAGS) AC_SUBST(MC) AC_SUBST(WINDRES) AC_SUBST(IMPLIB) AC_SUBST(FILTER) AC_SUBST(BIN_FLAGS) +AC_SUBST(NS_USE_NATIVE) AC_SUBST(MOZ_WIDGET_TOOLKIT) AC_SUBST(MOZ_UPDATE_XTERM) AC_SUBST(MOZ_PLATFORM_MAEMO) AC_SUBST(MOZ_AUTH_EXTENSION) AC_SUBST(MOZ_PERMISSIONS) AC_SUBST(MOZ_XTF) AC_SUBST(MOZ_PREF_EXTENSIONS) AC_SUBST(MOZ_SMIL)
--- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -36,18 +36,16 @@ * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* A namespace class for static layout utilities. */ -#include "mozilla/Util.h" - #include "jsapi.h" #include "jsdbgapi.h" #include "nsJSUtils.h" #include "nsCOMPtr.h" #include "nsAString.h" #include "nsPrintfCString.h" #include "nsUnicharUtils.h" @@ -528,29 +526,29 @@ nsContentUtils::InitializeEventTable() { nsnull }; sAtomEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>; sStringEventTable = new nsDataHashtable<nsStringHashKey, EventNameMapping>; sUserDefinedEvents = new nsCOMArray<nsIAtom>(64); if (!sAtomEventTable || !sStringEventTable || !sUserDefinedEvents || - !sAtomEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1) || - !sStringEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1)) { + !sAtomEventTable->Init(int(NS_ARRAY_LENGTH(eventArray) / 0.75) + 1) || + !sStringEventTable->Init(int(NS_ARRAY_LENGTH(eventArray) / 0.75) + 1)) { delete sAtomEventTable; sAtomEventTable = nsnull; delete sStringEventTable; sStringEventTable = nsnull; delete sUserDefinedEvents; sUserDefinedEvents = nsnull; return PR_FALSE; } // Subtract one from the length because of the trailing null - for (PRUint32 i = 0; i < ArrayLength(eventArray) - 1; ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(eventArray) - 1; ++i) { if (!sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]) || !sStringEventTable->Put(Substring(nsDependentAtomString(eventArray[i].mAtom), 2), eventArray[i])) { delete sAtomEventTable; sAtomEventTable = nsnull; delete sStringEventTable; sStringEventTable = nsnull; return PR_FALSE; @@ -571,17 +569,17 @@ nsContentUtils::InitializeTouchEventTabl #define TOUCH_EVENT(name_, _id, _type, _struct) \ { nsGkAtoms::on##name_, _id, _type, _struct }, #include "nsEventNameList.h" #undef TOUCH_EVENT #undef EVENT nsnull }; // Subtract one from the length because of the trailing null - for (PRUint32 i = 0; i < ArrayLength(touchEventArray) - 1; ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(touchEventArray) - 1; ++i) { if (!sAtomEventTable->Put(touchEventArray[i].mAtom, touchEventArray[i]) || !sStringEventTable->Put(Substring(nsDependentAtomString(touchEventArray[i].mAtom), 2), touchEventArray[i])) { delete sAtomEventTable; sAtomEventTable = nsnull; delete sStringEventTable; sStringEventTable = nsnull; return; @@ -4135,17 +4133,17 @@ nsContentUtils::GetTopLevelWidget(nsIWid /* static */ const nsDependentString nsContentUtils::GetLocalizedEllipsis() { static PRUnichar sBuf[4] = { 0, 0, 0, 0 }; if (!sBuf[0]) { nsAdoptingString tmp = Preferences::GetLocalizedString("intl.ellipsis"); PRUint32 len = NS_MIN(PRUint32(tmp.Length()), - PRUint32(ArrayLength(sBuf) - 1)); + PRUint32(NS_ARRAY_LENGTH(sBuf) - 1)); CopyUnicodeTo(tmp, 0, sBuf, len); if (!sBuf[0]) sBuf[0] = PRUnichar(0x2026); } return nsDependentString(sBuf); } //static @@ -5136,17 +5134,17 @@ nsContentUtils::CanAccessNativeAnon() } // XXX HACK EWW! Allow chrome://global/ access to these things, even // if they've been cloned into less privileged contexts. static const char prefix[] = "chrome://global/"; const char *filename; if (fp && JS_IsScriptFrame(cx, fp) && (filename = JS_GetScriptFilename(cx, JS_GetFrameScript(cx, fp))) && - !strncmp(filename, prefix, ArrayLength(prefix) - 1)) { + !strncmp(filename, prefix, NS_ARRAY_LENGTH(prefix) - 1)) { return PR_TRUE; } // Before we throw, check for UniversalXPConnect. nsresult rv = sSecurityManager->IsCapabilityEnabled("UniversalXPConnect", &privileged); if (NS_SUCCEEDED(rv) && privileged) { return PR_TRUE; } @@ -5654,32 +5652,32 @@ nsContentUtils::FindInternalContentViewe *aLoaderType = TYPE_UNKNOWN; } return docFactory.forget(); } #ifdef MOZ_MEDIA #ifdef MOZ_OGG if (nsHTMLMediaElement::IsOggEnabled()) { - for (unsigned int i = 0; i < ArrayLength(nsHTMLMediaElement::gOggTypes); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(nsHTMLMediaElement::gOggTypes); ++i) { const char* type = nsHTMLMediaElement::gOggTypes[i]; if (!strcmp(aType, type)) { docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1"); if (docFactory && aLoaderType) { *aLoaderType = TYPE_CONTENT; } return docFactory.forget(); } } } #endif #ifdef MOZ_WEBM if (nsHTMLMediaElement::IsWebMEnabled()) { - for (unsigned int i = 0; i < ArrayLength(nsHTMLMediaElement::gWebMTypes); ++i) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(nsHTMLMediaElement::gWebMTypes); ++i) { const char* type = nsHTMLMediaElement::gWebMTypes[i]; if (!strcmp(aType, type)) { docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1"); if (docFactory && aLoaderType) { *aLoaderType = TYPE_CONTENT; } return docFactory.forget(); }
--- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -42,18 +42,16 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * Base class for all our document implementations. */ -#include "mozilla/Util.h" - #ifdef MOZ_LOGGING // so we can get logging even in release builds #define FORCE_PR_LOG 1 #endif #include "prlog.h" #include "plstr.h" #include "prprf.h" @@ -1798,17 +1796,17 @@ static const char* kNSURIs[] = { NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[512]; PRUint32 nsid = tmp->GetDefaultNamespaceID(); nsCAutoString uri; if (tmp->mDocumentURI) tmp->mDocumentURI->GetSpec(uri); - if (nsid < ArrayLength(kNSURIs)) { + if (nsid < NS_ARRAY_LENGTH(kNSURIs)) { PR_snprintf(name, sizeof(name), "nsDocument%s %s", kNSURIs[nsid], uri.get()); } else { PR_snprintf(name, sizeof(name), "nsDocument %s", uri.get()); } cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsDocument), name); }
--- a/content/base/src/nsEventSource.cpp +++ b/content/base/src/nsEventSource.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsEventSource.h" #include "nsNetUtil.h" #include "nsMimeTypes.h" #include "nsDOMMessageEvent.h" #include "nsIJSContextStack.h" #include "nsIPromptFactory.h" #include "nsIWindowWatcher.h" #include "nsPresContext.h" @@ -1093,21 +1091,21 @@ nsEventSource::ConsoleError() NS_ENSURE_SUCCESS(rv, rv); NS_ConvertUTF8toUTF16 specUTF16(targetSpec); const PRUnichar *formatStrings[] = { specUTF16.get() }; if (mReadyState == nsIEventSource::CONNECTING) { rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties", NS_LITERAL_STRING("connectionFailure").get(), - formatStrings, ArrayLength(formatStrings)); + formatStrings, NS_ARRAY_LENGTH(formatStrings)); } else { rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties", NS_LITERAL_STRING("netInterrupt").get(), - formatStrings, ArrayLength(formatStrings)); + formatStrings, NS_ARRAY_LENGTH(formatStrings)); } NS_ENSURE_SUCCESS(rv, rv); return NS_OK; } nsresult nsEventSource::DispatchFailConnection()
--- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -38,18 +38,16 @@ * ***** END LICENSE BLOCK ***** */ /* * Base class for all element classes; this provides an implementation * of DOM Core's nsIDOMElement, implements nsIContent, provides * utility methods for subclasses, and so forth. */ -#include "mozilla/Util.h" - #include "nsGenericElement.h" #include "nsDOMAttribute.h" #include "nsDOMAttributeMap.h" #include "nsIAtom.h" #include "nsINodeInfo.h" #include "nsIDocument.h" #include "nsIDOMNodeList.h" @@ -148,18 +146,18 @@ #include "prprf.h" #include "nsSVGFeatures.h" #include "nsDOMMemoryReporter.h" #include "nsWrapperCacheInlines.h" #include "xpcpublic.h" -using namespace mozilla; using namespace mozilla::dom; +namespace css = mozilla::css; NS_DEFINE_IID(kThisPtrOffsetsSID, NS_THISPTROFFSETS_SID); PRInt32 nsIContent::sTabFocusModel = eTabFocus_any; bool nsIContent::sTabFocusModelAppliesToXUL = false; PRUint32 nsMutationGuard::sMutationCount = 0; nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult); @@ -4320,17 +4318,17 @@ static const char* kNSURIs[] = { " (XML Events)" }; NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[72]; PRUint32 nsid = tmp->GetNameSpaceID(); nsAtomCString localName(tmp->NodeInfo()->NameAtom()); - if (nsid < ArrayLength(kNSURIs)) { + if (nsid < NS_ARRAY_LENGTH(kNSURIs)) { PR_snprintf(name, sizeof(name), "nsGenericElement%s %s", kNSURIs[nsid], localName.get()); } else { PR_snprintf(name, sizeof(name), "nsGenericElement %s", localName.get()); } cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsGenericElement), name);
--- a/content/base/src/nsGkAtoms.cpp +++ b/content/base/src/nsGkAtoms.cpp @@ -36,23 +36,19 @@ * ***** END LICENSE BLOCK ***** */ /* * This class wraps up the creation (and destruction) of the standard * set of atoms used by gklayout; the atoms are created when gklayout * is loaded and they are destroyed when gklayout is unloaded. */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsStaticAtom.h" -using namespace mozilla; - // define storage for all atoms #define GK_ATOM(name_, value_) nsIAtom* nsGkAtoms::name_; #include "nsGkAtomList.h" #undef GK_ATOM #define GK_ATOM(name_, value_) NS_STATIC_ATOM_BUFFER(name_##_buffer, value_) #include "nsGkAtomList.h" #undef GK_ATOM @@ -60,11 +56,11 @@ using namespace mozilla; static const nsStaticAtom GkAtoms_info[] = { #define GK_ATOM(name_, value_) NS_STATIC_ATOM(name_##_buffer, &nsGkAtoms::name_), #include "nsGkAtomList.h" #undef GK_ATOM }; void nsGkAtoms::AddRefAtoms() { - NS_RegisterStaticAtoms(GkAtoms_info, ArrayLength(GkAtoms_info)); + NS_RegisterStaticAtoms(GkAtoms_info, NS_ARRAY_LENGTH(GkAtoms_info)); }
--- a/content/base/src/nsNodeInfo.cpp +++ b/content/base/src/nsNodeInfo.cpp @@ -36,18 +36,16 @@ * ***** END LICENSE BLOCK ***** */ /* * Class that represents a prefix/namespace/localName triple; a single * nodeinfo is shared by all elements in a document that have that * prefix, namespace, and localName. */ -#include "mozilla/Util.h" - #include "nscore.h" #include "nsNodeInfo.h" #include "nsNodeInfoManager.h" #include "nsCOMPtr.h" #include "nsString.h" #include "nsIAtom.h" #include "nsDOMString.h" #include "nsCRT.h" @@ -55,18 +53,16 @@ #include "nsReadableUtils.h" #include "nsAutoPtr.h" #include NEW_H #include "nsFixedSizeAllocator.h" #include "prprf.h" #include "nsIDocument.h" #include "nsGkAtoms.h" -using namespace mozilla; - static const size_t kNodeInfoPoolSizes[] = { sizeof(nsNodeInfo) }; static const PRInt32 kNodeInfoPoolInitialSize = (NS_SIZE_IN_HEAP(sizeof(nsNodeInfo))) * 64; // static @@ -191,17 +187,17 @@ static const char* kNSURIs[] = { " (XUL)" }; NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsNodeInfo) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[72]; PRUint32 nsid = tmp->NamespaceID(); nsAtomCString localName(tmp->NameAtom()); - if (nsid < ArrayLength(kNSURIs)) { + if (nsid < NS_ARRAY_LENGTH(kNSURIs)) { PR_snprintf(name, sizeof(name), "nsNodeInfo%s %s", kNSURIs[nsid], localName.get()); } else { PR_snprintf(name, sizeof(name), "nsNodeInfo %s", localName.get()); } cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsNodeInfo), name);
--- a/content/base/src/nsTreeSanitizer.cpp +++ b/content/base/src/nsTreeSanitizer.cpp @@ -33,36 +33,32 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsTreeSanitizer.h" #include "nsCSSParser.h" #include "nsCSSProperty.h" #include "mozilla/css/Declaration.h" #include "mozilla/css/StyleRule.h" #include "mozilla/css/Rule.h" #include "nsUnicharInputStream.h" #include "nsCSSStyleSheet.h" #include "nsIDOMCSSRule.h" #include "nsAttrName.h" #include "nsIScriptSecurityManager.h" #include "nsNetUtil.h" #include "nsComponentManagerUtils.h" #include "nsNullPrincipal.h" #include "nsContentUtils.h" -using namespace mozilla; - // // Thanks to Mark Pilgrim and Sam Ruby for the initial whitelist // nsIAtom** const kElementsHTML[] = { &nsGkAtoms::a, &nsGkAtoms::abbr, &nsGkAtoms::acronym, &nsGkAtoms::address, @@ -1452,47 +1448,47 @@ nsTreeSanitizer::Sanitize(nsIContent* aF } void nsTreeSanitizer::InitializeStatics() { NS_PRECONDITION(!sElementsHTML, "Initializing a second time."); sElementsHTML = new nsTHashtable<nsISupportsHashKey> (); - sElementsHTML->Init(ArrayLength(kElementsHTML)); + sElementsHTML->Init(NS_ARRAY_LENGTH(kElementsHTML)); for (PRUint32 i = 0; kElementsHTML[i]; i++) { sElementsHTML->PutEntry(*kElementsHTML[i]); } sAttributesHTML = new nsTHashtable<nsISupportsHashKey> (); - sAttributesHTML->Init(ArrayLength(kAttributesHTML)); + sAttributesHTML->Init(NS_ARRAY_LENGTH(kAttributesHTML)); for (PRUint32 i = 0; kAttributesHTML[i]; i++) { sAttributesHTML->PutEntry(*kAttributesHTML[i]); } sElementsSVG = new nsTHashtable<nsISupportsHashKey> (); - sElementsSVG->Init(ArrayLength(kElementsSVG)); + sElementsSVG->Init(NS_ARRAY_LENGTH(kElementsSVG)); for (PRUint32 i = 0; kElementsSVG[i]; i++) { sElementsSVG->PutEntry(*kElementsSVG[i]); } sAttributesSVG = new nsTHashtable<nsISupportsHashKey> (); - sAttributesSVG->Init(ArrayLength(kAttributesSVG)); + sAttributesSVG->Init(NS_ARRAY_LENGTH(kAttributesSVG)); for (PRUint32 i = 0; kAttributesSVG[i]; i++) { sAttributesSVG->PutEntry(*kAttributesSVG[i]); } sElementsMathML = new nsTHashtable<nsISupportsHashKey> (); - sElementsMathML->Init(ArrayLength(kElementsMathML)); + sElementsMathML->Init(NS_ARRAY_LENGTH(kElementsMathML)); for (PRUint32 i = 0; kElementsMathML[i]; i++) { sElementsMathML->PutEntry(*kElementsMathML[i]); } sAttributesMathML = new nsTHashtable<nsISupportsHashKey> (); - sAttributesMathML->Init(ArrayLength(kAttributesMathML)); + sAttributesMathML->Init(NS_ARRAY_LENGTH(kAttributesMathML)); for (PRUint32 i = 0; kAttributesMathML[i]; i++) { sAttributesMathML->PutEntry(*kAttributesMathML[i]); } nsCOMPtr<nsIPrincipal> principal = do_CreateInstance(NS_NULLPRINCIPAL_CONTRACTID); principal.forget(&sNullPrincipal); }
--- a/content/base/src/nsWebSocket.cpp +++ b/content/base/src/nsWebSocket.cpp @@ -33,18 +33,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsWebSocket.h" #include "nsIScriptGlobalObject.h" #include "nsIDOMWindow.h" #include "nsIDocument.h" #include "nsXPCOM.h" #include "nsIXPConnect.h" #include "nsContentUtils.h" @@ -415,21 +413,21 @@ nsWebSocketEstablishedConnection::Consol NS_WARNING("Failed to get targetSpec"); } else { NS_ConvertUTF8toUTF16 specUTF16(targetSpec); const PRUnichar *formatStrings[] = { specUTF16.get() }; if (mStatus < CONN_CONNECTED_AND_READY) { PrintErrorOnConsole("chrome://global/locale/appstrings.properties", NS_LITERAL_STRING("connectionFailure").get(), - formatStrings, ArrayLength(formatStrings)); + formatStrings, NS_ARRAY_LENGTH(formatStrings)); } else { PrintErrorOnConsole("chrome://global/locale/appstrings.properties", NS_LITERAL_STRING("netInterrupt").get(), - formatStrings, ArrayLength(formatStrings)); + formatStrings, NS_ARRAY_LENGTH(formatStrings)); } } /// todo some specific errors - like for message too large return rv; } nsresult
--- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsXMLHttpRequest.h" #include "nsISimpleEnumerator.h" #include "nsIXPConnect.h" #include "nsICharsetConverterManager.h" #include "nsLayoutCID.h" #include "nsXPIDLString.h" #include "nsReadableUtils.h" #include "nsIURI.h" @@ -98,18 +96,16 @@ #include "nsChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsAsyncRedirectVerifyHelper.h" #include "jstypedarray.h" #include "nsStringBuffer.h" #include "nsDOMFile.h" #include "nsIFileChannel.h" -using namespace mozilla; - #define LOAD_STR "load" #define ERROR_STR "error" #define ABORT_STR "abort" #define LOADSTART_STR "loadstart" #define PROGRESS_STR "progress" #define UPLOADPROGRESS_STR "uploadprogress" #define READYSTATE_STR "readystatechange" #define LOADEND_STR "loadend" @@ -1269,17 +1265,17 @@ nsXMLHttpRequest::GetResponseHeader(cons } const char *kCrossOriginSafeHeaders[] = { "cache-control", "content-language", "content-type", "expires", "last-modified", "pragma" }; bool safeHeader = false; PRUint32 i; - for (i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kCrossOriginSafeHeaders); ++i) { if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) { safeHeader = PR_TRUE; break; } } if (!safeHeader) { nsCAutoString headerVal; @@ -2648,17 +2644,17 @@ nsXMLHttpRequest::SetRequestHeader(const const char *kInvalidHeaders[] = { "accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via" }; PRUint32 i; - for (i = 0; i < ArrayLength(kInvalidHeaders); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kInvalidHeaders); ++i) { if (header.LowerCaseEqualsASCII(kInvalidHeaders[i])) { NS_WARNING("refusing to set request header"); return NS_OK; } } if (StringBeginsWith(header, NS_LITERAL_CSTRING("proxy-"), nsCaseInsensitiveCStringComparator()) || StringBeginsWith(header, NS_LITERAL_CSTRING("sec-"), @@ -2670,17 +2666,17 @@ nsXMLHttpRequest::SetRequestHeader(const // Check for dangerous cross-site headers bool safeHeader = IsSystemXHR(); if (!safeHeader) { // Content-Type isn't always safe, but we'll deal with it in Send() const char *kCrossOriginSafeHeaders[] = { "accept", "accept-language", "content-language", "content-type", "last-event-id" }; - for (i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kCrossOriginSafeHeaders); ++i) { if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) { safeHeader = true; break; } } } if (!safeHeader) {
--- a/content/events/src/nsDOMDataTransfer.cpp +++ b/content/events/src/nsDOMDataTransfer.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsDOMDataTransfer.h" #include "prlog.h" #include "nsString.h" #include "nsIServiceManager.h" #include "nsIVariant.h" #include "nsISupportsPrimitives.h" #include "nsDOMClassInfoID.h" @@ -51,18 +49,16 @@ #include "nsDOMError.h" #include "nsIDragService.h" #include "nsIScriptableRegion.h" #include "nsContentUtils.h" #include "nsIContent.h" #include "nsCRT.h" #include "nsIScriptObjectPrincipal.h" -using namespace mozilla; - NS_IMPL_CYCLE_COLLECTION_2(nsDOMDataTransfer, mDragTarget, mDragImage) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMDataTransfer) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMDataTransfer) DOMCI_DATA(DataTransfer, nsDOMDataTransfer) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMDataTransfer) @@ -177,17 +173,17 @@ nsDOMDataTransfer::SetEffectAllowed(cons return NS_OK; } PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_NONE == 0); PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_COPY == 1); PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_MOVE == 2); PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_LINK == 4); - for (PRUint32 e = 0; e < ArrayLength(sEffects); e++) { + for (PRUint32 e = 0; e < NS_ARRAY_LENGTH(sEffects); e++) { if (aEffectAllowed.EqualsASCII(sEffects[e])) { mEffectAllowed = e; break; } } return NS_OK; } @@ -859,17 +855,17 @@ nsDOMDataTransfer::CacheExternalFormats( // there isn't a way to get a list of the formats that might be available on // all platforms, so just check for the types that can actually be imported // XXXndeakin there are some other formats but those are platform specific. const char* formats[] = { kFileMime, kHTMLMime, kURLMime, kURLDataMime, kUnicodeMime }; PRUint32 count; dragSession->GetNumDropItems(&count); for (PRUint32 c = 0; c < count; c++) { - for (PRUint32 f = 0; f < ArrayLength(formats); f++) { + for (PRUint32 f = 0; f < NS_ARRAY_LENGTH(formats); f++) { // IsDataFlavorSupported doesn't take an index as an argument and just // checks if any of the items support a particular flavor, even though // the GetData method does take an index. Here, we just assume that // every item being dragged has the same set of flavors. bool supported; dragSession->IsDataFlavorSupported(formats[f], &supported); // if the format is supported, add an item to the array with null as // the data. When retrieved, GetRealData will read the data.
--- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "base/basictypes.h" #include "IPC/IPCMessageUtils.h" #include "nsCOMPtr.h" #include "nsDOMEvent.h" #include "nsEventStateManager.h" #include "nsIFrame.h" #include "nsIContent.h" #include "nsIPresShell.h" @@ -439,17 +437,17 @@ ReportUseOfDeprecatedMethod(nsEvent* aEv { nsCOMPtr<nsIDocument> doc(GetDocumentForReport(aEvent)); nsAutoString type; aDOMEvent->GetType(type); const PRUnichar *strings[] = { type.get() }; nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES, aWarning, - strings, ArrayLength(strings), + strings, NS_ARRAY_LENGTH(strings), nsnull, EmptyString(), 0, 0, nsIScriptError::warningFlag, "DOM Events", doc); } NS_IMETHODIMP nsDOMEvent::PreventBubble()
--- a/content/html/content/src/nsFormSubmission.cpp +++ b/content/html/content/src/nsFormSubmission.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsFormSubmission.h" #include "nsCOMPtr.h" #include "nsIForm.h" #include "nsILinkHandler.h" #include "nsIDocument.h" #include "nsGkAtoms.h" #include "nsIHTMLDocument.h" @@ -68,18 +66,16 @@ #include "nsIMIMEService.h" #include "nsIConsoleService.h" #include "nsIScriptError.h" #include "nsIStringBundle.h" #include "nsCExternalHandlerService.h" #include "nsIFileStreams.h" #include "nsContentUtils.h" -using namespace mozilla; - static void SendJSWarning(nsIDocument* aDocument, const char* aWarningName, const PRUnichar** aWarningArgs, PRUint32 aWarningArgsLen) { nsContentUtils::ReportToConsole(nsContentUtils::eFORMS_PROPERTIES, aWarningName, aWarningArgs, aWarningArgsLen, @@ -266,17 +262,17 @@ HandleMailtoSubject(nsCString& aPath) { if (NS_FAILED(rv)) return; const PRUnichar *formatStrings[] = { brandName.get() }; nsXPIDLString subjectStr; rv = nsContentUtils::FormatLocalizedString( nsContentUtils::eFORMS_PROPERTIES, "DefaultFormSubject", formatStrings, - ArrayLength(formatStrings), + NS_ARRAY_LENGTH(formatStrings), subjectStr); if (NS_FAILED(rv)) return; aPath.AppendLiteral("subject="); nsCString subjectStrEscaped; aPath.Append(NS_EscapeURL(NS_ConvertUTF16toUTF8(subjectStr), esc_Query, subjectStrEscaped)); }
--- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -32,19 +32,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nscore.h" #include "nsGenericHTMLElement.h" #include "nsCOMPtr.h" #include "nsIAtom.h" #include "nsIContentViewer.h" #include "mozilla/css/StyleRule.h" #include "nsIDocument.h" #include "nsIDocumentEncoder.h" @@ -1443,17 +1440,17 @@ nsGenericHTMLElement::ParseAttribute(PRI bool nsGenericHTMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sCommonAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsGenericHTMLElement::GetAttributeMappingFunction() const { return &MapCommonAttributesInto; } @@ -2164,17 +2161,17 @@ nsGenericHTMLElement::MapScrollingAttrib if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Display))) return; // scrolling nsCSSValue* overflowValues[2] = { aData->ValueForOverflowX(), aData->ValueForOverflowY(), }; - for (PRUint32 i = 0; i < ArrayLength(overflowValues); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(overflowValues); ++i) { if (overflowValues[i]->GetUnit() == eCSSUnit_Null) { const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::scrolling); if (value && value->Type() == nsAttrValue::eEnum) { PRInt32 mappedValue; switch (value->GetEnumValue()) { case NS_STYLE_FRAME_ON: case NS_STYLE_FRAME_SCROLL: case NS_STYLE_FRAME_YES:
--- a/content/html/content/src/nsHTMLBRElement.cpp +++ b/content/html/content/src/nsHTMLBRElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLBRElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; - class nsHTMLBRElement : public nsGenericHTMLElement, public nsIDOMHTMLBRElement { public: nsHTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLBRElement(); // nsISupports @@ -157,16 +152,16 @@ nsHTMLBRElement::IsAttributeMapped(const { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLBRElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLBodyElement.cpp +++ b/content/html/content/src/nsHTMLBodyElement.cpp @@ -31,19 +31,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nscore.h" #include "nsCOMPtr.h" #include "nsIDOMHTMLBodyElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsPresContext.h" @@ -59,18 +56,16 @@ #include "nsIDocShell.h" #include "nsIEditorDocShell.h" #include "nsCOMPtr.h" #include "nsRuleWalker.h" #include "jsapi.h" //---------------------------------------------------------------------- -using namespace mozilla; - class nsHTMLBodyElement; class BodyRule: public nsIStyleRule { public: BodyRule(nsHTMLBodyElement* aPart); virtual ~BodyRule(); NS_DECL_ISUPPORTS @@ -468,17 +463,17 @@ nsHTMLBodyElement::IsAttributeMapped(con }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sBackgroundAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } already_AddRefed<nsIEditor> nsHTMLBodyElement::GetAssociatedEditor() { nsIEditor* editor = nsnull; if (NS_SUCCEEDED(GetEditorInternal(&editor)) && editor) { return editor;
--- a/content/html/content/src/nsHTMLDivElement.cpp +++ b/content/html/content/src/nsHTMLDivElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLDivElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsDOMMemoryReporter.h" -using namespace mozilla; - class nsHTMLDivElement : public nsGenericHTMLElement, public nsIDOMHTMLDivElement { public: nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLDivElement(); // nsISupports @@ -165,25 +160,25 @@ MapMarqueeAttributesIntoRule(const nsMap NS_IMETHODIMP_(bool) nsHTMLDivElement::IsAttributeMapped(const nsIAtom* aAttribute) const { if (mNodeInfo->Equals(nsGkAtoms::div)) { static const MappedAttributeEntry* const map[] = { sDivAlignAttributeMap, sCommonAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } if (mNodeInfo->Equals(nsGkAtoms::marquee)) { static const MappedAttributeEntry* const map[] = { sImageMarginSizeAttributeMap, sBackgroundColorAttributeMap, sCommonAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } return nsGenericHTMLElement::IsAttributeMapped(aAttribute); } nsMapRuleToAttributesFunc nsHTMLDivElement::GetAttributeMappingFunction() const {
--- a/content/html/content/src/nsHTMLFontElement.cpp +++ b/content/html/content/src/nsHTMLFontElement.cpp @@ -29,32 +29,27 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsIDOMHTMLFontElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" #include "nsIDocument.h" -using namespace mozilla; - class nsHTMLFontElement : public nsGenericHTMLElement, public nsIDOMHTMLFontElement { public: nsHTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLFontElement(); // nsISupports @@ -276,17 +271,17 @@ nsHTMLFontElement::IsAttributeMapped(con { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLFontElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLFrameElement.cpp +++ b/content/html/content/src/nsHTMLFrameElement.cpp @@ -29,27 +29,23 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLFrameElement.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsDOMError.h" -using namespace mozilla; using namespace mozilla::dom; class nsHTMLFrameElement : public nsGenericHTMLFrameElement, public nsIDOMHTMLFrameElement { public: nsHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo, mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER); @@ -168,16 +164,16 @@ MapAttributesIntoRule(const nsMappedAttr NS_IMETHODIMP_(bool) nsHTMLFrameElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sScrollingAttributeMap, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLFrameElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLHRElement.cpp +++ b/content/html/content/src/nsHTMLHRElement.cpp @@ -30,31 +30,27 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGenericHTMLElement.h" #include "nsIDOMHTMLHRElement.h" #include "nsIDOMEventTarget.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" #include "nsCSSProps.h" -using namespace mozilla; - class nsHTMLHRElement : public nsGenericHTMLElement, public nsIDOMHTMLHRElement { public: nsHTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLHRElement(); // nsISupports @@ -329,17 +325,17 @@ nsHTMLHRElement::IsAttributeMapped(const { nsnull }, }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLHRElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLHeadingElement.cpp +++ b/content/html/content/src/nsHTMLHeadingElement.cpp @@ -29,30 +29,25 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLHeadingElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" #include "mozAutoDocUpdate.h" -using namespace mozilla; - class nsHTMLHeadingElement : public nsGenericHTMLElement, public nsIDOMHTMLHeadingElement { public: nsHTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLHeadingElement(); // nsISupports @@ -139,17 +134,17 @@ MapAttributesIntoRule(const nsMappedAttr NS_IMETHODIMP_(bool) nsHTMLHeadingElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sDivAlignAttributeMap, sCommonAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLHeadingElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLIFrameElement.cpp +++ b/content/html/content/src/nsHTMLIFrameElement.cpp @@ -29,32 +29,28 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLIFrameElement.h" #include "nsGenericHTMLElement.h" #include "nsIDOMDocument.h" #include "nsIDOMGetSVGDocument.h" #include "nsIDOMSVGDocument.h" #include "nsGkAtoms.h" #include "nsIDocument.h" #include "nsMappedAttributes.h" #include "nsDOMError.h" #include "nsRuleData.h" #include "nsStyleConsts.h" -using namespace mozilla; using namespace mozilla::dom; class nsHTMLIFrameElement : public nsGenericHTMLFrameElement , public nsIDOMHTMLIFrameElement , public nsIDOMGetSVGDocument { public: nsHTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo, @@ -251,17 +247,17 @@ nsHTMLIFrameElement::IsAttributeMapped(c static const MappedAttributeEntry* const map[] = { attributes, sScrollingAttributeMap, sImageAlignAttributeMap, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLIFrameElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule;
--- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -29,19 +29,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLImageElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsImageLoadingContent.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsMappedAttributes.h" @@ -398,17 +395,17 @@ nsHTMLImageElement::IsAttributeMapped(co { static const MappedAttributeEntry* const map[] = { sCommonAttributeMap, sImageMarginSizeAttributeMap, sImageBorderAttributeMap, sImageAlignAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLImageElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsHTMLInputElement.h" #include "nsIDOMHTMLInputElement.h" #include "nsITextControlElement.h" #include "nsIDOMNSEditableElement.h" #include "nsIRadioVisitor.h" #include "nsIPhonetic.h" @@ -2604,17 +2602,17 @@ nsHTMLInputElement::IsAttributeMapped(co static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sImageMarginSizeAttributeMap, sImageBorderAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLInputElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLLIElement.cpp +++ b/content/html/content/src/nsHTMLLIElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLLIElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; - class nsHTMLLIElement : public nsGenericHTMLElement, public nsIDOMHTMLLIElement { public: nsHTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLLIElement(); // nsISupports @@ -178,17 +173,17 @@ nsHTMLLIElement::IsAttributeMapped(const { nsnull }, }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLLIElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule;
--- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsIDOMHTMLMediaElement.h" #include "nsIDOMHTMLSourceElement.h" #include "nsHTMLMediaElement.h" #include "nsTimeRanges.h" #include "nsGenericHTMLElement.h" #include "nsPresContext.h" #include "nsIPresShell.h" #include "nsGkAtoms.h" @@ -1533,17 +1531,17 @@ static bool IsRawEnabled() { return Preferences::GetBool("media.raw.enabled"); } static bool IsRawType(const nsACString& aType) { if (!IsRawEnabled()) return false; - for (PRUint32 i = 0; i < ArrayLength(gRawTypes); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gRawTypes); ++i) { if (aType.EqualsASCII(gRawTypes[i])) return true; } return false; } #endif #ifdef MOZ_OGG // See http://www.rfc-editor.org/rfc/rfc5334.txt for the definitions @@ -1566,17 +1564,17 @@ nsHTMLMediaElement::IsOggEnabled() return Preferences::GetBool("media.ogg.enabled"); } bool nsHTMLMediaElement::IsOggType(const nsACString& aType) { if (!IsOggEnabled()) return false; - for (PRUint32 i = 0; i < ArrayLength(gOggTypes); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gOggTypes); ++i) { if (aType.EqualsASCII(gOggTypes[i])) return true; } return false; } #endif #ifdef MOZ_WAVE @@ -1601,17 +1599,17 @@ nsHTMLMediaElement::IsWaveEnabled() return Preferences::GetBool("media.wave.enabled"); } bool nsHTMLMediaElement::IsWaveType(const nsACString& aType) { if (!IsWaveEnabled()) return false; - for (PRUint32 i = 0; i < ArrayLength(gWaveTypes); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gWaveTypes); ++i) { if (aType.EqualsASCII(gWaveTypes[i])) return true; } return false; } #endif #ifdef MOZ_WEBM @@ -1633,17 +1631,17 @@ nsHTMLMediaElement::IsWebMEnabled() return Preferences::GetBool("media.webm.enabled"); } bool nsHTMLMediaElement::IsWebMType(const nsACString& aType) { if (!IsWebMEnabled()) return false; - for (PRUint32 i = 0; i < ArrayLength(gWebMTypes); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gWebMTypes); ++i) { if (aType.EqualsASCII(gWebMTypes[i])) return true; } return false; } #endif /* static */
--- a/content/html/content/src/nsHTMLOListElement.cpp +++ b/content/html/content/src/nsHTMLOListElement.cpp @@ -29,31 +29,26 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLOListElement.h" #include "nsIDOMHTMLDListElement.h" #include "nsIDOMHTMLUListElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; - class nsHTMLSharedListElement : public nsGenericHTMLElement, public nsIDOMHTMLOListElement, public nsIDOMHTMLDListElement, public nsIDOMHTMLUListElement { public: nsHTMLSharedListElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLSharedListElement(); @@ -230,17 +225,17 @@ nsHTMLSharedListElement::IsAttributeMapp { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } return nsGenericHTMLElement::IsAttributeMapped(aAttribute); } nsMapRuleToAttributesFunc nsHTMLSharedListElement::GetAttributeMappingFunction() const {
--- a/content/html/content/src/nsHTMLObjectElement.cpp +++ b/content/html/content/src/nsHTMLObjectElement.cpp @@ -31,34 +31,31 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsAutoPtr.h" #include "nsGenericHTMLElement.h" #include "nsObjectLoadingContent.h" #include "nsGkAtoms.h" #include "nsDOMError.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsIDOMSVGDocument.h" #include "nsIDOMGetSVGDocument.h" #include "nsIDOMHTMLObjectElement.h" #include "nsFormSubmission.h" #include "nsIObjectFrame.h" #include "nsNPAPIPluginInstance.h" #include "nsIConstraintValidation.h" -using namespace mozilla; using namespace mozilla::dom; class nsHTMLObjectElement : public nsGenericHTMLFormElement , public nsObjectLoadingContent , public nsIDOMHTMLObjectElement , public nsIConstraintValidation , public nsIDOMGetSVGDocument { @@ -487,17 +484,17 @@ nsHTMLObjectElement::IsAttributeMapped(c { static const MappedAttributeEntry* const map[] = { sCommonAttributeMap, sImageMarginSizeAttributeMap, sImageBorderAttributeMap, sImageAlignAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLObjectElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLParagraphElement.cpp +++ b/content/html/content/src/nsHTMLParagraphElement.cpp @@ -29,30 +29,26 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLParagraphElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; +// XXX missing nav attributes -// XXX missing nav attributes class nsHTMLParagraphElement : public nsGenericHTMLElement, public nsIDOMHTMLParagraphElement { public: nsHTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLParagraphElement(); @@ -141,17 +137,17 @@ MapAttributesIntoRule(const nsMappedAttr NS_IMETHODIMP_(bool) nsHTMLParagraphElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sDivAlignAttributeMap, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLParagraphElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLPreElement.cpp +++ b/content/html/content/src/nsHTMLPreElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLPreElement.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; - class nsHTMLPreElement : public nsGenericHTMLElement, public nsIDOMHTMLPreElement { public: nsHTMLPreElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLPreElement(); // nsISupports @@ -188,16 +183,16 @@ nsHTMLPreElement::IsAttributeMapped(cons { nsnull }, }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLPreElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsHTMLSelectElement.h" #include "nsHTMLOptionElement.h" #include "nsIDOMEventTarget.h" #include "nsContentCreatorFunctions.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsLayoutUtils.h" @@ -68,17 +66,16 @@ #include "nsDOMError.h" #include "nsServiceManagerUtils.h" #include "nsRuleData.h" #include "nsEventDispatcher.h" #include "mozilla/dom/Element.h" #include "mozAutoDocUpdate.h" #include "dombindings.h" -using namespace mozilla; using namespace mozilla::dom; NS_IMPL_ISUPPORTS1(nsSelectState, nsSelectState) NS_DEFINE_STATIC_IID_ACCESSOR(nsSelectState, NS_SELECT_STATE_IID) //---------------------------------------------------------------------- // // nsSafeOptionListMutation @@ -1526,17 +1523,17 @@ nsHTMLSelectElement::GetAttributeChangeH NS_IMETHODIMP_(bool) nsHTMLSelectElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sCommonAttributeMap, sImageAlignAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLSelectElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLSharedElement.cpp +++ b/content/html/content/src/nsHTMLSharedElement.cpp @@ -30,33 +30,30 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsIDOMHTMLParamElement.h" #include "nsIDOMHTMLBaseElement.h" #include "nsIDOMHTMLDirectoryElement.h" #include "nsIDOMHTMLQuoteElement.h" #include "nsIDOMHTMLHeadElement.h" #include "nsIDOMHTMLHtmlElement.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsRuleData.h" #include "nsMappedAttributes.h" #include "nsContentUtils.h" -using namespace mozilla; // XXX nav4 has type= start= (same as OL/UL) extern nsAttrValue::EnumTable kListTypeTable[]; class nsHTMLSharedElement : public nsGenericHTMLElement, public nsIDOMHTMLParamElement, public nsIDOMHTMLBaseElement, public nsIDOMHTMLDirectoryElement, @@ -309,17 +306,17 @@ nsHTMLSharedElement::IsAttributeMapped(c { nsnull} }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } return nsGenericHTMLElement::IsAttributeMapped(aAttribute); } static void SetBaseURIUsingFirstBaseWithHref(nsIDocument* aDocument, nsIContent* aMustMatch) {
--- a/content/html/content/src/nsHTMLSharedObjectElement.cpp +++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGenericHTMLElement.h" #include "nsObjectLoadingContent.h" #include "nsGkAtoms.h" #include "nsDOMError.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsIDOMHTMLAppletElement.h" #include "nsIDOMHTMLEmbedElement.h" @@ -52,17 +50,16 @@ // XXX this is to get around conflicts with windows.h defines // introduced through jni.h #ifdef XP_WIN #undef GetClassName #undef GetObject #endif -using namespace mozilla; using namespace mozilla::dom; class nsHTMLSharedObjectElement : public nsGenericHTMLElement , public nsObjectLoadingContent , public nsIDOMHTMLAppletElement , public nsIDOMHTMLEmbedElement , public nsIDOMGetSVGDocument { @@ -436,17 +433,17 @@ nsHTMLSharedObjectElement::IsAttributeMa { static const MappedAttributeEntry* const map[] = { sCommonAttributeMap, sImageMarginSizeAttributeMap, sImageBorderAttributeMap, sImageAlignAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLSharedObjectElement::GetAttributeMappingFunction() const { if (mNodeInfo->Equals(nsGkAtoms::embed)) { return &EmbedMapAttributesIntoRule;
--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp +++ b/content/html/content/src/nsHTMLTableCaptionElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLTableCaptionElem.h" #include "nsIDOMEventTarget.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -using namespace mozilla; - class nsHTMLTableCaptionElement : public nsGenericHTMLElement, public nsIDOMHTMLTableCaptionElement { public: nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLTableCaptionElement(); // nsISupports @@ -161,17 +156,17 @@ nsHTMLTableCaptionElement::IsAttributeMa { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableCaptionElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule;
--- a/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/content/html/content/src/nsHTMLTableCellElement.cpp @@ -29,36 +29,31 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLTableCellElement.h" #include "nsIDOMHTMLTableRowElement.h" #include "nsHTMLTableElement.h" #include "nsIDOMHTMLCollection.h" #include "nsIDOMEventTarget.h" #include "nsMappedAttributes.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsRuleData.h" #include "nsRuleWalker.h" #include "nsIDocument.h" #include "celldata.h" -using namespace mozilla; - class nsHTMLTableCellElement : public nsGenericHTMLElement, public nsIDOMHTMLTableCellElement { public: nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsHTMLTableCellElement(); // nsISupports @@ -427,16 +422,16 @@ nsHTMLTableCellElement::IsAttributeMappe }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sBackgroundAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableCellElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLTableColElement.cpp +++ b/content/html/content/src/nsHTMLTableColElement.cpp @@ -29,29 +29,24 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLTableColElement.h" #include "nsIDOMEventTarget.h" #include "nsMappedAttributes.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsRuleData.h" -using namespace mozilla; - // use the same protection as ancient code did // http://lxr.mozilla.org/classic/source/lib/layout/laytable.c#46 #define MAX_COLSPAN 1000 class nsHTMLTableColElement : public nsGenericHTMLElement, public nsIDOMHTMLTableColElement { public: @@ -227,17 +222,17 @@ nsHTMLTableColElement::IsAttributeMapped { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableColElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLTableElement.cpp +++ b/content/html/content/src/nsHTMLTableElement.cpp @@ -29,19 +29,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsHTMLTableElement.h" #include "nsIDOMHTMLTableCaptionElem.h" #include "nsIDOMHTMLTableSectionElem.h" #include "nsCOMPtr.h" #include "nsIDOMEventTarget.h" #include "nsDOMError.h" #include "nsContentList.h" #include "nsGenericHTMLElement.h" @@ -54,18 +51,16 @@ #include "nsIDocument.h" #include "nsContentUtils.h" #include "nsIDOMElement.h" #include "nsGenericHTMLElement.h" #include "nsIHTMLCollection.h" #include "nsHTMLStyleSheet.h" #include "dombindings.h" -using namespace mozilla; - /* ------------------------------ TableRowsCollection -------------------------------- */ /** * This class provides a late-bound collection of rows in a table. * mParent is NOT ref-counted to avoid circular references */ class TableRowsCollection : public nsIHTMLCollection, public nsWrapperCache { @@ -1156,17 +1151,17 @@ nsHTMLTableElement::IsAttributeMapped(co }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sBackgroundAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLTableRowElement.cpp +++ b/content/html/content/src/nsHTMLTableRowElement.cpp @@ -29,36 +29,31 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLTableRowElement.h" #include "nsIDOMHTMLTableElement.h" #include "nsIDOMHTMLTableSectionElem.h" #include "nsIDOMHTMLTableCellElement.h" #include "nsIDOMEventTarget.h" #include "nsDOMError.h" #include "nsMappedAttributes.h" #include "nsGenericHTMLElement.h" #include "nsContentList.h" #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsHTMLParts.h" #include "nsRuleData.h" #include "nsContentUtils.h" -using namespace mozilla; - class nsHTMLTableRowElement : public nsGenericHTMLElement, public nsIDOMHTMLTableRowElement { public: nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo); // nsISupports NS_DECL_ISUPPORTS_INHERITED @@ -457,17 +452,17 @@ nsHTMLTableRowElement::IsAttributeMapped }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sBackgroundAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableRowElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLTableSectionElement.cpp +++ b/content/html/content/src/nsHTMLTableSectionElement.cpp @@ -29,34 +29,29 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLTableSectionElem.h" #include "nsIDOMEventTarget.h" #include "nsMappedAttributes.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsHTMLParts.h" #include "nsStyleConsts.h" #include "nsContentList.h" #include "nsRuleData.h" #include "nsDOMError.h" #include "nsIDocument.h" #include "nsContentUtils.h" -using namespace mozilla; - // you will see the phrases "rowgroup" and "section" used interchangably class nsHTMLTableSectionElement : public nsGenericHTMLElement, public nsIDOMHTMLTableSectionElement { public: nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo); @@ -321,17 +316,17 @@ nsHTMLTableSectionElement::IsAttributeMa }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap, sBackgroundAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTableSectionElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsIDOMHTMLTextAreaElement.h" #include "nsITextControlElement.h" #include "nsIDOMNSEditableElement.h" #include "nsIControllers.h" #include "nsFocusManager.h" #include "nsPIDOMWindow.h" #include "nsContentCID.h" #include "nsCOMPtr.h" @@ -78,17 +76,16 @@ #include "mozAutoDocUpdate.h" #include "nsISupportsPrimitives.h" #include "nsContentCreatorFunctions.h" #include "nsIConstraintValidation.h" #include "nsHTMLFormElement.h" #include "nsTextEditorState.h" -using namespace mozilla; using namespace mozilla::dom; static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID); #define NS_NO_CONTENT_DISPATCH (1 << 0) class nsHTMLTextAreaElement : public nsGenericHTMLFormElement, public nsIDOMHTMLTextAreaElement, @@ -663,17 +660,17 @@ nsHTMLTextAreaElement::GetAttributeChang NS_IMETHODIMP_(bool) nsHTMLTextAreaElement::IsAttributeMapped(const nsIAtom* aAttribute) const { static const MappedAttributeEntry* const map[] = { sDivAlignAttributeMap, sCommonAttributeMap, }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLTextAreaElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/content/src/nsHTMLVideoElement.cpp +++ b/content/html/content/src/nsHTMLVideoElement.cpp @@ -30,19 +30,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsIDOMHTMLVideoElement.h" #include "nsIDOMHTMLSourceElement.h" #include "nsHTMLVideoElement.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" #include "nsSize.h" #include "nsIFrame.h" #include "nsIDocument.h" @@ -62,17 +59,16 @@ #include "jsapi.h" #include "nsITimer.h" #include "nsEventDispatcher.h" #include "nsIDOMProgressEvent.h" #include "nsMediaError.h" -using namespace mozilla; using namespace mozilla::dom; NS_IMPL_NS_NEW_HTML_ELEMENT(Video) NS_IMPL_ADDREF_INHERITED(nsHTMLVideoElement, nsHTMLMediaElement) NS_IMPL_RELEASE_INHERITED(nsHTMLVideoElement, nsHTMLMediaElement) DOMCI_NODE_DATA(HTMLVideoElement, nsHTMLVideoElement) @@ -149,17 +145,17 @@ nsHTMLVideoElement::IsAttributeMapped(co { nsnull } }; static const MappedAttributeEntry* const map[] = { attributes, sCommonAttributeMap }; - return FindAttributeDependence(aAttribute, map, ArrayLength(map)); + return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); } nsMapRuleToAttributesFunc nsHTMLVideoElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule; }
--- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -35,18 +35,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsContentSink.h" #include "nsCOMPtr.h" #include "nsReadableUtils.h" #include "nsUnicharUtils.h" #include "nsIHTMLContentSink.h" #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIParser.h" @@ -1476,43 +1474,43 @@ HTMLContentSink::~HTMLContentSink() if (mCurrentContext == mHeadContext) { mCurrentContext = nsnull; } delete mCurrentContext; delete mHeadContext; - for (i = 0; PRUint32(i) < ArrayLength(mNodeInfoCache); ++i) { + for (i = 0; PRUint32(i) < NS_ARRAY_LENGTH(mNodeInfoCache); ++i) { NS_IF_RELEASE(mNodeInfoCache[i]); } } NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLContentSink) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLContentSink, nsContentSink) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mHTMLDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mRoot) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mBody) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFrameset) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mHead) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCurrentForm) - for (PRUint32 i = 0; i < ArrayLength(tmp->mNodeInfoCache); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(tmp->mNodeInfoCache); ++i) { NS_IF_RELEASE(tmp->mNodeInfoCache[i]); } NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLContentSink, nsContentSink) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mHTMLDocument) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRoot) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBody) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFrameset) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mHead) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mCurrentForm) - for (PRUint32 i = 0; i < ArrayLength(tmp->mNodeInfoCache); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(tmp->mNodeInfoCache); ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mNodeInfoCache[i]"); cb.NoteXPCOMChild(tmp->mNodeInfoCache[i]); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLContentSink) NS_INTERFACE_TABLE_BEGIN NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIContentSink)
--- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -32,19 +32,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/Util.h" - #include "nsICharsetAlias.h" #include "nsCOMPtr.h" #include "nsXPIDLString.h" #include "nsPrintfCString.h" #include "nsReadableUtils.h" #include "nsUnicharUtils.h" #include "nsHTMLDocument.h" @@ -3187,25 +3184,25 @@ ConvertToMidasInternalCommandInner(const const PRUnichar *end = inParam.EndReading(); if (start != end && *start == '<' && *(end - 1) == '>') { ++start; --end; } NS_ConvertUTF16toUTF8 convertedParam(Substring(start, end)); PRUint32 j; - for (j = 0; j < ArrayLength(gBlocks); ++j) { + for (j = 0; j < NS_ARRAY_LENGTH(gBlocks); ++j) { if (convertedParam.Equals(gBlocks[j], nsCaseInsensitiveCStringComparator())) { outParam.Assign(gBlocks[j]); break; } } - return j != ArrayLength(gBlocks); + return j != NS_ARRAY_LENGTH(gBlocks); } else { CopyUTF16toUTF8(inParam, outParam); } } } } } // end else for useNewParam (do convert existing param)
--- a/content/mathml/content/src/nsMathMLElement.cpp +++ b/content/mathml/content/src/nsMathMLElement.cpp @@ -33,34 +33,30 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsMathMLElement.h" #include "nsDOMClassInfoID.h" // for eDOMClassInfo_MathElement_id. #include "nsGkAtoms.h" #include "nsCRT.h" #include "nsRuleData.h" #include "nsCSSValue.h" #include "nsMappedAttributes.h" #include "nsStyleConsts.h" #include "nsIDocument.h" #include "nsEventStates.h" #include "nsIPresShell.h" #include "nsPresContext.h" #include "mozAutoDocUpdate.h" -using namespace mozilla; - //---------------------------------------------------------------------- // nsISupports methods: DOMCI_NODE_DATA(MathMLElement, nsMathMLElement) NS_INTERFACE_TABLE_HEAD(nsMathMLElement) NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsMathMLElement) NS_INTERFACE_TABLE_ENTRY(nsMathMLElement, nsIDOMNode) @@ -176,21 +172,21 @@ nsMathMLElement::IsAttributeMapped(const }; // We don't support mglyph (yet). nsIAtom* tag = Tag(); if (tag == nsGkAtoms::ms_ || tag == nsGkAtoms::mi_ || tag == nsGkAtoms::mn_ || tag == nsGkAtoms::mo_ || tag == nsGkAtoms::mtext_ || tag == nsGkAtoms::mspace_) return FindAttributeDependence(aAttribute, tokenMap, - ArrayLength(tokenMap)); + NS_ARRAY_LENGTH(tokenMap)); if (tag == nsGkAtoms::mstyle_ || tag == nsGkAtoms::math) return FindAttributeDependence(aAttribute, mstyleMap, - ArrayLength(mstyleMap)); + NS_ARRAY_LENGTH(mstyleMap)); if (tag == nsGkAtoms::maction_ || tag == nsGkAtoms::maligngroup_ || tag == nsGkAtoms::malignmark_ || tag == nsGkAtoms::menclose_ || tag == nsGkAtoms::merror_ || tag == nsGkAtoms::mfenced_ || tag == nsGkAtoms::mfrac_ || @@ -206,17 +202,17 @@ nsMathMLElement::IsAttributeMapped(const tag == nsGkAtoms::msup_ || tag == nsGkAtoms::mtable_ || tag == nsGkAtoms::mtd_ || tag == nsGkAtoms::mtr_ || tag == nsGkAtoms::munder_ || tag == nsGkAtoms::munderover_ || tag == nsGkAtoms::none) { return FindAttributeDependence(aAttribute, commonPresMap, - ArrayLength(commonPresMap)); + NS_ARRAY_LENGTH(commonPresMap)); } return PR_FALSE; } nsMapRuleToAttributesFunc nsMathMLElement::GetAttributeMappingFunction() const { @@ -404,17 +400,17 @@ nsMathMLElement::MapMathMLAttributesInto if (!ParseNumericValue(str, *fontSize, 0) && parseSizeKeywords) { static const char sizes[3][7] = { "small", "normal", "big" }; static const PRInt32 values[NS_ARRAY_LENGTH(sizes)] = { NS_STYLE_FONT_SIZE_SMALL, NS_STYLE_FONT_SIZE_MEDIUM, NS_STYLE_FONT_SIZE_LARGE }; str.CompressWhitespace(); - for (PRUint32 i = 0; i < ArrayLength(sizes); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sizes); ++i) { if (str.EqualsASCII(sizes[i])) { fontSize->SetIntValue(values[i], eCSSUnit_Enumerated); break; } } } }
--- a/content/svg/content/src/DOMSVGPathSeg.cpp +++ b/content/svg/content/src/DOMSVGPathSeg.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "DOMSVGPathSeg.h" #include "DOMSVGPathSegList.h" #include "SVGPathSegUtils.h" #include "SVGAnimatedPathSegList.h" #include "nsSVGElement.h" #include "nsIDOMSVGPathSeg.h" #include "nsDOMError.h" @@ -169,17 +167,17 @@ DOMSVGPathSeg::IndexIsValid() } #endif //////////////////////////////////////////////////////////////////////// // Implementation of DOMSVGPathSeg sub-classes below this point #define CHECK_ARG_COUNT_IN_SYNC(segType) \ - NS_ABORT_IF_FALSE(ArrayLength(mArgs) == \ + NS_ABORT_IF_FALSE(NS_ARRAY_LENGTH(mArgs) == \ SVGPathSegUtils::ArgCountForType(PRUint32(segType)) || \ PRUint32(segType) == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH, \ "Arg count/array size out of sync") #define IMPL_SVGPATHSEG_SUBCLASS_COMMON(segName, segType) \ DOMSVGPathSeg##segName(const float *aArgs) \ : DOMSVGPathSeg() \ { \
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "SVGAnimatedPreserveAspectRatio.h" #include "nsWhitespaceTokenizer.h" #ifdef MOZ_SMIL #include "nsSMILValue.h" #include "SMILEnumType.h" #endif // MOZ_SMIL using namespace mozilla; @@ -99,17 +97,17 @@ static const char *sAlignStrings[] = { "none", "xMinYMin", "xMidYMin", "xMaxYMin", "xMinYMid", "xMidYMid", "xMaxYMid", "xMinYMax", "xMidYMax", "xMaxYMax" }; static const char *sMeetOrSliceStrings[] = { "meet", "slice" }; static PRUint16 GetAlignForString(const nsAString &aAlignString) { - for (PRUint32 i = 0 ; i < ArrayLength(sAlignStrings) ; i++) { + for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(sAlignStrings) ; i++) { if (aAlignString.EqualsASCII(sAlignStrings[i])) { return (i + nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE); } } return nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_UNKNOWN; } @@ -124,17 +122,17 @@ GetAlignString(nsAString& aAlignString, aAlignString.AssignASCII( sAlignStrings[aAlign - nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE]); } static PRUint16 GetMeetOrSliceForString(const nsAString &aMeetOrSlice) { - for (PRUint32 i = 0 ; i < ArrayLength(sMeetOrSliceStrings) ; i++) { + for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(sMeetOrSliceStrings) ; i++) { if (aMeetOrSlice.EqualsASCII(sMeetOrSliceStrings[i])) { return (i + nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET); } } return nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_UNKNOWN; }
--- a/content/svg/content/src/SVGLength.cpp +++ b/content/svg/content/src/SVGLength.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "SVGLength.h" #include "nsSVGElement.h" #include "nsSVGSVGElement.h" #include "nsString.h" #include "nsSVGUtils.h" #include "nsTextFormatter.h" #include "prdtoa.h" #include "nsMathUtils.h" @@ -268,17 +266,17 @@ GetUnitString(nsAString& unit, PRUint16 static PRUint16 GetUnitTypeForString(const char* unitStr) { if (!unitStr || *unitStr == '\0') return nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER; nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr); - for (PRUint32 i = 1 ; i < ArrayLength(unitMap) ; i++) { + for (PRUint32 i = 1 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) { if (unitMap[i] && *unitMap[i] == unitAtom) { return i; } } return nsIDOMSVGLength::SVG_LENGTHTYPE_UNKNOWN; } } // namespace mozilla
--- a/content/svg/content/src/SVGNumberList.cpp +++ b/content/svg/content/src/SVGNumberList.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "SVGNumberList.h" #include "SVGAnimatedNumberList.h" #include "nsSVGElement.h" #include "nsDOMError.h" #include "nsString.h" #include "nsSVGUtils.h" #include "string.h" #include "prdtoa.h" @@ -65,17 +63,17 @@ void SVGNumberList::GetValueAsString(nsAString& aValue) const { aValue.Truncate(); PRUnichar buf[24]; PRUint32 last = mNumbers.Length() - 1; for (PRUint32 i = 0; i < mNumbers.Length(); ++i) { // Would like to use aValue.AppendPrintf("%f", mNumbers[i]), but it's not // possible to always avoid trailing zeros. - nsTextFormatter::snprintf(buf, ArrayLength(buf), + nsTextFormatter::snprintf(buf, NS_ARRAY_LENGTH(buf), NS_LITERAL_STRING("%g").get(), double(mNumbers[i])); // We ignore OOM, since it's not useful for us to return an error. aValue.Append(buf); if (i != last) { aValue.Append(' '); } }
--- a/content/svg/content/src/SVGPointList.cpp +++ b/content/svg/content/src/SVGPointList.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "SVGPointList.h" #include "SVGAnimatedPointList.h" #include "nsSVGElement.h" #include "nsDOMError.h" #include "nsString.h" #include "nsSVGUtils.h" #include "string.h" #include "prdtoa.h" @@ -65,17 +63,17 @@ void SVGPointList::GetValueAsString(nsAString& aValue) const { aValue.Truncate(); PRUnichar buf[50]; PRUint32 last = mItems.Length() - 1; for (PRUint32 i = 0; i < mItems.Length(); ++i) { // Would like to use aValue.AppendPrintf("%f,%f", item.mX, item.mY), // but it's not possible to always avoid trailing zeros. - nsTextFormatter::snprintf(buf, ArrayLength(buf), + nsTextFormatter::snprintf(buf, NS_ARRAY_LENGTH(buf), NS_LITERAL_STRING("%g,%g").get(), double(mItems[i].mX), double(mItems[i].mY)); // We ignore OOM, since it's not useful for us to return an error. aValue.Append(buf); if (i != last) { aValue.Append(' '); } }
--- a/content/svg/content/src/SVGTransformListParser.cpp +++ b/content/svg/content/src/SVGTransformListParser.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "SVGTransformListParser.h" #include "SVGTransform.h" #include "prdtoa.h" #include "nsDOMError.h" #include "nsGkAtoms.h" #include "nsReadableUtils.h" #include "nsCRT.h" #include "nsContentUtils.h" @@ -232,17 +230,17 @@ SVGTransformListParser::MatchNumberArgum nsresult SVGTransformListParser::MatchTranslate() { GetNextToken(); float t[2]; PRUint32 count; - ENSURE_MATCHED(MatchNumberArguments(t, ArrayLength(t), &count)); + ENSURE_MATCHED(MatchNumberArguments(t, NS_ARRAY_LENGTH(t), &count)); switch (count) { case 1: t[1] = 0.f; // fall-through case 2: { SVGTransform* transform = mTransforms.AppendElement(); @@ -261,17 +259,17 @@ SVGTransformListParser::MatchTranslate() nsresult SVGTransformListParser::MatchScale() { GetNextToken(); float s[2]; PRUint32 count; - ENSURE_MATCHED(MatchNumberArguments(s, ArrayLength(s), &count)); + ENSURE_MATCHED(MatchNumberArguments(s, NS_ARRAY_LENGTH(s), &count)); switch (count) { case 1: s[1] = s[0]; // fall-through case 2: { SVGTransform* transform = mTransforms.AppendElement(); @@ -290,17 +288,17 @@ SVGTransformListParser::MatchScale() nsresult SVGTransformListParser::MatchRotate() { GetNextToken(); float r[3]; PRUint32 count; - ENSURE_MATCHED(MatchNumberArguments(r, ArrayLength(r), &count)); + ENSURE_MATCHED(MatchNumberArguments(r, NS_ARRAY_LENGTH(r), &count)); switch (count) { case 1: r[1] = r[2] = 0.f; // fall-through case 3: { SVGTransform* transform = mTransforms.AppendElement(); @@ -363,17 +361,17 @@ SVGTransformListParser::MatchSkewY() nsresult SVGTransformListParser::MatchMatrix() { GetNextToken(); float m[6]; PRUint32 count; - ENSURE_MATCHED(MatchNumberArguments(m, ArrayLength(m), &count)); + ENSURE_MATCHED(MatchNumberArguments(m, NS_ARRAY_LENGTH(m), &count)); if (count != 6) { return NS_ERROR_FAILURE; } SVGTransform* transform = mTransforms.AppendElement(); NS_ENSURE_TRUE(transform, NS_ERROR_OUT_OF_MEMORY); transform->SetMatrix(gfxMatrix(m[0], m[1], m[2], m[3], m[4], m[5]));
--- a/content/svg/content/src/nsSVGAElement.cpp +++ b/content/svg/content/src/nsSVGAElement.cpp @@ -30,30 +30,26 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGAElement.h" #include "nsSVGGraphicElement.h" #include "nsIDOMSVGAElement.h" #include "nsIDOMSVGURIReference.h" #include "nsILink.h" #include "nsSVGString.h" #include "nsCOMPtr.h" #include "nsGkAtoms.h" #include "nsContentUtils.h" -using namespace mozilla; - nsSVGElement::StringInfo nsSVGAElement::sStringInfo[2] = { { &nsGkAtoms::href, kNameSpaceID_XLink, PR_TRUE }, { &nsGkAtoms::target, kNameSpaceID_None, PR_TRUE } }; NS_IMPL_NS_NEW_SVG_ELEMENT(A) @@ -188,17 +184,17 @@ nsSVGAElement::IsAttributeMapped(const n sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGAElementBase::IsAttributeMapped(name); } bool nsSVGAElement::IsFocusable(PRInt32 *aTabIndex, bool aWithMouse) { nsCOMPtr<nsIURI> uri; if (IsLink(getter_AddRefs(uri))) { @@ -334,10 +330,10 @@ nsSVGAElement::UnsetAttr(PRInt32 aNameSp //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGAElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); }
--- a/content/svg/content/src/nsSVGAltGlyphElement.cpp +++ b/content/svg/content/src/nsSVGAltGlyphElement.cpp @@ -27,27 +27,23 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsIDOMSVGAltGlyphElement.h" #include "nsIDOMSVGURIReference.h" #include "nsSVGString.h" #include "nsSVGTextPositioningElement.h" #include "nsContentUtils.h" -using namespace mozilla; - typedef nsSVGTextPositioningElement nsSVGAltGlyphElementBase; class nsSVGAltGlyphElement : public nsSVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement public nsIDOMSVGAltGlyphElement, public nsIDOMSVGURIReference { protected: friend nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult, @@ -172,27 +168,27 @@ nsSVGAltGlyphElement::IsAttributeMapped( static const MappedAttributeEntry* const map[] = { sColorMap, sFillStrokeMap, sFontSpecificationMap, sGraphicsMap, sTextContentElementsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGAltGlyphElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement overrides bool nsSVGAltGlyphElement::IsEventName(nsIAtom* aName) { return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic); } nsSVGElement::StringAttributesInfo nsSVGAltGlyphElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); }
--- a/content/svg/content/src/nsSVGAngle.cpp +++ b/content/svg/content/src/nsSVGAngle.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGAngle.h" #include "prdtoa.h" #include "nsTextFormatter.h" #include "nsSVGUtils.h" #include "nsSVGMarkerElement.h" #include "nsMathUtils.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE #ifdef MOZ_SMIL @@ -188,17 +186,17 @@ GetUnitString(nsAString& unit, PRUint16 static PRUint16 GetUnitTypeForString(const char* unitStr) { if (!unitStr || *unitStr == '\0') return nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED; nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr); - for (PRUint32 i = 0 ; i < ArrayLength(unitMap) ; i++) { + for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) { if (unitMap[i] && *unitMap[i] == unitAtom) { return i; } } return nsIDOMSVGAngle::SVG_ANGLETYPE_UNKNOWN; }
--- a/content/svg/content/src/nsSVGCircleElement.cpp +++ b/content/svg/content/src/nsSVGCircleElement.cpp @@ -31,27 +31,23 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGPathGeometryElement.h" #include "nsIDOMSVGCircleElement.h" #include "nsSVGLength2.h" #include "nsGkAtoms.h" #include "nsSVGUtils.h" #include "gfxContext.h" -using namespace mozilla; - typedef nsSVGPathGeometryElement nsSVGCircleElementBase; class nsSVGCircleElement : public nsSVGCircleElementBase, public nsIDOMSVGCircleElement { protected: friend nsresult NS_NewSVGCircleElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -141,17 +137,17 @@ NS_IMETHODIMP nsSVGCircleElement::GetR(n //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGCircleElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods void nsSVGCircleElement::ConstructPath(gfxContext *aCtx) {
--- a/content/svg/content/src/nsSVGClipPathElement.cpp +++ b/content/svg/content/src/nsSVGClipPathElement.cpp @@ -29,23 +29,19 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGClipPathElement.h" #include "nsGkAtoms.h" -using namespace mozilla; - nsSVGElement::EnumInfo nsSVGClipPathElement::sEnumInfo[1] = { { &nsGkAtoms::clipPathUnits, sSVGUnitTypesMap, nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE } }; @@ -79,16 +75,16 @@ NS_IMETHODIMP nsSVGClipPathElement::GetC { return mEnumAttributes[CLIPPATHUNITS].ToDOMAnimatedEnum(aClipPathUnits, this); } nsSVGElement::EnumAttributesInfo nsSVGClipPathElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } //---------------------------------------------------------------------- // nsIDOMNode methods NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGClipPathElement)
--- a/content/svg/content/src/nsSVGDefsElement.cpp +++ b/content/svg/content/src/nsSVGDefsElement.cpp @@ -31,23 +31,19 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGGraphicElement.h" #include "nsIDOMSVGDefsElement.h" -using namespace mozilla; - typedef nsSVGGraphicElement nsSVGDefsElementBase; class nsSVGDefsElement : public nsSVGDefsElementBase, public nsIDOMSVGDefsElement { protected: friend nsresult NS_NewSVGDefsElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -121,11 +117,11 @@ nsSVGDefsElement::IsAttributeMapped(cons sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGDefsElementBase::IsAttributeMapped(name); }
--- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGElement.h" #include "nsSVGSVGElement.h" #include "nsSVGSwitchElement.h" #include "nsIDocument.h" #include "nsRange.h" #include "nsIDOMAttr.h" #include "nsIDOMEventTarget.h" #include "nsIDOMMutationEvent.h" @@ -2143,17 +2141,17 @@ nsSVGElement::ReportAttributeParseFailur nsIAtom* aAttribute, const nsAString& aValue) { const nsAFlatString& attributeValue = PromiseFlatString(aValue); const PRUnichar *strings[] = { aAttribute->GetUTF16String(), attributeValue.get() }; return nsSVGUtils::ReportToConsole(aDocument, "AttributeParseWarning", - strings, ArrayLength(strings)); + strings, NS_ARRAY_LENGTH(strings)); } void nsSVGElement::RecompileScriptEventListeners() { PRInt32 i, count = mAttrsAndChildren.AttrCount(); for (i = 0; i < count; ++i) { const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
--- a/content/svg/content/src/nsSVGEllipseElement.cpp +++ b/content/svg/content/src/nsSVGEllipseElement.cpp @@ -32,27 +32,23 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGPathGeometryElement.h" #include "nsIDOMSVGEllipseElement.h" #include "nsSVGLength2.h" #include "nsGkAtoms.h" #include "nsSVGUtils.h" #include "gfxContext.h" -using namespace mozilla; - typedef nsSVGPathGeometryElement nsSVGEllipseElementBase; class nsSVGEllipseElement : public nsSVGEllipseElementBase, public nsIDOMSVGEllipseElement { protected: friend nsresult NS_NewSVGEllipseElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -149,17 +145,17 @@ NS_IMETHODIMP nsSVGEllipseElement::GetRy //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGEllipseElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods void nsSVGEllipseElement::ConstructPath(gfxContext *aCtx) {
--- a/content/svg/content/src/nsSVGFilterElement.cpp +++ b/content/svg/content/src/nsSVGFilterElement.cpp @@ -29,25 +29,21 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsCOMPtr.h" #include "nsSVGFilterElement.h" #include "nsSVGEffects.h" -using namespace mozilla; - nsSVGElement::LengthInfo nsSVGFilterElement::sLengthInfo[4] = { { &nsGkAtoms::x, -10, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::y, -10, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, { &nsGkAtoms::width, 120, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::height, 120, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, }; @@ -190,17 +186,17 @@ nsSVGFilterElement::IsAttributeMapped(co sFiltersMap, sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGGraphicElementBase::IsAttributeMapped(name); } void nsSVGFilterElement::Invalidate() { nsTObserverArray<nsIMutationObserver*> *observers = GetMutationObservers(); @@ -217,31 +213,31 @@ nsSVGFilterElement::Invalidate() //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGFilterElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::IntegerPairAttributesInfo nsSVGFilterElement::GetIntegerPairInfo() { return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo, - ArrayLength(sIntegerPairInfo)); + NS_ARRAY_LENGTH(sIntegerPairInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFilterElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFilterElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); }
--- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGElement.h" #include "nsGkAtoms.h" #include "nsSVGNumber2.h" #include "nsSVGNumberPair.h" #include "nsSVGInteger.h" #include "nsSVGIntegerPair.h" #include "nsSVGBoolean.h" #include "nsIDOMSVGFilters.h" @@ -290,28 +288,28 @@ NS_IMETHODIMP nsSVGFE::GetResult(nsIDOMS NS_IMETHODIMP_(bool) nsSVGFE::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sFiltersMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGFEBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGFE::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } inline static void DidAnimateAttr(Element *aFilterPrimitive) { // nsSVGLeafFrame doesn't implement AttributeChanged. nsIFrame* frame = aFilterPrimitive->GetPrimaryFrame(); if (frame) { nsSVGEffects::InvalidateRenderingObservers(frame); @@ -843,24 +841,24 @@ nsSVGFEGaussianBlurElement::ComputeChang //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberPairAttributesInfo nsSVGFEGaussianBlurElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, - ArrayLength(sNumberPairInfo)); + NS_ARRAY_LENGTH(sNumberPairInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEGaussianBlurElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Blend------------------------ typedef nsSVGFE nsSVGFEBlendElementBase; class nsSVGFEBlendElement : public nsSVGFEBlendElementBase, public nsIDOMSVGFEBlendElement @@ -1045,24 +1043,24 @@ nsSVGFEBlendElement::GetSourceImageNames //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::EnumAttributesInfo nsSVGFEBlendElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEBlendElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Color Matrix------------------------ typedef nsSVGFE nsSVGFEColorMatrixElementBase; class nsSVGFEColorMatrixElement : public nsSVGFEColorMatrixElementBase, public nsIDOMSVGFEColorMatrixElement @@ -1341,31 +1339,31 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::EnumAttributesInfo nsSVGFEColorMatrixElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEColorMatrixElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } nsSVGElement::NumberListAttributesInfo nsSVGFEColorMatrixElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, - ArrayLength(sNumberListInfo)); + NS_ARRAY_LENGTH(sNumberListInfo)); } //---------------------Composite------------------------ typedef nsSVGFE nsSVGFECompositeElementBase; class nsSVGFECompositeElement : public nsSVGFECompositeElementBase, public nsIDOMSVGFECompositeElement @@ -1635,31 +1633,31 @@ nsSVGFECompositeElement::ComputeTargetBB //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFECompositeElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFECompositeElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFECompositeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Component Transfer------------------------ typedef nsSVGFE nsSVGFEComponentTransferElementBase; class nsSVGFEComponentTransferElement : public nsSVGFEComponentTransferElementBase, public nsIDOMSVGFEComponentTransferElement @@ -1747,17 +1745,17 @@ nsSVGFEComponentTransferElement::GetIn1( //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGFEComponentTransferElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //-------------------------------------------- #define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \ { 0xafab106d, 0xbc18, 0x4f7f, \ { 0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 } } @@ -2039,31 +2037,31 @@ nsSVGComponentTransferFunctionElement::G //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberListAttributesInfo nsSVGComponentTransferFunctionElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, - ArrayLength(sNumberListInfo)); + NS_ARRAY_LENGTH(sNumberListInfo)); } nsSVGElement::EnumAttributesInfo nsSVGComponentTransferFunctionElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::NumberAttributesInfo nsSVGComponentTransferFunctionElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } class nsSVGFEFuncRElement : public nsSVGComponentTransferFunctionElement, public nsIDOMSVGFEFuncRElement { friend nsresult NS_NewSVGFEFuncRElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); protected: @@ -2390,17 +2388,17 @@ nsSVGFEMergeElement::GetSourceImageNames //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGFEMergeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Merge Node------------------------ NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFEMergeNodeElement, NS_SVG_FE_MERGE_NODE_CID) nsSVGElement::StringInfo nsSVGFEMergeNodeElement::sStringInfo[1] = { @@ -2444,17 +2442,17 @@ NS_IMETHODIMP nsSVGFEMergeNodeElement::G //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGFEMergeNodeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Offset------------------------ typedef nsSVGFE nsSVGFEOffsetElementBase; class nsSVGFEOffsetElement : public nsSVGFEOffsetElementBase, public nsIDOMSVGFEOffsetElement @@ -2626,24 +2624,24 @@ nsSVGFEOffsetElement::ComputeNeededSourc //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFEOffsetElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEOffsetElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Flood------------------------ typedef nsSVGFE nsSVGFEFloodElementBase; class nsSVGFEFloodElement : public nsSVGFEFloodElementBase, public nsIDOMSVGFEFloodElement @@ -2763,28 +2761,28 @@ nsSVGFEFloodElement::ComputeTargetBBox(c NS_IMETHODIMP_(bool) nsSVGFEFloodElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sFEFloodMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGFEFloodElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGFEFloodElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Tile------------------------ typedef nsSVGFE nsSVGFETileElementBase; class nsSVGFETileElement : public nsSVGFETileElementBase, public nsIDOMSVGFETileElement @@ -2965,17 +2963,17 @@ nsSVGFETileElement::Filter(nsSVGFilterIn //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGFETileElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Turbulence------------------------ typedef nsSVGFE nsSVGFETurbulenceElementBase; class nsSVGFETurbulenceElement : public nsSVGFETurbulenceElementBase, public nsIDOMSVGFETurbulenceElement @@ -3466,45 +3464,45 @@ nsSVGFETurbulenceElement::ComputeTargetB //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFETurbulenceElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::NumberPairAttributesInfo nsSVGFETurbulenceElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, - ArrayLength(sNumberPairInfo)); + NS_ARRAY_LENGTH(sNumberPairInfo)); } nsSVGElement::IntegerAttributesInfo nsSVGFETurbulenceElement::GetIntegerInfo() { return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo, - ArrayLength(sIntegerInfo)); + NS_ARRAY_LENGTH(sIntegerInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFETurbulenceElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFETurbulenceElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Morphology------------------------ typedef nsSVGFE nsSVGFEMorphologyElementBase; class nsSVGFEMorphologyElement : public nsSVGFEMorphologyElementBase, public nsIDOMSVGFEMorphologyElement @@ -3801,31 +3799,31 @@ nsSVGFEMorphologyElement::Filter(nsSVGFi //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberPairAttributesInfo nsSVGFEMorphologyElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, - ArrayLength(sNumberPairInfo)); + NS_ARRAY_LENGTH(sNumberPairInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFEMorphologyElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEMorphologyElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------Convolve Matrix------------------------ typedef nsSVGFE nsSVGFEConvolveMatrixElementBase; class nsSVGFEConvolveMatrixElement : public nsSVGFEConvolveMatrixElementBase, public nsIDOMSVGFEConvolveMatrixElement @@ -4259,66 +4257,66 @@ nsSVGFEConvolveMatrixElement::Filter(nsS //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFEConvolveMatrixElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::NumberPairAttributesInfo nsSVGFEConvolveMatrixElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, - ArrayLength(sNumberPairInfo)); + NS_ARRAY_LENGTH(sNumberPairInfo)); } nsSVGElement::IntegerAttributesInfo nsSVGFEConvolveMatrixElement::GetIntegerInfo() { return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo, - ArrayLength(sIntegerInfo)); + NS_ARRAY_LENGTH(sIntegerInfo)); } nsSVGElement::IntegerPairAttributesInfo nsSVGFEConvolveMatrixElement::GetIntegerPairInfo() { return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo, - ArrayLength(sIntegerPairInfo)); + NS_ARRAY_LENGTH(sIntegerPairInfo)); } nsSVGElement::BooleanAttributesInfo nsSVGFEConvolveMatrixElement::GetBooleanInfo() { return BooleanAttributesInfo(mBooleanAttributes, sBooleanInfo, - ArrayLength(sBooleanInfo)); + NS_ARRAY_LENGTH(sBooleanInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFEConvolveMatrixElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEConvolveMatrixElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } nsSVGElement::NumberListAttributesInfo nsSVGFEConvolveMatrixElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, - ArrayLength(sNumberListInfo)); + NS_ARRAY_LENGTH(sNumberListInfo)); } //---------------------DistantLight------------------------ typedef nsSVGElement nsSVGFEDistantLightElementBase; class nsSVGFEDistantLightElement : public nsSVGFEDistantLightElementBase, public nsIDOMSVGFEDistantLightElement @@ -4399,17 +4397,17 @@ nsSVGFEDistantLightElement::GetElevation //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFEDistantLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } //---------------------PointLight------------------------ typedef nsSVGElement nsSVGFEPointLightElementBase; class nsSVGFEPointLightElement : public nsSVGFEPointLightElementBase, public nsIDOMSVGFEPointLightElement @@ -4495,17 +4493,17 @@ nsSVGFEPointLightElement::GetZ(nsIDOMSVG //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFEPointLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } //---------------------SpotLight------------------------ typedef nsSVGElement nsSVGFESpotLightElementBase; class nsSVGFESpotLightElement : public nsSVGFESpotLightElementBase, public nsIDOMSVGFESpotLightElement @@ -4630,17 +4628,17 @@ nsSVGFESpotLightElement::GetLimitingCone //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFESpotLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } //------------------------------------------------------------ typedef nsSVGFE nsSVGFELightingElementBase; class nsSVGFELightingElement : public nsSVGFELightingElementBase { @@ -4729,17 +4727,17 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGFEL NS_IMETHODIMP_(bool) nsSVGFELightingElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sLightingEffectsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGFELightingElementBase::IsAttributeMapped(name); } void nsSVGFELightingElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) { aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this)); } @@ -4988,31 +4986,31 @@ nsSVGFELightingElement::Filter(nsSVGFilt //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFELightingElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::NumberPairAttributesInfo nsSVGFELightingElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, - ArrayLength(sNumberPairInfo)); + NS_ARRAY_LENGTH(sNumberPairInfo)); } nsSVGElement::StringAttributesInfo nsSVGFELightingElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------DiffuseLighting------------------------ typedef nsSVGFELightingElement nsSVGFEDiffuseLightingElementBase; class nsSVGFEDiffuseLightingElement : public nsSVGFEDiffuseLightingElementBase, public nsIDOMSVGFEDiffuseLightingElement @@ -5457,17 +5455,17 @@ nsSVGFEImageElement::LoadSVGImage(bool a NS_IMETHODIMP_(bool) nsSVGFEImageElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sGraphicsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGFEImageElementBase::IsAttributeMapped(name); } nsresult nsSVGFEImageElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName, const nsAString* aValue, bool aNotify) { if (aNamespaceID == kNameSpaceID_XLink && aName == nsGkAtoms::href) { @@ -5612,17 +5610,17 @@ nsSVGFEImageElement::GetPreserveAspectRa { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGFEImageElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } void nsSVGFEImageElement::DidAnimateString(PRUint8 aAttrEnum) { if (aAttrEnum == HREF) { LoadSVGImage(PR_TRUE, PR_FALSE); return; @@ -5947,24 +5945,24 @@ nsSVGFEDisplacementMapElement::ComputeCh //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo nsSVGFEDisplacementMapElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, - ArrayLength(sNumberInfo)); + NS_ARRAY_LENGTH(sNumberInfo)); } nsSVGElement::EnumAttributesInfo nsSVGFEDisplacementMapElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGFEDisplacementMapElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); -} + NS_ARRAY_LENGTH(sStringInfo)); +}
--- a/content/svg/content/src/nsSVGForeignObjectElement.cpp +++ b/content/svg/content/src/nsSVGForeignObjectElement.cpp @@ -31,23 +31,19 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsSVGForeignObjectElement.h" -using namespace mozilla; - nsSVGElement::LengthInfo nsSVGForeignObjectElement::sLengthInfo[4] = { { &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, { &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, }; @@ -135,21 +131,21 @@ nsSVGForeignObjectElement::IsAttributeMa sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGForeignObjectElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGForeignObjectElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); }
--- a/content/svg/content/src/nsSVGGElement.cpp +++ b/content/svg/content/src/nsSVGGElement.cpp @@ -31,23 +31,19 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGGraphicElement.h" #include "nsIDOMSVGGElement.h" -using namespace mozilla; - typedef nsSVGGraphicElement nsSVGGElementBase; class nsSVGGElement : public nsSVGGElementBase, public nsIDOMSVGGElement { protected: friend nsresult NS_NewSVGGElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -122,11 +118,11 @@ nsSVGGElement::IsAttributeMapped(const n sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGGElementBase::IsAttributeMapped(name); }
--- a/content/svg/content/src/nsSVGGradientElement.cpp +++ b/content/svg/content/src/nsSVGGradientElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "DOMSVGAnimatedTransformList.h" #include "nsIDOMSVGAnimatedEnum.h" #include "nsIDOMSVGURIReference.h" #include "nsIDOMSVGGradientElement.h" #include "nsIDOMMutationEvent.h" #include "nsCOMPtr.h" #include "nsSVGStylableElement.h" #include "nsGkAtoms.h" @@ -98,24 +96,24 @@ nsSVGGradientElement::nsSVGGradientEleme //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::EnumAttributesInfo nsSVGGradientElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGGradientElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------------------------------------------------------- // nsIDOMSVGGradientElement methods /* readonly attribute nsIDOMSVGAnimatedEnumeration gradientUnits; */ NS_IMETHODIMP nsSVGGradientElement::GetGradientUnits(nsIDOMSVGAnimatedEnumeration * *aGradientUnits) { @@ -153,17 +151,17 @@ nsSVGGradientElement::GetHref(nsIDOMSVGA NS_IMETHODIMP_(bool) nsSVGGradientElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sColorMap, sGradientStopMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGGradientElementBase::IsAttributeMapped(name); } //---------------------Linear Gradients------------------------ nsSVGElement::LengthInfo nsSVGLinearGradientElement::sLengthInfo[4] = { { &nsGkAtoms::x1, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, @@ -242,17 +240,17 @@ nsSVGGradientElement::GetAnimatedTransfo } return mGradientTransform; } nsSVGElement::LengthAttributesInfo nsSVGLinearGradientElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } //-------------------------- Radial Gradients ---------------------------- nsSVGElement::LengthInfo nsSVGRadialGradientElement::sLengthInfo[5] = { { &nsGkAtoms::cx, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::cy, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, @@ -327,10 +325,10 @@ NS_IMETHODIMP nsSVGRadialGradientElement //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGRadialGradientElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); }
--- a/content/svg/content/src/nsSVGGraphicElement.cpp +++ b/content/svg/content/src/nsSVGGraphicElement.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGGraphicElement.h" #include "nsSVGSVGElement.h" #include "DOMSVGAnimatedTransformList.h" #include "DOMSVGMatrix.h" #include "nsGkAtoms.h" #include "nsIDOMEventTarget.h" #include "nsIFrame.h" #include "nsISVGChildFrame.h" @@ -170,17 +168,17 @@ NS_IMETHODIMP_(bool) nsSVGGraphicElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sColorMap, sFillStrokeMap, sGraphicsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGGraphicElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement overrides bool nsSVGGraphicElement::IsEventName(nsIAtom* aName)
--- a/content/svg/content/src/nsSVGImageElement.cpp +++ b/content/svg/content/src/nsSVGImageElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGImageElement.h" #include "nsCOMPtr.h" #include "nsIURI.h" #include "nsNetUtil.h" #include "imgIContainer.h" #include "imgIDecoderObserver.h" #include "gfxContext.h" #include "mozilla/Preferences.h" @@ -231,17 +229,17 @@ nsSVGImageElement::IntrinsicState() cons NS_IMETHODIMP_(bool) nsSVGImageElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sViewportsMap, }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGImageElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods /* For the purposes of the update/invalidation logic pretend to be a rectangle. */ @@ -260,30 +258,30 @@ nsSVGImageElement::ConstructPath(gfxCont //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGImageElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } SVGAnimatedPreserveAspectRatio * nsSVGImageElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGImageElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } void nsSVGImageElement::DidAnimateString(PRUint8 aAttrEnum) { if (aAttrEnum == HREF) { LoadSVGImage(PR_TRUE, PR_FALSE); return;
--- a/content/svg/content/src/nsSVGLength2.cpp +++ b/content/svg/content/src/nsSVGLength2.cpp @@ -31,33 +31,29 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGLength2.h" #include "prdtoa.h" #include "nsTextFormatter.h" #include "nsSVGSVGElement.h" #include "nsIFrame.h" #include "nsSVGIntegrationUtils.h" #include "nsSVGAttrTearoffTable.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE #ifdef MOZ_SMIL #include "nsSMILValue.h" #include "nsSMILFloatType.h" #endif // MOZ_SMIL -using namespace mozilla; - NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal, mSVGElement) NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal, mSVGElement) NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength, mSVGElement) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMBaseVal) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMBaseVal) @@ -139,17 +135,17 @@ GetUnitString(nsAString& unit, PRUint16 static PRUint16 GetUnitTypeForString(const char* unitStr) { if (!unitStr || *unitStr == '\0') return nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER; nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr); - for (PRUint32 i = 0 ; i < ArrayLength(unitMap) ; i++) { + for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) { if (unitMap[i] && *unitMap[i] == unitAtom) { return i; } } return nsIDOMSVGLength::SVG_LENGTHTYPE_UNKNOWN; }
--- a/content/svg/content/src/nsSVGLineElement.cpp +++ b/content/svg/content/src/nsSVGLineElement.cpp @@ -32,26 +32,22 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGPathGeometryElement.h" #include "nsIDOMSVGLineElement.h" #include "nsSVGLength2.h" #include "nsGkAtoms.h" #include "gfxContext.h" -using namespace mozilla; - typedef nsSVGPathGeometryElement nsSVGLineElementBase; class nsSVGLineElement : public nsSVGLineElementBase, public nsIDOMSVGLineElement { protected: friend nsresult NS_NewSVGLineElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -156,28 +152,28 @@ NS_IMETHODIMP nsSVGLineElement::GetY2(ns NS_IMETHODIMP_(bool) nsSVGLineElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sMarkersMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGLineElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGLineElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods void nsSVGLineElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks) { float x1, y1, x2, y2;
--- a/content/svg/content/src/nsSVGMarkerElement.cpp +++ b/content/svg/content/src/nsSVGMarkerElement.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsCOMPtr.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "nsDOMError.h" #include "nsSVGUtils.h" #include "nsSVGMarkerElement.h" #include "gfxMatrix.h" #include "nsContentUtils.h" // NS_ENSURE_FINITE @@ -241,17 +239,17 @@ nsSVGMarkerElement::IsAttributeMapped(co sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGMarkerElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods bool nsSVGMarkerElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, @@ -305,31 +303,31 @@ nsSVGMarkerElement::SetParentCoordCtxPro mCoordCtx = aContext; mViewBoxToViewportTransform = nsnull; } nsSVGElement::LengthAttributesInfo nsSVGMarkerElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::AngleAttributesInfo nsSVGMarkerElement::GetAngleInfo() { return AngleAttributesInfo(mAngleAttributes, sAngleInfo, - ArrayLength(sAngleInfo)); + NS_ARRAY_LENGTH(sAngleInfo)); } nsSVGElement::EnumAttributesInfo nsSVGMarkerElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGViewBox * nsSVGMarkerElement::GetViewBox() { return &mViewBox; }
--- a/content/svg/content/src/nsSVGMaskElement.cpp +++ b/content/svg/content/src/nsSVGMaskElement.cpp @@ -29,24 +29,20 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsGkAtoms.h" #include "nsSVGMaskElement.h" -using namespace mozilla; - //--------------------- Masks ------------------------ nsSVGElement::LengthInfo nsSVGMaskElement::sLengthInfo[4] = { { &nsGkAtoms::x, -10, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::y, -10, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, { &nsGkAtoms::width, 120, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::height, 120, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, @@ -135,24 +131,24 @@ NS_IMETHODIMP nsSVGMaskElement::GetHeigh //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGMaskElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::EnumAttributesInfo nsSVGMaskElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } //---------------------------------------------------------------------- // nsIContent methods NS_IMETHODIMP_(bool) nsSVGMaskElement::IsAttributeMapped(const nsIAtom* name) const { @@ -162,11 +158,11 @@ nsSVGMaskElement::IsAttributeMapped(cons sFontSpecificationMap, sGradientStopMap, sGraphicsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGMaskElementBase::IsAttributeMapped(name); }
--- a/content/svg/content/src/nsSVGMpathElement.cpp +++ b/content/svg/content/src/nsSVGMpathElement.cpp @@ -30,25 +30,22 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGMpathElement.h" #include "nsAutoPtr.h" #include "nsDebug.h" #include "nsSVGPathElement.h" #include "nsSVGAnimateMotionElement.h" -using namespace mozilla; using namespace mozilla::dom; nsSVGElement::StringInfo nsSVGMpathElement::sStringInfo[1] = { { &nsGkAtoms::href, kNameSpaceID_XLink, PR_FALSE } }; NS_IMPL_NS_NEW_SVG_ELEMENT(Mpath) @@ -189,17 +186,17 @@ nsSVGMpathElement::UnsetAttr(PRInt32 aNa //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::StringAttributesInfo nsSVGMpathElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------------------------------------------------------- // nsIMutationObserver methods void nsSVGMpathElement::AttributeChanged(nsIDocument* aDocument, Element* aElement,
--- a/content/svg/content/src/nsSVGPathElement.cpp +++ b/content/svg/content/src/nsSVGPathElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsIDOMSVGPathSeg.h" #include "DOMSVGPathSeg.h" #include "DOMSVGPathSegList.h" #include "nsCOMPtr.h" #include "nsIFrame.h" #include "nsSVGPathDataParser.h" #include "nsSVGPathElement.h" @@ -383,17 +381,17 @@ NS_IMETHODIMP nsSVGPathElement::GetAnima NS_IMETHODIMP_(bool) nsSVGPathElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sMarkersMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGPathElementBase::IsAttributeMapped(name); } already_AddRefed<gfxFlattenedPath> nsSVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix) { return mD.GetAnimValue().ToFlattenedPath(aMatrix); }
--- a/content/svg/content/src/nsSVGPatternElement.cpp +++ b/content/svg/content/src/nsSVGPatternElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "DOMSVGAnimatedTransformList.h" #include "nsIDOMMutationEvent.h" #include "nsCOMPtr.h" #include "nsGkAtoms.h" #include "nsSVGPatternElement.h" #include "nsIFrame.h" using namespace mozilla; @@ -193,17 +191,17 @@ nsSVGPatternElement::IsAttributeMapped(c sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGPatternElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods SVGAnimatedTransformList* nsSVGPatternElement::GetAnimatedTransformList() @@ -213,24 +211,24 @@ nsSVGPatternElement::GetAnimatedTransfor } return mPatternTransform; } nsSVGElement::LengthAttributesInfo nsSVGPatternElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::EnumAttributesInfo nsSVGPatternElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGViewBox * nsSVGPatternElement::GetViewBox() { return &mViewBox; } @@ -239,11 +237,11 @@ nsSVGPatternElement::GetPreserveAspectRa { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGPatternElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); }
--- a/content/svg/content/src/nsSVGPolyElement.cpp +++ b/content/svg/content/src/nsSVGPolyElement.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGPolyElement.h" #include "DOMSVGPointList.h" #include "gfxContext.h" #include "nsSVGUtils.h" using namespace mozilla; //---------------------------------------------------------------------- @@ -88,17 +86,17 @@ nsSVGPolyElement::GetAnimatedPoints(nsID NS_IMETHODIMP_(bool) nsSVGPolyElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sMarkersMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGPolyElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods bool nsSVGPolyElement::AttributeDefinesGeometry(const nsIAtom *aName)
--- a/content/svg/content/src/nsSVGRectElement.cpp +++ b/content/svg/content/src/nsSVGRectElement.cpp @@ -32,26 +32,22 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGPathGeometryElement.h" #include "nsIDOMSVGRectElement.h" #include "nsSVGLength2.h" #include "nsGkAtoms.h" #include "gfxContext.h" -using namespace mozilla; - typedef nsSVGPathGeometryElement nsSVGRectElementBase; class nsSVGRectElement : public nsSVGRectElementBase, public nsIDOMSVGRectElement { protected: friend nsresult NS_NewSVGRectElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -162,17 +158,17 @@ NS_IMETHODIMP nsSVGRectElement::GetRy(ns //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo nsSVGRectElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods void nsSVGRectElement::ConstructPath(gfxContext *aCtx) {
--- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -33,18 +33,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "DOMSVGNumber.h" #include "DOMSVGLength.h" #include "nsSVGAngle.h" #include "nsCOMPtr.h" #include "nsIPresShell.h" #include "nsContentUtils.h" #include "nsIDocument.h" @@ -903,17 +901,17 @@ nsSVGSVGElement::IsAttributeMapped(const sGradientStopMap, sGraphicsMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGSVGElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsIContent methods: #ifdef MOZ_SMIL nsresult @@ -1200,24 +1198,24 @@ nsSVGSVGElement::PrependLocalTransformTo // outer-<svg>, but inline in some other content: return GetViewBoxTransform() * aMatrix; } nsSVGElement::LengthAttributesInfo nsSVGSVGElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::EnumAttributesInfo nsSVGSVGElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGViewBox * nsSVGSVGElement::GetViewBox() { return &mViewBox; }
--- a/content/svg/content/src/nsSVGScriptElement.cpp +++ b/content/svg/content/src/nsSVGScriptElement.cpp @@ -32,31 +32,28 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGElement.h" #include "nsGkAtoms.h" #include "nsIDOMSVGScriptElement.h" #include "nsIDOMSVGURIReference.h" #include "nsCOMPtr.h" #include "nsSVGString.h" #include "nsIDocument.h" #include "nsIURI.h" #include "nsNetUtil.h" #include "nsScriptElement.h" #include "nsContentUtils.h" -using namespace mozilla; using namespace mozilla::dom; typedef nsSVGElement nsSVGScriptElementBase; class nsSVGScriptElement : public nsSVGScriptElementBase, public nsIDOMSVGScriptElement, public nsIDOMSVGURIReference, public nsScriptElement @@ -266,17 +263,17 @@ nsSVGScriptElement::DidChangeString(PRUi MaybeProcessScript(); } } nsSVGElement::StringAttributesInfo nsSVGScriptElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------------------------------------------------------- // nsIContent methods nsresult nsSVGScriptElement::DoneAddingChildren(bool aHaveNotified) {
--- a/content/svg/content/src/nsSVGStopElement.cpp +++ b/content/svg/content/src/nsSVGStopElement.cpp @@ -31,26 +31,22 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGStylableElement.h" #include "nsIDOMSVGStopElement.h" #include "nsSVGNumber2.h" #include "nsSVGUtils.h" #include "nsGenericHTMLElement.h" -using namespace mozilla; - typedef nsSVGStylableElement nsSVGStopElementBase; class nsSVGStopElement : public nsSVGStopElementBase, public nsIDOMSVGStopElement { protected: friend nsresult NS_NewSVGStopElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -138,13 +134,13 @@ nsSVGStopElement::GetNumberInfo() NS_IMETHODIMP_(bool) nsSVGStopElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sGradientStopMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGStopElementBase::IsAttributeMapped(name); }
--- a/content/svg/content/src/nsSVGSwitchElement.cpp +++ b/content/svg/content/src/nsSVGSwitchElement.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGFeatures.h" #include "nsSVGSwitchElement.h" #include "nsIFrame.h" #include "nsISVGChildFrame.h" #include "nsSVGUtils.h" #include "mozilla/Preferences.h" using namespace mozilla; @@ -147,17 +145,17 @@ nsSVGSwitchElement::IsAttributeMapped(co sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGSwitchElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // Implementation Helpers: nsIContent * nsSVGSwitchElement::FindActiveChild() const
--- a/content/svg/content/src/nsSVGSymbolElement.cpp +++ b/content/svg/content/src/nsSVGSymbolElement.cpp @@ -29,18 +29,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsIDOMSVGSymbolElement.h" #include "nsSVGStylableElement.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "nsIDOMSVGFitToViewBox.h" #include "nsGkAtoms.h" using namespace mozilla; @@ -144,17 +142,17 @@ nsSVGSymbolElement::IsAttributeMapped(co sGradientStopMap, sGraphicsMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGSymbolElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGViewBox * nsSVGSymbolElement::GetViewBox()
--- a/content/svg/content/src/nsSVGTSpanElement.cpp +++ b/content/svg/content/src/nsSVGTSpanElement.cpp @@ -31,26 +31,22 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsGkAtoms.h" #include "nsIDOMSVGTSpanElement.h" #include "nsSVGSVGElement.h" #include "nsSVGTextPositioningElement.h" #include "nsContentUtils.h" -using namespace mozilla; - typedef nsSVGTextPositioningElement nsSVGTSpanElementBase; class nsSVGTSpanElement : public nsSVGTSpanElementBase, // = nsIDOMSVGTextPositioningElement public nsIDOMSVGTSpanElement { protected: friend nsresult NS_NewSVGTSpanElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); @@ -133,17 +129,17 @@ nsSVGTSpanElement::IsAttributeMapped(con static const MappedAttributeEntry* const map[] = { sColorMap, sFillStrokeMap, sFontSpecificationMap, sGraphicsMap, sTextContentElementsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGTSpanElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement overrides bool nsSVGTSpanElement::IsEventName(nsIAtom* aName)
--- a/content/svg/content/src/nsSVGTextElement.cpp +++ b/content/svg/content/src/nsSVGTextElement.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGGraphicElement.h" #include "nsGkAtoms.h" #include "nsIDOMSVGTextElement.h" #include "nsCOMPtr.h" #include "nsSVGSVGElement.h" #include "nsSVGTextPositioningElement.h" #include "nsIFrame.h" #include "nsDOMError.h" @@ -354,17 +352,17 @@ nsSVGTextElement::SelectSubString(PRUint NS_IMETHODIMP_(bool) nsSVGTextElement::IsAttributeMapped(const nsIAtom* name) const { static const MappedAttributeEntry* const map[] = { sTextContentElementsMap, sFontSpecificationMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGTextElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthListInfo nsSVGTextElement::sLengthListInfo[4] = { @@ -373,23 +371,23 @@ nsSVGElement::LengthListInfo nsSVGTextEl { &nsGkAtoms::dx, nsSVGUtils::X, PR_TRUE }, { &nsGkAtoms::dy, nsSVGUtils::Y, PR_TRUE } }; nsSVGElement::LengthListAttributesInfo nsSVGTextElement::GetLengthListInfo() { return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo, - ArrayLength(sLengthListInfo)); + NS_ARRAY_LENGTH(sLengthListInfo)); } nsSVGElement::NumberListInfo nsSVGTextElement::sNumberListInfo[1] = { { &nsGkAtoms::rotate } }; nsSVGElement::NumberListAttributesInfo nsSVGTextElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, - ArrayLength(sNumberListInfo)); + NS_ARRAY_LENGTH(sNumberListInfo)); }
--- a/content/svg/content/src/nsSVGTextPathElement.cpp +++ b/content/svg/content/src/nsSVGTextPathElement.cpp @@ -30,29 +30,25 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGStylableElement.h" #include "nsGkAtoms.h" #include "nsIDOMSVGTextPathElement.h" #include "nsIDOMSVGURIReference.h" #include "nsIFrame.h" #include "nsSVGTextPathElement.h" #include "nsDOMError.h" #include "nsContentUtils.h" -using namespace mozilla; - nsSVGElement::LengthInfo nsSVGTextPathElement::sLengthInfo[1] = { { &nsGkAtoms::startOffset, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, }; nsSVGEnumMapping nsSVGTextPathElement::sMethodMap[] = { {&nsGkAtoms::align, nsIDOMSVGTextPathElement::TEXTPATH_METHODTYPE_ALIGN}, {&nsGkAtoms::stretch, nsIDOMSVGTextPathElement::TEXTPATH_METHODTYPE_STRETCH}, @@ -150,41 +146,41 @@ nsSVGTextPathElement::IsAttributeMapped( static const MappedAttributeEntry* const map[] = { sColorMap, sFillStrokeMap, sFontSpecificationMap, sGraphicsMap, sTextContentElementsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGTextPathElementBase::IsAttributeMapped(name); } //---------------------------------------------------------------------- // nsSVGElement overrides bool nsSVGTextPathElement::IsEventName(nsIAtom* aName) { return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic); } nsSVGElement::LengthAttributesInfo nsSVGTextPathElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::EnumAttributesInfo nsSVGTextPathElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, - ArrayLength(sEnumInfo)); + NS_ARRAY_LENGTH(sEnumInfo)); } nsSVGElement::StringAttributesInfo nsSVGTextPathElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); }
--- a/content/svg/content/src/nsSVGTextPositioningElement.cpp +++ b/content/svg/content/src/nsSVGTextPositioningElement.cpp @@ -28,18 +28,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGTextPositioningElement.h" #include "SVGAnimatedLengthList.h" #include "DOMSVGAnimatedLengthList.h" #include "SVGLengthList.h" #include "DOMSVGAnimatedNumberList.h" using namespace mozilla; @@ -51,30 +49,30 @@ nsSVGElement::LengthListInfo nsSVGTextPo { &nsGkAtoms::dx, nsSVGUtils::X, PR_TRUE }, { &nsGkAtoms::dy, nsSVGUtils::Y, PR_TRUE } }; nsSVGElement::LengthListAttributesInfo nsSVGTextPositioningElement::GetLengthListInfo() { return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo, - ArrayLength(sLengthListInfo)); + NS_ARRAY_LENGTH(sLengthListInfo)); } nsSVGElement::NumberListInfo nsSVGTextPositioningElement::sNumberListInfo[1] = { { &nsGkAtoms::rotate } }; nsSVGElement::NumberListAttributesInfo nsSVGTextPositioningElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, - ArrayLength(sNumberListInfo)); + NS_ARRAY_LENGTH(sNumberListInfo)); } //---------------------------------------------------------------------- // nsIDOMSVGTextPositioningElement methods /* readonly attribute nsIDOMSVGAnimatedLengthList x; */ NS_IMETHODIMP nsSVGTextPositioningElement::GetX(nsIDOMSVGAnimatedLengthList * *aX) {
--- a/content/svg/content/src/nsSVGUseElement.cpp +++ b/content/svg/content/src/nsSVGUseElement.cpp @@ -29,30 +29,27 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsSVGUseElement.h" #include "nsIDOMSVGGElement.h" #include "nsGkAtoms.h" #include "nsIDOMDocument.h" #include "nsIDOMSVGSVGElement.h" #include "nsIDOMSVGSymbolElement.h" #include "nsIDocument.h" #include "nsIPresShell.h" #include "mozilla/dom/Element.h" #include "nsContentUtils.h" -using namespace mozilla; using namespace mozilla::dom; //////////////////////////////////////////////////////////////////////// // implementation nsSVGElement::LengthInfo nsSVGUseElement::sLengthInfo[4] = { { &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, @@ -500,24 +497,24 @@ nsSVGUseElement::PrependLocalTransformTo const_cast<nsSVGUseElement*>(this)->GetAnimatedLengthValues(&x, &y, nsnull); return matrix.PreMultiply(gfxMatrix().Translate(gfxPoint(x, y))); } nsSVGElement::LengthAttributesInfo nsSVGUseElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, - ArrayLength(sLengthInfo)); + NS_ARRAY_LENGTH(sLengthInfo)); } nsSVGElement::StringAttributesInfo nsSVGUseElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, - ArrayLength(sStringInfo)); + NS_ARRAY_LENGTH(sStringInfo)); } //---------------------------------------------------------------------- // nsIContent methods NS_IMETHODIMP_(bool) nsSVGUseElement::IsAttributeMapped(const nsIAtom* name) const { @@ -527,12 +524,12 @@ nsSVGUseElement::IsAttributeMapped(const sFontSpecificationMap, sGradientStopMap, sLightingEffectsMap, sMarkersMap, sTextContentElementsMap, sViewportsMap }; - return FindAttributeDependence(name, map, ArrayLength(map)) || + return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) || nsSVGUseElementBase::IsAttributeMapped(name); }
--- a/content/xbl/src/nsXBLContentSink.cpp +++ b/content/xbl/src/nsXBLContentSink.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsXBLContentSink.h" #include "nsIDocument.h" #include "nsBindingManager.h" #include "nsIDOMNode.h" #include "nsIParser.h" #include "nsGkAtoms.h" #include "nsINameSpaceManager.h" #include "nsHTMLTokens.h" @@ -58,17 +56,16 @@ #include "nsContentUtils.h" #include "nsIConsoleService.h" #include "nsIScriptError.h" #include "nsNodeInfoManager.h" #include "nsINodeInfo.h" #include "nsIPrincipal.h" #include "mozilla/dom/Element.h" -using namespace mozilla; using namespace mozilla::dom; nsresult NS_NewXBLContentSink(nsIXMLContentSink** aResult, nsIDocument* aDoc, nsIURI* aURI, nsISupports* aContainer) { @@ -244,17 +241,17 @@ nsXBLContentSink::ReportUnexpectedElemen mState = eXBL_Error; nsAutoString elementName; aElementName->ToString(elementName); const PRUnichar* params[] = { elementName.get() }; return nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES, "UnexpectedElement", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString() /* source line */, aLineNumber, 0 /* column number */, nsIScriptError::errorFlag, "XBL Content Sink", mDocument); }
--- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsIAtom.h" #include "nsIInputStream.h" #include "nsINameSpaceManager.h" #include "nsIURI.h" #include "nsIURL.h" #include "nsIDOMEventTarget.h" #include "nsIChannel.h" @@ -71,18 +69,16 @@ #include "nsContentUtils.h" #include "nsIScriptContext.h" #include "nsIStyleRuleProcessor.h" #include "nsXBLResourceLoader.h" #include "mozilla/dom/Element.h" -using namespace mozilla; - // Helper Classes ===================================================================== // nsXBLAttributeEntry and helpers. This class is used to efficiently handle // attribute changes in anonymous content. class nsXBLAttributeEntry { public: nsIAtom* GetSrcAttribute() { return mSrcAttribute; } @@ -171,17 +167,17 @@ public: { if (++gRefCnt == 1) { kPool = new nsFixedSizeAllocator(); if (kPool) { static const size_t kBucketSizes[] = { sizeof(nsXBLInsertionPointEntry) }; kPool->Init("XBL Insertion Point Entries", kBucketSizes, - ArrayLength(kBucketSizes), aInitialSize); + NS_ARRAY_LENGTH(kBucketSizes), aInitialSize); } } } static bool PoolInited() { return kPool != nsnull; } static void ReleasePool()
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsXBLPrototypeHandler.h" #include "nsXBLPrototypeBinding.h" #include "nsContentUtils.h" #include "nsIContent.h" #include "nsIAtom.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMMouseEvent.h" @@ -987,17 +985,17 @@ nsXBLPrototypeHandler::ReportKeyConflict } } else if (aKeyElement) { doc = aKeyElement->GetOwnerDoc(); } const PRUnichar* params[] = { aKey, aModifiers }; nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES, aMessageName, - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString(), mLineNumber, 0, nsIScriptError::warningFlag, "XBL Prototype Handler", doc); } bool nsXBLPrototypeHandler::ModifiersMatchMask(nsIDOMUIEvent* aEvent, bool aIgnoreShiftKey)
--- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -34,18 +34,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsNetUtil.h" #include "nsXBLService.h" #include "nsXBLWindowKeyHandler.h" #include "nsIInputStream.h" #include "nsINameSpaceManager.h" #include "nsHashtable.h" #include "nsIURI.h" @@ -132,17 +130,17 @@ IsAncestorBinding(nsIDocument* aDocument continue; } nsCAutoString spec; aChildBindingURI->GetSpec(spec); NS_ConvertUTF8toUTF16 bindingURI(spec); const PRUnichar* params[] = { bindingURI.get() }; nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES, "TooDeepBindingRecursion", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString(), 0, 0, nsIScriptError::warningFlag, "XBL", aDocument); return PR_TRUE; } } @@ -966,17 +964,17 @@ nsXBLService::GetBinding(nsIContent* aBo nsContentUtils::NameSpaceManager()->GetNameSpaceID(nameSpace); nsCOMPtr<nsIAtom> tagName = do_GetAtom(display); // Check the white list if (!CheckTagNameWhiteList(nameSpaceID, tagName)) { const PRUnichar* params[] = { display.get() }; nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES, "InvalidExtendsBinding", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString(), 0, 0, nsIScriptError::errorFlag, "XBL", doc); NS_ASSERTION(!IsChromeOrResourceURI(aURI), "Invalid extends value"); return NS_ERROR_ILLEGAL_VALUE; } @@ -1001,17 +999,17 @@ nsXBLService::GetBinding(nsIContent* aBo NS_ENSURE_SUCCESS(rv, rv); if (equal) { nsCAutoString spec; protoBinding->BindingURI()->GetSpec(spec); NS_ConvertUTF8toUTF16 protoSpec(spec); const PRUnichar* params[] = { protoSpec.get(), value.get() }; nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES, "CircularExtendsBinding", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString(), 0, 0, nsIScriptError::warningFlag, "XBL", boundDocument); return NS_ERROR_ILLEGAL_VALUE; } }
--- a/content/xslt/src/xpath/txCoreFunctionCall.cpp +++ b/content/xslt/src/xpath/txCoreFunctionCall.cpp @@ -31,31 +31,27 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "txExpr.h" #include "nsAutoPtr.h" #include "txNodeSet.h" #include "nsGkAtoms.h" #include "txIXPathContext.h" #include "nsWhitespaceTokenizer.h" #include "txXPathTreeWalker.h" #include <math.h> #include "txStringUtils.h" #include "txXMLUtils.h" -using namespace mozilla; - struct txCoreFunctionDescriptor { PRInt8 mMinParams; PRInt8 mMaxParams; Expr::ResultType mReturnType; nsIAtom** mName; }; @@ -753,17 +749,17 @@ txCoreFunctionCall::isSensitiveTo(Contex return PR_TRUE; } // static bool txCoreFunctionCall::getTypeFromAtom(nsIAtom* aName, eType& aType) { PRUint32 i; - for (i = 0; i < ArrayLength(descriptTable); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(descriptTable); ++i) { if (aName == *descriptTable[i].mName) { aType = static_cast<eType>(i); return PR_TRUE; } } return PR_FALSE;
--- a/content/xslt/src/xslt/txEXSLTFunctions.cpp +++ b/content/xslt/src/xslt/txEXSLTFunctions.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsIAtom.h" #include "nsGkAtoms.h" #include "txExecutionState.h" #include "txExpr.h" #include "txIXPathContext.h" #include "txNodeSet.h" #include "txOutputFormat.h" #include "txRtfHandler.h" @@ -51,18 +49,16 @@ #include "nsPrintfCString.h" #include "nsComponentManagerUtils.h" #include "nsContentCID.h" #include "nsContentCreatorFunctions.h" #include "nsIContent.h" #include "nsIDOMDocumentFragment.h" #include "txMozillaXMLOutput.h" -using namespace mozilla; - class txStylesheetCompilerState; // ------------------------------------------------------------------ // Utility functions // ------------------------------------------------------------------ static nsresult convertRtfToNode(txIEvalContext *aContext, txResultTreeFragment *aRtf) @@ -744,34 +740,34 @@ txEXSLTFunctionCall::getNameAtom(nsIAtom extern nsresult TX_ConstructEXSLTFunction(nsIAtom *aName, PRInt32 aNamespaceID, txStylesheetCompilerState* aState, FunctionCall **aResult) { PRUint32 i; - for (i = 0; i < ArrayLength(descriptTable); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(descriptTable); ++i) { txEXSLTFunctionDescriptor& desc = descriptTable[i]; if (aName == *desc.mName && aNamespaceID == desc.mNamespaceID) { *aResult = new txEXSLTFunctionCall( static_cast<txEXSLTFunctionCall::eType>(i)); return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } } return NS_ERROR_XPATH_UNKNOWN_FUNCTION; } extern bool TX_InitEXSLTFunction() { PRUint32 i; - for (i = 0; i < ArrayLength(descriptTable); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(descriptTable); ++i) { txEXSLTFunctionDescriptor& desc = descriptTable[i]; NS_ConvertASCIItoUTF16 namespaceURI(desc.mNamespaceURI); desc.mNamespaceID = txNamespaceManager::getNamespaceID(namespaceURI); if (desc.mNamespaceID == kNameSpaceID_Unknown) { return PR_FALSE; }
--- a/content/xslt/src/xslt/txStylesheetCompileHandlers.cpp +++ b/content/xslt/src/xslt/txStylesheetCompileHandlers.cpp @@ -31,34 +31,30 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "txStylesheetCompiler.h" #include "txStylesheetCompileHandlers.h" #include "nsWhitespaceTokenizer.h" #include "txInstructions.h" #include "nsGkAtoms.h" #include "txCore.h" #include "txStringUtils.h" #include "txStylesheet.h" #include "txToplevelItems.h" #include "txPatternParser.h" #include "txNamespaceMap.h" #include "txURIUtils.h" #include "txXSLTFunctions.h" -using namespace mozilla; - txHandlerTable* gTxIgnoreHandler = 0; txHandlerTable* gTxRootHandler = 0; txHandlerTable* gTxEmbedHandler = 0; txHandlerTable* gTxTopHandler = 0; txHandlerTable* gTxTemplateHandler = 0; txHandlerTable* gTxTextHandler = 0; txHandlerTable* gTxApplyTemplatesHandler = 0; txHandlerTable* gTxCallTemplateHandler = 0; @@ -3030,17 +3026,17 @@ txHandlerTable::find(PRInt32 aNamespaceI &gTx##_name##TableData.mOtherHandler); \ if (!gTx##_name##Handler) \ return PR_FALSE #define INIT_HANDLER_WITH_ELEMENT_HANDLERS(_name) \ INIT_HANDLER(_name); \ \ rv = gTx##_name##Handler->init(gTx##_name##ElementHandlers, \ - ArrayLength(gTx##_name##ElementHandlers)); \ + NS_ARRAY_LENGTH(gTx##_name##ElementHandlers)); \ if (NS_FAILED(rv)) \ return PR_FALSE #define SHUTDOWN_HANDLER(_name) \ delete gTx##_name##Handler; \ gTx##_name##Handler = nsnull // static
--- a/content/xslt/src/xslt/txStylesheetCompiler.cpp +++ b/content/xslt/src/xslt/txStylesheetCompiler.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "txStylesheetCompiler.h" #include "txStylesheetCompileHandlers.h" #include "nsGkAtoms.h" #include "txURIUtils.h" #include "nsWhitespaceTokenizer.h" #include "txStylesheet.h" #include "txInstructions.h" #include "txToplevelItems.h" @@ -50,18 +48,16 @@ #include "txLog.h" #include "txPatternParser.h" #include "txStringUtils.h" #include "txXSLTFunctions.h" #include "nsICategoryManager.h" #include "nsServiceManagerUtils.h" #include "nsTArray.h" -using namespace mozilla; - txStylesheetCompiler::txStylesheetCompiler(const nsAString& aStylesheetURI, txACompileObserver* aObserver) : txStylesheetCompilerState(aObserver) { mStatus = init(aStylesheetURI, nsnull, nsnull); } txStylesheetCompiler::txStylesheetCompiler(const nsAString& aStylesheetURI, @@ -1020,26 +1016,26 @@ struct txXPCOMFunctionMapping static nsTArray<txXPCOMFunctionMapping> *sXPCOMFunctionMappings = nsnull; static nsresult findFunction(nsIAtom* aName, PRInt32 aNamespaceID, txStylesheetCompilerState* aState, FunctionCall** aResult) { if (kExtensionFunctions[0].mNamespaceID == kNameSpaceID_Unknown) { PRUint32 i; - for (i = 0; i < ArrayLength(kExtensionFunctions); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kExtensionFunctions); ++i) { txFunctionFactoryMapping& mapping = kExtensionFunctions[i]; NS_ConvertASCIItoUTF16 namespaceURI(mapping.mNamespaceURI); mapping.mNamespaceID = txNamespaceManager::getNamespaceID(namespaceURI); } } PRUint32 i; - for (i = 0; i < ArrayLength(kExtensionFunctions); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kExtensionFunctions); ++i) { const txFunctionFactoryMapping& mapping = kExtensionFunctions[i]; if (mapping.mNamespaceID == aNamespaceID) { return mapping.mFactory(aName, aNamespaceID, aState, aResult); } } if (!sXPCOMFunctionMappings) { sXPCOMFunctionMappings = new nsTArray<txXPCOMFunctionMapping>;
--- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -53,18 +53,16 @@ keep the element map in sync for HTML elements. Why don't we just do it for _all_ elements? Well, in the case of XUL elements, which may be lazily created during frame construction, the document observer methods will never be called because we'll be adding the XUL nodes into the content model "quietly". */ -#include "mozilla/Util.h" - // Note the ALPHABETICAL ORDERING #include "nsXULDocument.h" #include "nsDOMError.h" #include "nsIBoxObject.h" #include "nsIChromeRegistry.h" #include "nsIView.h" #include "nsIViewManager.h" @@ -3049,17 +3047,17 @@ nsXULDocument::ResumeWalk() if (piProto->mTarget.EqualsLiteral("xml-stylesheet") || piProto->mTarget.EqualsLiteral("xul-overlay")) { const PRUnichar* params[] = { piProto->mTarget.get() }; nsContentUtils::ReportToConsole( nsContentUtils::eXUL_PROPERTIES, "PINotInProlog", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), overlayURI, EmptyString(), /* source line */ 0, /* line number */ 0, /* column number */ nsIScriptError::warningFlag, "XUL Document"); } @@ -3346,17 +3344,17 @@ nsXULDocument::ReportMissingOverlay(nsIU nsCAutoString spec; aURI->GetSpec(spec); NS_ConvertUTF8toUTF16 utfSpec(spec); const PRUnichar* params[] = { utfSpec.get() }; nsContentUtils::ReportToConsole(nsContentUtils::eXUL_PROPERTIES, "MissingOverlay", - params, ArrayLength(params), + params, NS_ARRAY_LENGTH(params), nsnull, EmptyString(), /* source line */ 0, /* line number */ 0, /* column number */ nsIScriptError::warningFlag, "XUL Document", this); }
--- a/content/xul/templates/src/nsRuleNetwork.cpp +++ b/content/xul/templates/src/nsRuleNetwork.cpp @@ -45,18 +45,16 @@ - Constrain() & Propagate() still feel like they are poorly named. - As do Instantiation and InstantiationSet. - Make InstantiationSet share and do copy-on-write. - Make things iterative, instead of recursive. */ -#include "mozilla/Util.h" - #include "nscore.h" #include "nsCOMPtr.h" #include "nsCRT.h" #include "nsIComponentManager.h" #include "nsIContent.h" #include "plhash.h" #include "nsReadableUtils.h" @@ -70,33 +68,31 @@ extern PRLogModuleInfo* gXULTemplateLog; #endif #include "nsRuleNetwork.h" #include "nsXULTemplateResultSetRDF.h" #include "nsRDFConMemberTestNode.h" #include "nsRDFPropertyTestNode.h" -using namespace mozilla; - bool MemoryElement::gPoolInited; nsFixedSizeAllocator MemoryElement::gPool; // static bool MemoryElement::Init() { if (!gPoolInited) { const size_t bucketsizes[] = { sizeof (nsRDFConMemberTestNode::Element), sizeof (nsRDFPropertyTestNode::Element) }; if (NS_FAILED(gPool.Init("MemoryElement", bucketsizes, - ArrayLength(bucketsizes), 256))) + NS_ARRAY_LENGTH(bucketsizes), 256))) return PR_FALSE; gPoolInited = PR_TRUE; } return PR_TRUE; }
--- a/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/content/xul/templates/src/nsXULContentBuilder.cpp @@ -35,18 +35,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsContentCID.h" #include "nsIDocument.h" #include "nsIDOMNodeList.h" #include "nsIDOMXULDocument.h" #include "nsINodeInfo.h" #include "nsIServiceManager.h" #include "nsIXULDocument.h" @@ -68,17 +66,16 @@ #include "nsAttrName.h" #include "nsNodeUtils.h" #include "mozAutoDocUpdate.h" #include "jsapi.h" #include "pldhash.h" #include "rdf.h" -using namespace mozilla; using namespace mozilla::dom; //---------------------------------------------------------------------- // // Return values for EnsureElementHasGenericChild() // #define NS_ELEMENT_GOT_CREATED NS_RDF_NO_VALUE #define NS_ELEMENT_WAS_THERE NS_OK @@ -644,17 +641,17 @@ nsXULContentBuilder::BuildContentFromTem else if (tag == nsGkAtoms::textnode && nameSpaceID == kNameSpaceID_XUL) { // <xul:text value="..."> is replaced by text of the // actual value of the 'rdf:resource' attribute for the // given node. // SynchronizeUsingTemplate contains code used to update textnodes, // so make sure to modify both when changing this PRUnichar attrbuf[128]; - nsFixedString attrValue(attrbuf, ArrayLength(attrbuf), 0); + nsFixedString attrValue(attrbuf, NS_ARRAY_LENGTH(attrbuf), 0); tmplKid->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue); if (!attrValue.IsEmpty()) { nsAutoString value; rv = SubstituteText(aChild, attrValue, value); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsIContent> content; rv = NS_NewTextNode(getter_AddRefs(content), @@ -783,17 +780,17 @@ nsXULContentBuilder::CopyAttributesToEle nsCOMPtr<nsIAtom> attribName = name->LocalName(); // XXXndeakin ignore namespaces until bug 321182 is fixed if (attribName != nsGkAtoms::id && attribName != nsGkAtoms::uri) { // Create a buffer here, because there's a chance that an // attribute in the template is going to be an RDF URI, which is // usually longish. PRUnichar attrbuf[128]; - nsFixedString attribValue(attrbuf, ArrayLength(attrbuf), 0); + nsFixedString attribValue(attrbuf, NS_ARRAY_LENGTH(attrbuf), 0); aTemplateNode->GetAttr(attribNameSpaceID, attribName, attribValue); if (!attribValue.IsEmpty()) { nsAutoString value; rv = SubstituteText(aResult, attribValue, value); if (NS_FAILED(rv)) return rv; // if the string is empty after substitutions, remove the @@ -921,17 +918,17 @@ nsXULContentBuilder::SynchronizeUsingTem if (! realKid) break; // check for text nodes and update them accordingly. // This code is similar to that in BuildContentFromTemplate if (tmplKid->NodeInfo()->Equals(nsGkAtoms::textnode, kNameSpaceID_XUL)) { PRUnichar attrbuf[128]; - nsFixedString attrValue(attrbuf, ArrayLength(attrbuf), 0); + nsFixedString attrValue(attrbuf, NS_ARRAY_LENGTH(attrbuf), 0); tmplKid->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue); if (!attrValue.IsEmpty()) { nsAutoString value; rv = SubstituteText(aResult, attrValue, value); if (NS_FAILED(rv)) return rv; realKid->SetText(value, PR_TRUE); } }
--- a/content/xul/templates/src/nsXULContentUtils.cpp +++ b/content/xul/templates/src/nsXULContentUtils.cpp @@ -52,17 +52,16 @@ /* A package of routines shared by the XUL content code. */ -#include "mozilla/Util.h" #include "nsCOMPtr.h" #include "nsIContent.h" #include "nsINodeInfo.h" #include "nsIDocument.h" #include "nsIDOMElement.h" #include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULDocument.h" @@ -87,18 +86,16 @@ #include "nsIScriptableDateFormat.h" #include "nsICollation.h" #include "nsCollationCID.h" #include "nsILocale.h" #include "nsILocaleService.h" #include "nsIConsoleService.h" #include "nsEscape.h" -using namespace mozilla; - static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); //------------------------------------------------------------------------ nsIRDFService* nsXULContentUtils::gRDF; nsIDateTimeFormat* nsXULContentUtils::gFormat; nsICollation *nsXULContentUtils::gCollation; @@ -223,17 +220,17 @@ nsXULContentUtils::FindChildByTag(nsICon nsresult nsXULContentUtils::GetElementResource(nsIContent* aElement, nsIRDFResource** aResult) { // Perform a reverse mapping from an element in the content model // to an RDF resource. nsresult rv; PRUnichar buf[128]; - nsFixedString id(buf, ArrayLength(buf), 0); + nsFixedString id(buf, NS_ARRAY_LENGTH(buf), 0); // Whoa. Why the "id" attribute? What if it's not even a XUL // element? This is totally bogus! aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id); if (id.IsEmpty()) return NS_ERROR_FAILURE; // Since the element will store its ID attribute as a document-relative value, @@ -414,17 +411,17 @@ nsXULContentUtils::GetResource(PRInt32 a // XXX should we allow nodes with no namespace??? //NS_PRECONDITION(aNameSpaceID != kNameSpaceID_Unknown, "no namespace"); //if (aNameSpaceID == kNameSpaceID_Unknown) // return NS_ERROR_UNEXPECTED; nsresult rv; PRUnichar buf[256]; - nsFixedString uri(buf, ArrayLength(buf), 0); + nsFixedString uri(buf, NS_ARRAY_LENGTH(buf), 0); if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) { rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, uri); // XXX ignore failure; treat as "no namespace" } // XXX check to see if we need to insert a '/' or a '#'. Oy. if (!uri.IsEmpty() && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#') uri.Append(PRUnichar('#'));
--- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -36,18 +36,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #ifdef MOZ_LOGGING // so we can get logging even in release builds (but only for some things) #define FORCE_PR_LOG 1 #endif #include "nsIBrowserDOMWindow.h" #include "nsIComponentManager.h" #include "nsIContent.h" @@ -10750,17 +10748,17 @@ nsDocShell::ConfirmRepost(bool * aRepost rv = appBundle->GetStringFromName(NS_LITERAL_STRING("confirmRepostPrompt").get(), getter_Copies(msgString)); } else { // Brand available - if the app has an override file with formatting, the app name will // be included. Without an override, the prompt will look like the generic version. const PRUnichar *formatStrings[] = { brandName.get() }; rv = appBundle->FormatStringFromName(NS_LITERAL_STRING("confirmRepostPrompt").get(), - formatStrings, ArrayLength(formatStrings), + formatStrings, NS_ARRAY_LENGTH(formatStrings), getter_Copies(msgString)); } if (NS_FAILED(rv)) return rv; rv = appBundle->GetStringFromName(NS_LITERAL_STRING("resendButton.label").get(), getter_Copies(button0Title)); if (NS_FAILED(rv)) return rv;
--- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -33,18 +33,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - // JavaScript includes #include "jsapi.h" #include "jsprvtd.h" // we are using private JS typedefs... #include "jscntxt.h" #include "jsdbgapi.h" #include "WrapperFactory.h" #include "AccessCheck.h" @@ -2156,17 +2154,17 @@ nsDOMClassInfo::RegisterExternalClasses( #define DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(_if, _cond) \ (_cond) ? &NS_GET_IID(_if) : nsnull, #define DOM_CLASSINFO_MAP_END \ nsnull \ }; \ \ /* Compact the interface list */ \ - size_t count = ArrayLength(interface_list); \ + size_t count = NS_ARRAY_LENGTH(interface_list); \ /* count is the number of array entries, which is one greater than the */ \ /* number of interfaces due to the terminating null */ \ for (size_t i = 0; i < count - 1; ++i) { \ if (!interface_list[i]) { \ memmove(&interface_list[i], &interface_list[i+1], \ sizeof(nsIID*) * (count - i)); \ /* Make sure to examine the new pointer we ended up with at this */ \ /* slot, since it may be null too */ \ @@ -4127,17 +4125,17 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(CustomEvent, nsIDOMCustomEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMCustomEvent) DOM_CLASSINFO_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END #ifdef NS_DEBUG { - PRUint32 i = ArrayLength(sClassInfoData); + PRUint32 i = NS_ARRAY_LENGTH(sClassInfoData); if (i != eDOMClassInfoIDCount) { NS_ERROR("The number of items in sClassInfoData doesn't match the " "number of nsIDOMClassInfo ID's, this is bad! Fix it!"); return NS_ERROR_NOT_INITIALIZED; } @@ -5261,29 +5259,29 @@ nsWindowSH::Enumerate(nsIXPConnectWrappe return NS_OK; } static const char* FindConstructorContractID(const nsDOMClassInfoData *aDOMClassInfoData) { PRUint32 i; - for (i = 0; i < ArrayLength(kConstructorMap); ++i) { + for (i = 0; i < NS_ARRAY_LENGTH(kConstructorMap); ++i) { if (&sClassInfoData[kConstructorMap[i].mDOMClassInfoID] == aDOMClassInfoData) { return kConstructorMap[i].mContractID; } } return nsnull; } static nsDOMConstructorFunc FindConstructorFunc(const nsDOMClassInfoData *aDOMClassInfoData) { - for (PRUint32 i = 0; i < ArrayLength(kConstructorFuncMap); ++i) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kConstructorFuncMap); ++i) { if (&sClassInfoData[kConstructorFuncMap[i].mDOMClassInfoID] == aDOMClassInfoData) { return kConstructorFuncMap[i].mConstructorFunc; } } return nsnull; } @@ -6648,17 +6646,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp // It is not worth calling GlobalResolve() if we are resolving // for assignment, since only read-write properties get dealt // with there. if (!(flags & JSRESOLVE_ASSIGNING)) { JSAutoRequest ar(cx); // Resolve special classes. - for (PRUint32 i = 0; i < ArrayLength(sOtherResolveFuncs); i++) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sOtherResolveFuncs); i++) { if (!sOtherResolveFuncs[i](cx, obj, id, flags, objp)) { return NS_ERROR_FAILURE; } if (*objp) { return NS_OK; } }
--- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -42,18 +42,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "base/basictypes.h" // Local Includes #include "nsGlobalWindow.h" #include "nsScreen.h" #include "nsHistory.h" #include "nsPerformance.h" #include "nsDOMNavigationTiming.h" @@ -4629,17 +4627,17 @@ nsGlobalWindow::MakeScriptDialogTitle(ns nsCAutoString prepath; fixedURI->GetPrePath(prepath); NS_ConvertUTF8toUTF16 ucsPrePath(prepath); const PRUnichar *formatStrings[] = { ucsPrePath.get() }; nsXPIDLString tempString; nsContentUtils::FormatLocalizedString(nsContentUtils::eCOMMON_DIALOG_PROPERTIES, "ScriptDlgHeading", - formatStrings, ArrayLength(formatStrings), + formatStrings, NS_ARRAY_LENGTH(formatStrings), tempString); aOutTitle = tempString; } } } } } else { // failed to get subject principal
--- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -35,18 +35,16 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifdef MOZ_WIDGET_QT #include <QX11Info> #endif -#include "mozilla/Util.h" - #include "base/basictypes.h" #include "prtypes.h" #include "prmem.h" #include "prenv.h" #include "prclist.h" #include "jscntxt.h" @@ -1619,17 +1617,17 @@ bool NP_CALLBACK if (!obj) { return false; } obj = JS_ObjectToInnerObject(cx, obj); // Root obj and the rval (below). jsval vec[] = { OBJECT_TO_JSVAL(obj), JSVAL_NULL }; - js::AutoArrayRooter tvr(cx, ArrayLength(vec), vec); + js::AutoArrayRooter tvr(cx, NS_ARRAY_LENGTH(vec), vec); jsval *rval = &vec[1]; if (result) { // Initialize the out param to void VOID_TO_NPVARIANT(*result); } if (!script || !script->UTF8Length || !script->UTF8Characters) {
--- a/dom/plugins/base/nsPluginsDirWin.cpp +++ b/dom/plugins/base/nsPluginsDirWin.cpp @@ -38,46 +38,42 @@ /* nsPluginsDirWin.cpp Windows implementation of the nsPluginsDir/nsPluginsFile classes. by Alex Musil */ -#include "mozilla/Util.h" - #include "nsPluginsDir.h" #include "prlink.h" #include "plstr.h" #include "prmem.h" #include "prprf.h" #include "windows.h" #include "winbase.h" #include "nsString.h" #include "nsILocalFile.h" #include "nsUnicharUtils.h" #include "nsSetDllDirectory.h" -using namespace mozilla; - /* Local helper functions */ static char* GetKeyValue(void* verbuf, const WCHAR* key, UINT language, UINT codepage) { WCHAR keybuf[64]; // plenty for the template below, with the longest key // we use (currently "FileDescription") const WCHAR keyFormat[] = L"\\StringFileInfo\\%04X%04X\\%s"; WCHAR *buf = NULL; UINT blen; - if (_snwprintf_s(keybuf, ArrayLength(keybuf), _TRUNCATE, + if (_snwprintf_s(keybuf, NS_ARRAY_LENGTH(keybuf), _TRUNCATE, keyFormat, language, codepage, key) < 0) { NS_NOTREACHED("plugin info key too long for buffer!"); return nsnull; } if (::VerQueryValueW(verbuf, keybuf, (void **)&buf, &blen) == 0 || buf == nsnull || blen == 0)
--- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -40,18 +40,16 @@ #if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6) #include <QEvent> #include <QKeyEvent> #include <QApplication> #include <QInputMethodEvent> #include "nsQtKeyUtils.h" #endif -#include "mozilla/Util.h" - #include "PluginBackgroundDestroyer.h" #include "PluginInstanceChild.h" #include "PluginModuleChild.h" #include "BrowserStreamChild.h" #include "PluginStreamChild.h" #include "StreamNotifyChild.h" #include "PluginProcessChild.h" #include "gfxASurface.h" @@ -67,17 +65,16 @@ using mozilla::gfx::SharedDIBSurface; #endif #include "gfxSharedImageSurface.h" #include "gfxUtils.h" #include "gfxAlphaRecovery.h" #include "mozilla/ipc/SyncChannel.h" #include "mozilla/AutoRestore.h" -using namespace mozilla; using mozilla::ipc::ProcessChild; using namespace mozilla::plugins; #ifdef MOZ_WIDGET_GTK2 #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <gdk/gdk.h> @@ -1538,17 +1535,17 @@ PluginInstanceChild::TrackPopupHookProc( NS_ERROR("TrackPopupMenu stub isn't set! Badness!"); return 0; } // Only change the parent when we know this is a context on the plugin // surface within the browser. Prevents resetting the parent on child ui // displayed by plugins that have working parent-child relationships. PRUnichar szClass[21]; - bool haveClass = GetClassNameW(hWnd, szClass, ArrayLength(szClass)); + bool haveClass = GetClassNameW(hWnd, szClass, NS_ARRAY_LENGTH(szClass)); if (!haveClass || (wcscmp(szClass, L"MozillaWindowClass") && wcscmp(szClass, L"SWFlash_Placeholder"))) { // Unrecognized parent return sUser32TrackPopupMenuStub(hMenu, uFlags, x, y, nReserved, hWnd, prcRect); }
--- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -38,18 +38,16 @@ * ***** END LICENSE BLOCK ***** */ #ifdef MOZ_WIDGET_QT #include <QtCore/QTimer> #include "nsQAppInstance.h" #include "NestedLoopTimer.h" #endif -#include "mozilla/Util.h" - #include "mozilla/plugins/PluginModuleChild.h" #include "mozilla/ipc/SyncChannel.h" #ifdef MOZ_WIDGET_GTK2 #include <gtk/gtk.h> #endif #include "nsILocalFile.h" @@ -78,17 +76,16 @@ #include "mozilla/widget/AudioSession.h" #endif #ifdef MOZ_WIDGET_COCOA #include "PluginInterposeOSX.h" #include "PluginUtilsOSX.h" #endif -using namespace mozilla; using namespace mozilla::plugins; using mozilla::dom::CrashReporterChild; using mozilla::dom::PCrashReporterChild; #if defined(XP_WIN) const PRUnichar * kFlashFullscreenClass = L"ShockwaveFlashFullScreen"; const PRUnichar * kMozillaWindowClass = L"MozillaWindowClass"; #endif @@ -1901,17 +1898,17 @@ PMCGetWindowInfoHook(HWND hWnd, PWINDOWI if (!sGetWindowInfoPtrStub) { NS_ASSERTION(FALSE, "Something is horribly wrong in PMCGetWindowInfoHook!"); return FALSE; } if (!sBrowserHwnd) { PRUnichar szClass[20]; - if (GetClassNameW(hWnd, szClass, ArrayLength(szClass)) && + if (GetClassNameW(hWnd, szClass, NS_ARRAY_LENGTH(szClass)) && !wcscmp(szClass, kMozillaWindowClass)) { sBrowserHwnd = hWnd; } } // Oddity: flash does strange rect comparisons for mouse input destined for // it's internal settings window. Post removing sub widgets for tabs, touch // this up so they get the rect they expect. // XXX potentially tie this to a specific major version?
--- a/dom/system/unix/nsDeviceMotionSystem.cpp +++ b/dom/system/unix/nsDeviceMotionSystem.cpp @@ -31,24 +31,19 @@ * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include <unistd.h> - -#include "mozilla/Util.h" - #include "nsDeviceMotionSystem.h" #include "nsIServiceManager.h" -using namespace mozilla; - typedef struct { const char* mPosition; const char* mCalibrate; nsAccelerometerSystemDriver mToken; } AccelerometerData; static const AccelerometerData gAccelerometers[] = { // MacBook @@ -194,17 +189,17 @@ nsDeviceMotionSystem::UpdateHandler(nsIT self->DeviceMotionChanged(nsIDeviceMotionData::TYPE_ACCELERATION, xf, yf, zf ); } void nsDeviceMotionSystem::Startup() { // Accelerometers in Linux are used by reading a file (yay UNIX!), which is // in a slightly different location depending on the driver. - for (unsigned int i = 0; i < ArrayLength(gAccelerometers); i++) { + for (unsigned int i = 0; i < NS_ARRAY_LENGTH(gAccelerometers); i++) { if (!(mPositionFile = fopen(gAccelerometers[i].mPosition, "r"))) continue; mType = gAccelerometers[i].mToken; if (gAccelerometers[i].mCalibrate) { mCalibrateFile = fopen(gAccelerometers[i].mCalibrate, "r"); if (!mCalibrateFile) { fclose(mPositionFile);
--- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "RuntimeService.h" #include "nsIDOMChromeWindow.h" #include "nsIDocument.h" #include "nsIEffectiveTLDService.h" #include "nsIObserverService.h" #include "nsIPlatformCharset.h" #include "nsIPrincipal.h" @@ -64,18 +62,16 @@ #include "nsXPCOMPrivate.h" #include "xpcpublic.h" #include "Events.h" #include "EventTarget.h" #include "Worker.h" #include "WorkerPrivate.h" -using namespace mozilla; - USING_WORKERS_NAMESPACE using mozilla::MutexAutoLock; using mozilla::MutexAutoUnlock; using mozilla::Preferences; using namespace mozilla::xpconnect::memory; // The size of the worker runtime heaps in bytes. @@ -836,17 +832,17 @@ RuntimeService::Init() do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); rv = obs->AddObserver(this, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID, PR_FALSE); NS_ENSURE_SUCCESS(rv, rv); mObserved = true; - for (PRUint32 index = 0; index < ArrayLength(gPrefsToWatch); index++) { + for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(gPrefsToWatch); index++) { if (NS_FAILED(Preferences::RegisterCallback(PrefCallback, gPrefsToWatch[index], this))) { NS_WARNING("Failed to register pref callback?!"); } PrefCallback(gPrefsToWatch[index], this); } // We assume atomic 32bit reads/writes. If this assumption doesn't hold on @@ -951,17 +947,17 @@ RuntimeService::Cleanup() } } if (mWindowMap.IsInitialized()) { NS_ASSERTION(!mWindowMap.Count(), "All windows should have been released!"); } if (mObserved) { - for (PRUint32 index = 0; index < ArrayLength(gPrefsToWatch); index++) { + for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(gPrefsToWatch); index++) { Preferences::UnregisterCallback(PrefCallback, gPrefsToWatch[index], this); } nsCOMPtr<nsIObserverService> obs = do_GetService(NS_OBSERVERSERVICE_CONTRACTID); NS_WARN_IF_FALSE(obs, "Failed to get observer service?!"); if (obs) {
--- a/editor/libeditor/html/nsEditProperty.cpp +++ b/editor/libeditor/html/nsEditProperty.cpp @@ -32,23 +32,20 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsMemory.h" #include "nsStaticAtom.h" #include "nsEditProperty.h" -using namespace mozilla; #define EDITOR_ATOM(name_, value_) nsIAtom* nsEditProperty::name_ = 0; #include "nsEditPropertyAtomList.h" #undef EDITOR_ATOM /* From the HTML 4.0 DTD, INLINE: @@ -80,10 +77,10 @@ nsEditProperty::RegisterAtoms() { // inline tags static const nsStaticAtom property_atoms[] = { #define EDITOR_ATOM(name_, value_) NS_STATIC_ATOM(name_##_buffer, &name_), #include "nsEditPropertyAtomList.h" #undef EDITOR_ATOM }; - NS_RegisterStaticAtoms(property_atoms, ArrayLength(property_atoms)); + NS_RegisterStaticAtoms(property_atoms, NS_ARRAY_LENGTH(property_atoms)); }
--- a/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -31,17 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" #include "nsHTMLEditor.h" #include "nsHTMLEditRules.h" #include "nsTextEditUtils.h" #include "nsHTMLEditUtils.h" #include "nsWSRunObject.h" #include "nsIDOMNode.h" @@ -1216,17 +1215,17 @@ nsHTMLEditor::ParseCFHTML(nsCString & aC if (startHTML == -1) return PR_FALSE; } if (endHTML == -1) { const char endFragmentMarker[] = "<!--EndFragment-->"; endHTML = aCfhtml.Find(endFragmentMarker); if (endHTML == -1) return PR_FALSE; - endHTML += ArrayLength(endFragmentMarker) - 1; + endHTML += NS_ARRAY_LENGTH(endFragmentMarker) - 1; } // create context string nsCAutoString contextUTF8(Substring(aCfhtml, startHTML, startFragment - startHTML) + NS_LITERAL_CSTRING("<!--" kInsertCookie "-->") + Substring(aCfhtml, endFragment, endHTML - endFragment)); // validate startFragment @@ -1827,17 +1826,17 @@ bool nsHTMLEditor::HavePrivateHTMLFlavor // we have our own internal html format on clipboard. NS_ENSURE_TRUE(aClipboard, PR_FALSE); bool bHavePrivateHTMLFlavor = false; const char* flavArray[] = { kHTMLContext }; if (NS_SUCCEEDED(aClipboard->HasDataMatchingFlavors(flavArray, - ArrayLength(flavArray), nsIClipboard::kGlobalClipboard, + NS_ARRAY_LENGTH(flavArray), nsIClipboard::kGlobalClipboard, &bHavePrivateHTMLFlavor ))) return bHavePrivateHTMLFlavor; return PR_FALSE; } NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType) @@ -1993,21 +1992,21 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRI nsCOMPtr<nsIClipboard> clipboard(do_GetService("@mozilla.org/widget/clipboard;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); bool haveFlavors; // Use the flavors depending on the current editor mask if (IsPlaintextEditor()) rv = clipboard->HasDataMatchingFlavors(textEditorFlavors, - ArrayLength(textEditorFlavors), + NS_ARRAY_LENGTH(textEditorFlavors), aSelectionType, &haveFlavors); else rv = clipboard->HasDataMatchingFlavors(textHtmlEditorFlavors, - ArrayLength(textHtmlEditorFlavors), + NS_ARRAY_LENGTH(textHtmlEditorFlavors), aSelectionType, &haveFlavors); NS_ENSURE_SUCCESS(rv, rv); *aCanPaste = haveFlavors; return NS_OK; } @@ -2029,20 +2028,20 @@ NS_IMETHODIMP nsHTMLEditor::CanPasteTran // Peek in |aTransferable| to see if it contains a supported MIME type. // Use the flavors depending on the current editor mask const char ** flavors; unsigned length; if (IsPlaintextEditor()) { flavors = textEditorFlavors; - length = ArrayLength(textEditorFlavors); + length = NS_ARRAY_LENGTH(textEditorFlavors); } else { flavors = textHtmlEditorFlavors; - length = ArrayLength(textHtmlEditorFlavors); + length = NS_ARRAY_LENGTH(textHtmlEditorFlavors); } for (unsigned int i = 0; i < length; i++, flavors++) { nsCOMPtr<nsISupports> data; PRUint32 dataLen; nsresult rv = aTransferable->GetTransferData(*flavors, getter_AddRefs(data), &dataLen);
--- a/editor/libeditor/html/nsHTMLEditUtils.cpp +++ b/editor/libeditor/html/nsHTMLEditUtils.cpp @@ -30,34 +30,30 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsHTMLEditUtils.h" #include "nsTextEditUtils.h" #include "nsString.h" #include "nsUnicharUtils.h" #include "nsEditor.h" #include "nsEditProperty.h" #include "nsIAtom.h" #include "nsIDOMNode.h" #include "nsIContent.h" #include "nsIDOMNodeList.h" #include "nsIDOMHTMLAnchorElement.h" #include "nsHTMLTags.h" -using namespace mozilla; - /////////////////////////////////////////////////////////////////////////// // bool nsHTMLEditUtils::IsBig(nsIDOMNode *node) { return nsEditor::NodeIsType(node, nsEditProperty::big); } @@ -769,17 +765,17 @@ nsHTMLEditUtils::CanContain(PRInt32 aPar eHTMLTag_form, eHTMLTag_iframe, eHTMLTag_input, eHTMLTag_select, eHTMLTag_textarea }; PRUint32 j; - for (j = 0; j < ArrayLength(kButtonExcludeKids); ++j) { + for (j = 0; j < NS_ARRAY_LENGTH(kButtonExcludeKids); ++j) { if (kButtonExcludeKids[j] == aChild) { return PR_FALSE; } } } // Deprecated elements. if (aChild == eHTMLTag_bgsound) {
--- a/editor/libeditor/text/nsPlaintextDataTransfer.cpp +++ b/editor/libeditor/text/nsPlaintextDataTransfer.cpp @@ -30,17 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" #include "nsPlaintextEditor.h" #include "nsIDOMDocument.h" #include "nsIDocument.h" #include "nsIContent.h" #include "nsIFormControl.h" #include "nsIDOMEventTarget.h" @@ -66,18 +65,16 @@ // Misc #include "nsEditorUtils.h" #include "nsContentCID.h" #include "nsISelectionPrivate.h" #include "nsFrameSelection.h" #include "nsEventDispatcher.h" #include "nsContentUtils.h" -using namespace mozilla; - NS_IMETHODIMP nsPlaintextEditor::PrepareTransferable(nsITransferable **transferable) { // Create generic Transferable for getting the data nsresult rv = CallCreateInstance("@mozilla.org/widget/transferable;1", transferable); NS_ENSURE_SUCCESS(rv, rv); // Get the nsITransferable interface for getting the data from the clipboard if (transferable) { @@ -481,17 +478,17 @@ NS_IMETHODIMP nsPlaintextEditor::CanPast nsCOMPtr<nsIClipboard> clipboard(do_GetService("@mozilla.org/widget/clipboard;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); // the flavors that we can deal with const char* textEditorFlavors[] = { kUnicodeMime }; bool haveFlavors; rv = clipboard->HasDataMatchingFlavors(textEditorFlavors, - ArrayLength(textEditorFlavors), + NS_ARRAY_LENGTH(textEditorFlavors), aSelectionType, &haveFlavors); NS_ENSURE_SUCCESS(rv, rv); *aCanPaste = haveFlavors; return NS_OK; }
--- a/editor/txtsvc/src/nsTextServicesDocument.cpp +++ b/editor/txtsvc/src/nsTextServicesDocument.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nscore.h" #include "nsLayoutCID.h" #include "nsIAtom.h" #include "nsStaticAtom.h" #include "nsString.h" #include "nsIEnumerator.h" #include "nsIContent.h" #include "nsIContentIterator.h" @@ -61,17 +59,16 @@ #include "nsLWBrkCIID.h" #include "nsIWordBreaker.h" #include "nsIServiceManager.h" #define LOCK_DOC(doc) #define UNLOCK_DOC(doc) -using namespace mozilla; class OffsetEntry { public: OffsetEntry(nsIDOMNode *aNode, PRInt32 aOffset, PRInt32 aLength) : mNode(aNode), mNodeOffset(0), mStrOffset(aOffset), mLength(aLength), mIsInsertedText(PR_FALSE), mIsValid(PR_TRUE) { @@ -131,17 +128,17 @@ void nsTextServicesDocument::RegisterAtoms() { static const nsStaticAtom ts_atoms[] = { #define TS_ATOM(name_, value_) NS_STATIC_ATOM(name_##_buffer, &name_), #include "nsTSAtomList.h" #undef TS_ATOM }; - NS_RegisterStaticAtoms(ts_atoms, ArrayLength(ts_atoms)); + NS_RegisterStaticAtoms(ts_atoms, NS_ARRAY_LENGTH(ts_atoms)); } /* static */ void nsTextServicesDocument::Shutdown() { NS_IF_RELEASE(sRangeHelper); }
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp +++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp @@ -33,18 +33,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nspr.h" #include "nsIFileStreams.h" // New Necko file streams #ifdef XP_OS2 #include "nsILocalFileOS2.h" #endif @@ -119,18 +117,16 @@ #include "ftpCore.h" #include "nsITransport.h" #include "nsISocketTransport.h" #include "nsIStringBundle.h" #include "nsIProtocolHandler.h" #include "nsWebBrowserPersist.h" -using namespace mozilla; - // Buffer file writes in 32kb chunks #define BUFFERED_OUTPUT_SIZE (1024 * 32) #define NS_SUCCESS_DONT_FIXUP NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 1) // Information about a DOM document struct DocData { @@ -3948,17 +3944,17 @@ static const char kSpecialXHTMLTags[][11 static bool IsSpecialXHTMLTag(nsIDOMNode *aNode) { nsAutoString tmp; aNode->GetNamespaceURI(tmp); if (!tmp.EqualsLiteral("http://www.w3.org/1999/xhtml")) return PR_FALSE; aNode->GetLocalName(tmp); - for (PRUint32 i = 0; i < ArrayLength(kSpecialXHTMLTags); i++) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kSpecialXHTMLTags); i++) { if (tmp.EqualsASCII(kSpecialXHTMLTags[i])) { // XXX This element MAY have URI attributes, but // we are not actually checking if they are present. // That would slow us down further, and I am not so sure // how important that would be. return PR_TRUE; }
--- a/extensions/auth/nsAuthGSSAPI.cpp +++ b/extensions/auth/nsAuthGSSAPI.cpp @@ -45,18 +45,16 @@ // Described by IETF Internet draft: draft-brezak-kerberos-http-00.txt // (formerly draft-brezak-spnego-http-04.txt) // // Also described here: // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/http-sso-1.asp // // -#include "mozilla/Util.h" - #include "prlink.h" #include "nsCOMPtr.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsIServiceManager.h" #include "nsNativeCharsetUtils.h" #include "nsAuthGSSAPI.h" @@ -73,61 +71,59 @@ typedef KLStatus (*KLCacheHasValidTicket KLPrincipal *, char **); #endif #if defined(HAVE_RES_NINIT) #include <resolv.h> #endif -using namespace mozilla; - //----------------------------------------------------------------------------- // We define GSS_C_NT_HOSTBASED_SERVICE explicitly since it may be referenced // by by a different name depending on the implementation of gss but always // has the same value static gss_OID_desc gss_c_nt_hostbased_service = { 10, (void *) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04" }; static const char kNegotiateAuthGssLib[] = "network.negotiate-auth.gsslib"; static const char kNegotiateAuthNativeImp[] = "network.negotiate-auth.using-native-gsslib"; -static struct { - const char *str; - PRFuncPtr func; -} gssFuncs[] = { - { "gss_display_status", NULL }, - { "gss_init_sec_context", NULL }, - { "gss_indicate_mechs", NULL }, - { "gss_release_oid_set", NULL }, - { "gss_delete_sec_context", NULL }, - { "gss_import_name", NULL }, - { "gss_release_buffer", NULL }, - { "gss_release_name", NULL }, - { "gss_wrap", NULL }, - { "gss_unwrap", NULL } +static const char *gssFuncStr[] = { + "gss_display_status", + "gss_init_sec_context", + "gss_indicate_mechs", + "gss_release_oid_set", + "gss_delete_sec_context", + "gss_import_name", + "gss_release_buffer", + "gss_release_name", + "gss_wrap", + "gss_unwrap" }; +#define gssFuncItems NS_ARRAY_LENGTH(gssFuncStr) + +static PRFuncPtr gssFunPtr[gssFuncItems]; static bool gssNativeImp = true; static PRLibrary* gssLibrary = nsnull; -#define gss_display_status_ptr ((gss_display_status_type)*gssFuncs[0].func) -#define gss_init_sec_context_ptr ((gss_init_sec_context_type)*gssFuncs[1].func) -#define gss_indicate_mechs_ptr ((gss_indicate_mechs_type)*gssFuncs[2].func) -#define gss_release_oid_set_ptr ((gss_release_oid_set_type)*gssFuncs[3].func) -#define gss_delete_sec_context_ptr ((gss_delete_sec_context_type)*gssFuncs[4].func) -#define gss_import_name_ptr ((gss_import_name_type)*gssFuncs[5].func) -#define gss_release_buffer_ptr ((gss_release_buffer_type)*gssFuncs[6].func) -#define gss_release_name_ptr ((gss_release_name_type)*gssFuncs[7].func) -#define gss_wrap_ptr ((gss_wrap_type)*gssFuncs[8].func) -#define gss_unwrap_ptr ((gss_unwrap_type)*gssFuncs[9].func) +#define gss_display_status_ptr ((gss_display_status_type)*gssFunPtr[0]) +#define gss_init_sec_context_ptr ((gss_init_sec_context_type)*gssFunPtr[1]) +#define gss_indicate_mechs_ptr ((gss_indicate_mechs_type)*gssFunPtr[2]) +#define gss_release_oid_set_ptr ((gss_release_oid_set_type)*gssFunPtr[3]) +#define gss_delete_sec_context_ptr ((gss_delete_sec_context_type)*gssFunPtr[4]) +#define gss_import_name_ptr ((gss_import_name_type)*gssFunPtr[5]) +#define gss_release_buffer_ptr ((gss_release_buffer_type)*gssFunPtr[6]) +#define gss_release_name_ptr ((gss_release_name_type)*gssFunPtr[7]) +#define gss_wrap_ptr ((gss_wrap_type)*gssFunPtr[8]) +#define gss_unwrap_ptr ((gss_unwrap_type)*gssFunPtr[9]) #ifdef XP_MACOSX static PRFuncPtr KLCacheHasValidTicketsPtr; #define KLCacheHasValidTickets_ptr \ ((KLCacheHasValidTickets_type)*KLCacheHasValidTicketsPtr) #endif static nsresult @@ -163,17 +159,17 @@ gssInit() }; const char *const verLibNames[] = { "libgssapi_krb5.so.2", /* MIT - FC, Suse10, Debian */ "libgssapi.so.4", /* Heimdal - Suse10, MDK */ "libgssapi.so.1" /* Heimdal - Suse9, CITI - FC, MDK, Suse10*/ }; - for (size_t i = 0; i < ArrayLength(verLibNames) && !lib; ++i) { + for (size_t i = 0; i < NS_ARRAY_LENGTH(verLibNames) && !lib; ++i) { lib = PR_LoadLibrary(verLibNames[i]); /* The CITI libgssapi library calls exit() during * initialization if it's not correctly configured. Try to * ensure that we never use this library for our GSSAPI * support, as its just a wrapper library, anyway. * See Bugzilla #325433 */ @@ -182,17 +178,17 @@ gssInit() "internal_krb5_gss_initialize") && PR_FindFunctionSymbol(lib, "gssd_pname_to_uid")) { LOG(("CITI libgssapi found, which calls exit(). Skipping\n")); PR_UnloadLibrary(lib); lib = NULL; } } - for (size_t i = 0; i < ArrayLength(libNames) && !lib; ++i) { + for (size_t i = 0; i < NS_ARRAY_LENGTH(libNames) && !lib; ++i) { char *libName = PR_GetLibraryName(NULL, libNames[i]); if (libName) { lib = PR_LoadLibrary(libName); PR_FreeLibraryName(libName); if (lib && PR_FindFunctionSymbol(lib, "internal_krb5_gss_initialize") && @@ -208,20 +204,20 @@ gssInit() if (!lib) { LOG(("Fail to load gssapi library\n")); return NS_ERROR_FAILURE; } LOG(("Attempting to load gss functions\n")); - for (size_t i = 0; i < ArrayLength(gssFuncs); ++i) { - gssFuncs[i].func = PR_FindFunctionSymbol(lib, gssFuncs[i].str); - if (!gssFuncs[i].func) { - LOG(("Fail to load %s function from gssapi library\n", gssFuncs[i].str)); + for (size_t i = 0; i < gssFuncItems; ++i) { + gssFunPtr[i] = PR_FindFunctionSymbol(lib, gssFuncStr[i]); + if (!gssFunPtr[i]) { + LOG(("Fail to load %s function from gssapi library\n", gssFuncStr[i])); PR_UnloadLibrary(lib); return NS_ERROR_FAILURE; } } #ifdef XP_MACOSX if (gssNativeImp && !(KLCacheHasValidTicketsPtr = PR_FindFunctionSymbol(lib, "KLCacheHasValidTickets"))) {
--- a/extensions/permissions/nsContentBlocker.cpp +++ b/extensions/permissions/nsContentBlocker.cpp @@ -28,17 +28,16 @@ * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - #include "nsContentBlocker.h" #include "nsIDocument.h" #include "nsIContent.h" #include "nsIURI.h" #include "nsIServiceManager.h" #include "nsIDocShellTreeItem.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h"
--- a/gfx/layers/d3d10/ThebesLayerD3D10.cpp +++ b/gfx/layers/d3d10/ThebesLayerD3D10.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "mozilla/layers/PLayers.h" #include "ThebesLayerD3D10.h" #include "gfxPlatform.h" #include "gfxWindowsPlatform.h" #ifdef CAIRO_HAS_D2D_SURFACE #include "gfxD2DSurface.h" #endif @@ -361,17 +359,17 @@ ThebesLayerD3D10::DrawRegion(nsIntRegion } nsRefPtr<gfxASurface> destinationSurface; if (aMode == SURFACE_COMPONENT_ALPHA) { FillSurface(mD2DSurface, aRegion, visibleRect.TopLeft(), gfxRGBA(0.0, 0.0, 0.0, 1.0)); FillSurface(mD2DSurfaceOnWhite, aRegion, visibleRect.TopLeft(), gfxRGBA(1.0, 1.0, 1.0, 1.0)); gfxASurface* surfaces[2] = { mD2DSurface.get(), mD2DSurfaceOnWhite.get() }; - destinationSurface = new gfxTeeSurface(surfaces, ArrayLength(surfaces)); + destinationSurface = new gfxTeeSurface(surfaces, NS_ARRAY_LENGTH(surfaces)); // Using this surface as a source will likely go horribly wrong, since // only the onBlack surface will really be used, so alpha information will // be incorrect. destinationSurface->SetAllowUseAsSource(PR_FALSE); } else { destinationSurface = mD2DSurface; }
--- a/gfx/layers/d3d9/ThebesLayerD3D9.cpp +++ b/gfx/layers/d3d9/ThebesLayerD3D9.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "mozilla/layers/PLayers.h" #include "mozilla/layers/ShadowLayers.h" #include "ShadowBufferD3D9.h" #include "ThebesLayerD3D9.h" #include "gfxPlatform.h" #include "gfxWindowsPlatform.h" @@ -472,17 +470,17 @@ ThebesLayerD3D9::DrawRegion(nsIntRegion case SURFACE_COMPONENT_ALPHA: { nsRefPtr<gfxWindowsSurface> onBlack = opaqueRenderer.Begin(this); nsRefPtr<gfxWindowsSurface> onWhite = opaqueRendererOnWhite.Begin(this); if (onBlack && onWhite) { FillSurface(onBlack, aRegion, bounds.TopLeft(), gfxRGBA(0.0, 0.0, 0.0, 1.0)); FillSurface(onWhite, aRegion, bounds.TopLeft(), gfxRGBA(1.0, 1.0, 1.0, 1.0)); gfxASurface* surfaces[2] = { onBlack.get(), onWhite.get() }; - destinationSurface = new gfxTeeSurface(surfaces, ArrayLength(surfaces)); + destinationSurface = new gfxTeeSurface(surfaces, NS_ARRAY_LENGTH(surfaces)); // Using this surface as a source will likely go horribly wrong, since // only the onBlack surface will really be used, so alpha information will // be incorrect. destinationSurface->SetAllowUseAsSource(PR_FALSE); } break; } }
--- a/gfx/layers/opengl/LayerManagerOGL.cpp +++ b/gfx/layers/opengl/LayerManagerOGL.cpp @@ -32,18 +32,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "mozilla/layers/PLayers.h" #include "LayerManagerOGL.h" #include "ThebesLayerOGL.h" #include "ContainerLayerOGL.h" #include "ImageLayerOGL.h" #include "ColorLayerOGL.h" #include "CanvasLayerOGL.h" @@ -255,17 +253,17 @@ LayerManagerOGL::Initialize(nsRefPtr<GLC LOCAL_GL_TEXTURE_2D, #ifndef USE_GLES2 LOCAL_GL_TEXTURE_RECTANGLE_ARB #endif }; mFBOTextureTarget = LOCAL_GL_NONE; - for (PRUint32 i = 0; i < ArrayLength(textureTargets); i++) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(textureTargets); i++) { GLenum target = textureTargets[i]; mGLContext->fGenTextures(1, &mBackBufferTexture); mGLContext->fBindTexture(target, mBackBufferTexture); mGLContext->fTexParameteri(target, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_NEAREST); mGLContext->fTexParameteri(target, LOCAL_GL_TEXTURE_MAG_FILTER, @@ -1084,17 +1082,17 @@ LayerManagerOGL::ProgramType LayerManage gl::ColorLayerProgramType, gl::YCbCrLayerProgramType, gl::ComponentAlphaPass1ProgramType, gl::ComponentAlphaPass2ProgramType }; #define FOR_EACH_LAYER_PROGRAM(vname) \ for (size_t lpindex = 0; \ - lpindex < ArrayLength(sLayerProgramTypes); \ + lpindex < NS_ARRAY_LENGTH(sLayerProgramTypes); \ ++lpindex) \ { \ LayerProgram *vname = static_cast<LayerProgram*> \ (mPrograms[sLayerProgramTypes[lpindex]]); \ do #define FOR_EACH_LAYER_PROGRAM_END \ while (0); \
--- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -31,18 +31,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "mozilla/layers/PLayers.h" #include "mozilla/layers/ShadowLayers.h" #include "ThebesLayerBuffer.h" #include "ThebesLayerOGL.h" #include "gfxUtils.h" #include "gfxTeeSurface.h" @@ -630,17 +628,17 @@ BasicBufferOGL::BeginPaint(ContentType a nsIntRegion drawRegionCopy = result.mRegionToDraw; gfxASurface *onBlack = mTexImage->BeginUpdate(drawRegionCopy); gfxASurface *onWhite = mTexImageOnWhite->BeginUpdate(result.mRegionToDraw); NS_ASSERTION(result.mRegionToDraw == drawRegionCopy, "BeginUpdate should always modify the draw region in the same way!"); FillSurface(onBlack, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(0.0, 0.0, 0.0, 1.0)); FillSurface(onWhite, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(1.0, 1.0, 1.0, 1.0)); gfxASurface* surfaces[2] = { onBlack, onWhite }; - nsRefPtr<gfxTeeSurface> surf = new gfxTeeSurface(surfaces, ArrayLength(surfaces)); + nsRefPtr<gfxTeeSurface> surf = new gfxTeeSurface(surfaces, NS_ARRAY_LENGTH(surfaces)); // XXX If the device offset is set on the individual surfaces instead of on // the tee surface, we render in the wrong place. Why? gfxPoint deviceOffset = onBlack->GetDeviceOffset(); onBlack->SetDeviceOffset(gfxPoint(0, 0)); onWhite->SetDeviceOffset(gfxPoint(0, 0)); surf->SetDeviceOffset(deviceOffset);
--- a/gfx/src/nsColor.cpp +++ b/gfx/src/nsColor.cpp @@ -30,47 +30,43 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "plstr.h" #include "nsColor.h" #include "nsColorNames.h" #include "nsString.h" #include "nscore.h" #include "nsCoord.h" #include "nsCOMPtr.h" #include "nsIServiceManager.h" #include <math.h> #include "prprf.h" #include "nsStaticNameTable.h" -using namespace mozilla; - // define an array of all color names #define GFX_COLOR(_name, _value) #_name, static const char* const kColorNames[] = { #include "nsColorNameList.h" }; #undef GFX_COLOR // define an array of all color name values #define GFX_COLOR(_name, _value) _value, static const nscolor kColors[] = { #include "nsColorNameList.h" }; #undef GFX_COLOR -#define eColorName_COUNT (ArrayLength(kColorNames)) +#define eColorName_COUNT (NS_ARRAY_LENGTH(kColorNames)) #define eColorName_UNKNOWN (-1) static nsStaticCaseInsensitiveNameTable* gColorTable = nsnull; void nsColorNames::AddRefTable(void) { NS_ASSERTION(!gColorTable, "pre existing array!"); if (!gColorTable) {
--- a/gfx/tests/TestColorNames.cpp +++ b/gfx/tests/TestColorNames.cpp @@ -74,17 +74,17 @@ int main(int argc, char** argv) nscolor rgb; int rv = 0; // First make sure we can find all of the tags that are supposed to // be in the table. Futz with the case to make sure any case will // work - for (PRUint32 index = 0 ; index < ArrayLength(kColorNames); index++) { + for (PRUint32 index = 0 ; index < NS_ARRAY_LENGTH(kColorNames); index++) { // Lookup color by name and make sure it has the right id nsCString tagName(kColorNames[index]); // Check that color lookup by name gets the right rgb value if (!NS_ColorNameToRGB(NS_ConvertASCIItoUTF16(tagName), &rgb)) { fail("can't find '%s'", tagName.get()); rv = 1; } @@ -124,17 +124,17 @@ int main(int argc, char** argv) } if (hexrgb != rgb) { fail("rgb=%x hexrgb=%x", rgb, hexrgb); rv = 1; } } // Now make sure we don't find some garbage - for (PRUint32 i = 0; i < ArrayLength(kJunkNames); i++) { + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kJunkNames); i++) { nsCString tag(kJunkNames[i]); if (NS_ColorNameToRGB(NS_ConvertASCIItoUTF16(tag), &rgb)) { fail("found '%s'", kJunkNames[i] ? kJunkNames[i] : "(null)"); rv = 1; } } if (rv == 0)
--- a/gfx/tests/gfxTextRunPerfTest.cpp +++ b/gfx/tests/gfxTextRunPerfTest.cpp @@ -30,18 +30,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #include "nsCOMPtr.h" #include "nsTArray.h" #include "nsString.h" #include "nsDependentString.h" #include "prinrval.h" #include "gfxContext.h" @@ -53,18 +51,16 @@ #if defined(XP_MACOSX) #include "gfxTestCocoaHelper.h" #endif #ifdef MOZ_WIDGET_GTK2 #include "gtk/gtk.h" #endif -using namespace mozilla; - struct TestEntry { const char* mFamilies; const char* mString; }; TestEntry testList[] = { #include "per-word-runs.h" { nsnull, nsnull } // terminator @@ -160,17 +156,17 @@ main (int argc, char **argv) { nsRefPtr<gfxContext> context = MakeContext(); // Start timing PRIntervalTime start = PR_IntervalNow(); for (PRUint32 i = 0; i < iterations; ++i) { for (uint test = 0; - test < ArrayLength(testList) - 1; + test < NS_ARRAY_LENGTH(testList) - 1; test++) { RunTest(&testList[test], context); } } PRIntervalTime end = PR_IntervalNow();
--- a/gfx/thebes/GLContextProviderEGL.cpp +++ b/gfx/thebes/GLContextProviderEGL.cpp @@ -34,18 +34,16 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" - #if defined(XP_UNIX) #ifdef MOZ_WIDGET_GTK2 #include <gdk/gdkx.h> // we're using default display for now #define GET_NATIVE_WINDOW(aWidget) (EGLNativeWindowType)GDK_WINDOW_XID((GdkWindow *) aWidget->GetNativeData(NS_NATIVE_WINDOW)) #elif defined(MOZ_WIDGET_QT) #include <QtOpenGL/QGLContext> @@ -1804,19 +1802,19 @@ CreateConfig(EGLConfig* aConfig) // Prefer r5g6b5 for potential savings in memory bandwidth. // This needs to be reevaluated for newer devices. { gfxASurface::ImageFormatRGB16_565, kEGLConfigAttribsRGB16 }, #endif { gfxASurface::ImageFormatARGB32, kEGLConfigAttribsRGBA32 }, }; EGLConfig configs[64]; - for (unsigned i = 0; i < ArrayLength(attribsToTry); ++i) { + for (unsigned i = 0; i < NS_ARRAY_LENGTH(attribsToTry); ++i) { const EGLAttribs& attribs = attribsToTry[i]; - EGLint ncfg = ArrayLength(configs); + EGLint ncfg = NS_ARRAY_LENGTH(configs); if (!sEGLLibrary.fChooseConfig(EGL_DISPLAY(), attribs.mAttribs, configs, ncfg, &ncfg) || ncfg < 1) { continue; }
--- a/gfx/thebes/gfxAtoms.cpp +++ b/gfx/thebes/gfxAtoms.cpp @@ -29,34 +29,30 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "mozilla/Util.h" -