Merge mozilla-central and mozilla-inbound

This commit is contained in:
Ehsan Akhgari 2011-10-16 13:28:35 -04:00
commit 54751fa6b5
304 changed files with 1965 additions and 887 deletions

View File

@ -38,6 +38,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsAccessible.h"
#include "nsAccessibleWrap.h"
@ -69,6 +71,7 @@
#include "nsMaiInterfaceDocument.h"
#include "nsMaiInterfaceImage.h"
using namespace mozilla;
using namespace mozilla::a11y;
nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals =
@ -522,7 +525,7 @@ GetMaiAtkType(PRUint16 interfacesBits)
atkTypeName,
&tinfo, GTypeFlags(0));
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(atk_if_infos); index++) {
for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
if (interfacesBits & (1 << index)) {
g_type_add_interface_static(type,
GetAtkTypeForMai((MaiInterfaceType)index),
@ -963,7 +966,7 @@ refRelationSetCB(AtkObject *aAtkObj)
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(relationTypes); i++) {
for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
AtkRelation* atkRelation =
atk_relation_set_get_relation_by_type(relation_set, atkType);

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
// NOTE: alphabetically ordered
#include "nsAccessibilityService.h"
#include "nsCoreUtils.h"
@ -111,6 +113,7 @@
#include "mozilla/FunctionTimer.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
@ -654,7 +657,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
NS_IMETHODIMP
nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
{
if ( aRole >= NS_ARRAY_LENGTH(kRoleNames)) {
if ( aRole >= ArrayLength(kRoleNames)) {
aString.AssignLiteral("unknown");
return NS_OK;
}
@ -785,10 +788,10 @@ NS_IMETHODIMP
nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
nsAString& aString)
{
NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == NS_ARRAY_LENGTH(kEventTypeNames),
NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
"nsIAccessibleEvent constants are out of sync to kEventTypeNames");
if (aEventType >= NS_ARRAY_LENGTH(kEventTypeNames)) {
if (aEventType >= ArrayLength(kEventTypeNames)) {
aString.AssignLiteral("unknown");
return NS_OK;
}
@ -802,7 +805,7 @@ NS_IMETHODIMP
nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType,
nsAString& aString)
{
if (aRelationType >= NS_ARRAY_LENGTH(kRelationTypeNames)) {
if (aRelationType >= ArrayLength(kRelationTypeNames)) {
aString.AssignLiteral("unknown");
return NS_OK;
}

View File

@ -226,6 +226,10 @@ nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
printf("\nSelection changed, selection type: %s, notification %s\n",
(isNormalSelection ? "normal" : "spellcheck"),
(isIgnored ? "ignored" : "pending"));
} else {
bool isIgnored = !document || !document->IsContentLoaded();
printf("\nSelection changed, selection type: unknown, notification %s\n",
(isIgnored ? "ignored" : "pending"));
}
#endif

View File

@ -77,7 +77,7 @@
#include "nsIXULDocument.h"
#endif
namespace dom = mozilla::dom;
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#define CreateEvent CreateEventA
#include "nsIDOMDocument.h"
@ -83,7 +85,7 @@
#include "nsIXULWindow.h"
#endif
namespace dom = mozilla::dom;
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
@ -255,7 +257,7 @@ nsresult nsRootAccessible::AddEventListeners()
if (nstarget) {
for (const char* const* e = docEvents,
* const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
* const* e_end = ArrayEnd(docEvents);
e < e_end; ++e) {
nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e),
this, PR_TRUE, PR_TRUE, 2);
@ -275,7 +277,7 @@ nsresult nsRootAccessible::RemoveEventListeners()
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mDocument));
if (target) {
for (const char* const* e = docEvents,
* const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
* const* e_end = ArrayEnd(docEvents);
e < e_end; ++e) {
nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -46,6 +46,7 @@
#include "nsIClipboard.h"
#include "nsContentCID.h"
#include "nsFocusManager.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMDocument.h"
#include "nsIDOMRange.h"
@ -1595,11 +1596,20 @@ nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
domSel->RemoveRange(range);
}
// XXX I'm not sure this can do synchronous scrolling. If the last param is
// set to true, this calling might flush the pending reflow. See bug 418470.
return frameSelection->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
nsISelectionController::SELECTION_FOCUS_REGION,
0);
// Now that selection is done, move the focus to the selection.
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
if (DOMFocusManager) {
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = doc->GetWindow();
nsCOMPtr<nsIDOMElement> result;
DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
}
return NS_OK;
}
NS_IMETHODIMP

View File

@ -34,9 +34,11 @@
/**
* Invokers.
*/
function setCaretOffsetInvoker(aID, aOffset)
function setCaretOffsetInvoker(aID, aOffset, aFocusableContainerID)
{
this.target = getAccessible(aID, [nsIAccessibleText]);
this.focus = aFocusableContainerID ?
getAccessible(aFocusableContainerID) : this.target;
this.invoke = function setCaretOffsetInvoker_invoke()
{
@ -45,29 +47,47 @@
this.getID = function setCaretOffsetInvoker_getID()
{
return "nsIAccessibleText::caretOffset test";
return "Set caretOffset on " + prettyName(aID) + " at " + aOffset;
}
this.eventSeq = [
new invokerChecker(EVENT_FOCUS, this.target),
new caretMovedChecker(this.target, aOffset)
new caretMovedChecker(this.target, aOffset),
new asyncInvokerChecker(EVENT_FOCUS, this.focus)
];
}
/**
* Turn on/off the caret browsing mode.
*/
function turnCaretBrowsing(aIsOn)
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
}
/**
* Do tests.
*/
var gQueue = null;
// gA11yEventDumpID = "eventdump"; // debug stuff
//gA11yEventDumpID = "eventdump"; // debug stuff
//gA11yEventDumpToConsole = true;
function doTests()
{
turnCaretBrowsing(true);
// test caret move events and caret offsets
gQueue = new eventQueue();
gQueue.push(new setCaretOffsetInvoker("textbox", 1));
gQueue.push(new setCaretOffsetInvoker("link", 1));
gQueue.push(new setCaretOffsetInvoker("heading", 1, document));
gQueue.onFinish = function()
{
turnCaretBrowsing(false);
}
gQueue.invoke(); // Will call SimpleTest.finish();
}
@ -84,6 +104,11 @@
title="HyperText accessible should get focus when the caret is positioned inside of it, text is changed or copied into clipboard by ATs">
Mozilla Bug 524115
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=546068"
title="Position is not being updated when atk_text_set_caret_offset is used">
Mozilla Bug 546068
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -91,6 +116,7 @@
<input id="textbox" value="hello"/>
<a id="link" href="about:">about mozilla</a>
<h5 id="heading">heading</h5>
<div id="eventdump"></div>
</body>

View File

@ -39,6 +39,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include <stdio.h>
#include <string.h>
#include <windows.h>
@ -109,6 +111,8 @@
#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;
@ -1673,7 +1677,7 @@ nsIEProfileMigrator::CopyPreferences(bool aReplace)
{
bool regKeyOpen = false;
const regEntry *entry,
*endEntry = gRegEntries + NS_ARRAY_LENGTH(gRegEntries);
*endEntry = ArrayEnd(gRegEntries);
nsCOMPtr<nsIPrefBranch> prefs;
@ -2168,7 +2172,7 @@ nsIEProfileMigrator::CopyProxyPreferences(nsIPrefBranch* aPrefs)
PRInt32 startIndex = 0, count = 0;
bool foundSpecificProxy = false;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(data); ++i) {
for (PRUint32 i = 0; i < ArrayLength(data); ++i) {
PRInt32 offset = buf.Find(NS_ConvertASCIItoUTF16(data[i].prefix));
if (offset >= 0) {
foundSpecificProxy = PR_TRUE;
@ -2191,7 +2195,7 @@ nsIEProfileMigrator::CopyProxyPreferences(nsIPrefBranch* aPrefs)
// 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 < NS_ARRAY_LENGTH(data); ++i)
for (PRUint32 i = 0; i < ArrayLength(data); ++i)
SetProxyPref(buf, data[i].hostPref, data[i].portPref, aPrefs);
aPrefs->SetBoolPref("network.proxy.share_proxy_settings", PR_TRUE);
}

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsBrowserProfileMigratorUtils.h"
#include "nsDirectoryServiceDefs.h"
@ -68,6 +70,8 @@
#include <windows.h>
#endif
using namespace mozilla;
#define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties"
#ifdef XP_WIN
@ -482,7 +486,7 @@ nsOperaProfileMigrator::CopyProxySettings(nsINIParser &aParser,
char toggleBuf[15], serverBuf[20], serverPrefBuf[20],
serverPortPrefBuf[25];
PRInt32 enabled;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(protocols); ++i) {
for (PRUint32 i = 0; i < ArrayLength(protocols); ++i) {
sprintf(toggleBuf, "Use %s", protocols[i]);
GetInteger(aParser, "Proxy", toggleBuf, &enabled);
if (enabled) {

View File

@ -630,7 +630,7 @@ let AboutPermissions = {
let filterValue = document.getElementById("sites-filter").value.toLowerCase();
item.collapsed = aSite.host.toLowerCase().indexOf(filterValue) == -1;
this.sitesList.appendChild(item);
(this._listFragment || this.sitesList).appendChild(item);
},
startSitesListBatch: function () {

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsCOMPtr.h"
#include "nsGNOMEShellService.h"
#include "nsShellService.h"
@ -68,6 +70,8 @@
#include <limits.h>
#include <stdlib.h>
using namespace mozilla;
struct ProtocolAssociation
{
const char *name;
@ -239,7 +243,7 @@ nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck,
nsCAutoString handler;
nsCOMPtr<nsIGIOMimeApp> gioApp;
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
if (!appProtocols[i].essential)
continue;
@ -295,7 +299,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
appKeyValue.AppendLiteral(" %s");
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
if (appProtocols[i].essential || aClaimAllTypes) {
gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
appKeyValue);
@ -328,7 +332,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
NS_ENSURE_SUCCESS(rv, rv);
// set handler for the protocols
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
if (appProtocols[i].essential || aClaimAllTypes) {
appInfo->SetAsDefaultForURIScheme(nsDependentCString(appProtocols[i].name));
}
@ -337,7 +341,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
// 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 < NS_ARRAY_LENGTH(appTypes); ++i) {
for (unsigned int i = 0; i < ArrayLength(appTypes); ++i) {
appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
}

View File

@ -54,6 +54,9 @@
%filter substitution
%define toolbarHighlight rgba(255,255,255,.3)
%define selectedTabHighlight rgba(255,255,255,.8) 1px, rgba(255,255,255,.5) 3px
%define forwardTransitionLength 150ms
%define conditionalForwardWithUrlbar window:not([chromehidden~=toolbar]) :-moz-any(#nav-bar[currentset*="unified-back-forward-button,urlbar-container"][mode=icons], #nav-bar:not([currentset])[mode=icons]) > #unified-back-forward-button
%define conditionalForwardWithUrlbar_small window:not([chromehidden~=toolbar]) :-moz-any(#nav-bar[currentset*="unified-back-forward-button,urlbar-container"][mode=icons][iconsize=small],#nav-bar:not([currentset])[mode=icons][iconsize=small]) > #unified-back-forward-button
#menubar-items {
-moz-box-orient: vertical; /* for flex hack */
@ -602,36 +605,41 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
}
#forward-button {
#forward-button,
@conditionalForwardWithUrlbar@ > #forward-button {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar");
-moz-transition: 250ms ease-out;
}
#forward-button:-moz-locale-dir(rtl) {
#forward-button:-moz-locale-dir(rtl),
@conditionalForwardWithUrlbar@ > #forward-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
}
toolbar:not([mode=icons]) #forward-button[disabled="true"] {
#forward-button[disabled] {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
}
toolbar:not([mode=icons]) #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
#forward-button[disabled]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
}
toolbar[mode=icons] #forward-button[disabled="true"] {
@conditionalForwardWithUrlbar@:not([switchingtabs]) > #forward-button {
-moz-transition: @forwardTransitionLength@ ease-out;
}
@conditionalForwardWithUrlbar@ > #forward-button[disabled] {
-moz-transform: scale(0);
opacity: 0;
pointer-events: none;
}
toolbar[mode=icons] #forward-button[disabled="true"]:-moz-locale-dir(ltr) {
@conditionalForwardWithUrlbar@ > #forward-button[disabled]:-moz-locale-dir(ltr) {
margin-left: -36px;
}
toolbar[mode=icons] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
@conditionalForwardWithUrlbar@ > #forward-button[disabled]:-moz-locale-dir(rtl) {
margin-right: -36px;
}
toolbar[mode=icons][iconsize=small] #forward-button[disabled="true"]:-moz-locale-dir(ltr) {
@conditionalForwardWithUrlbar_small@ > #forward-button[disabled]:-moz-locale-dir(ltr) {
margin-left: -28px;
}
toolbar[mode=icons][iconsize=small] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
@conditionalForwardWithUrlbar_small@ > #forward-button[disabled]:-moz-locale-dir(rtl) {
margin-right: -28px;
}
@ -800,23 +808,25 @@ toolbar[iconsize="small"] #back-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
}
toolbar[iconsize="small"] #forward-button {
toolbar[iconsize=small] #forward-button,
@conditionalForwardWithUrlbar_small@ > #forward-button {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu");
}
.unified-nav-forward[_moz-menuactive] {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu") !important;
}
toolbar[iconsize="small"]:not([mode=icons]) #forward-button[disabled="true"] {
toolbar[iconsize=small] #forward-button[disabled] {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
}
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
toolbar[iconsize=small] #forward-button:-moz-locale-dir(rtl),
@conditionalForwardWithUrlbar_small@ > #forward-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
}
.unified-nav-forward[_moz-menuactive]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu") !important;
}
toolbar[iconsize="small"]:not([mode=icons]) #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
toolbar[iconsize=small] #forward-button[disabled]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
}

View File

@ -42,6 +42,8 @@
* same-origin with anything but themselves.
*/
#include "mozilla/Util.h"
#include "nsNullPrincipal.h"
#include "nsNullPrincipalURI.h"
#include "nsMemory.h"
@ -53,6 +55,8 @@
#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,
@ -111,7 +115,7 @@ nsNullPrincipal::Init()
id.ToProvidedString(chars);
PRUint32 suffixLen = NSID_LENGTH - 1;
PRUint32 prefixLen = NS_ARRAY_LENGTH(NS_NULLPRINCIPAL_PREFIX) - 1;
PRUint32 prefixLen = ArrayLength(NS_NULLPRINCIPAL_PREFIX) - 1;
// Use an nsCString so we only do the allocation once here and then share
// with nsJSPrincipals

View File

@ -40,6 +40,9 @@
* 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"
@ -944,7 +947,7 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
objectDomainUnicode.get()
};
PRUint32 length = NS_ARRAY_LENGTH(formatStrings);
PRUint32 length = ArrayLength(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
@ -966,7 +969,7 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
if (!objectDomainUnicode.IsEmpty()) {
stringName.AppendLiteral("ObjectDomain");
length += 1;
if (length != NS_ARRAY_LENGTH(formatStrings)) {
if (length != ArrayLength(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.
@ -1588,7 +1591,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
rv = sStrBundle->
FormatStringFromName(NS_LITERAL_STRING("ProtocolFlagError").get(),
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
ArrayLength(formatStrings),
getter_Copies(message));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIConsoleService> console(
@ -1629,7 +1632,7 @@ nsScriptSecurityManager::ReportError(JSContext* cx, const nsAString& messageTag,
const PRUnichar *formatStrings[] = { ucsSourceSpec.get(), ucsTargetSpec.get() };
rv = sStrBundle->FormatStringFromName(PromiseFlatString(messageTag).get(),
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
ArrayLength(formatStrings),
getter_Copies(message));
NS_ENSURE_SUCCESS(rv, rv);
@ -1708,7 +1711,7 @@ nsScriptSecurityManager::CheckLoadURIStrWithPrincipal(nsIPrincipal* aPrincipal,
nsIURIFixup::FIXUP_FLAGS_MAKE_ALTERNATE_URI
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(flags); ++i) {
for (PRUint32 i = 0; i < ArrayLength(flags); ++i) {
rv = fixup->CreateFixupURI(aTargetURIStr, flags[i],
getter_AddRefs(target));
NS_ENSURE_SUCCESS(rv, rv);
@ -2681,7 +2684,7 @@ nsScriptSecurityManager::FormatCapabilityString(nsAString& aCapability)
rv = sStrBundle->FormatStringFromName(
NS_LITERAL_STRING("ExtensionCapability").get(),
formatArgs,
NS_ARRAY_LENGTH(formatArgs),
ArrayLength(formatArgs),
getter_Copies(extensionCap));
if (NS_SUCCEEDED(rv))
newcaps += extensionCap;
@ -2770,7 +2773,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
nsXPIDLString message;
rv = sStrBundle->FormatStringFromName(NS_LITERAL_STRING("EnableCapabilityQuery").get(),
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
ArrayLength(formatStrings),
getter_Copies(message));
if (NS_FAILED(rv))
return PR_FALSE;
@ -2893,7 +2896,7 @@ nsScriptSecurityManager::EnableCapability(const char *capability)
nsXPIDLString message;
rv = sStrBundle->FormatStringFromName(NS_LITERAL_STRING("EnableCapabilityDenied").get(),
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
ArrayLength(formatStrings),
getter_Copies(message));
if (NS_FAILED(rv))
return rv;
@ -3059,7 +3062,7 @@ nsScriptSecurityManager::CanCreateWrapper(JSContext *cx,
className.get(),
originUnicode.get()
};
PRUint32 length = NS_ARRAY_LENGTH(formatStrings);
PRUint32 length = ArrayLength(formatStrings);
if (originUnicode.IsEmpty()) {
--length;
} else {
@ -3853,7 +3856,7 @@ nsScriptSecurityManager::InitPrincipals(PRUint32 aPrefCount, const char** aPrefN
for (PRUint32 c = 0; c < aPrefCount; c++)
{
PRInt32 prefNameLen = PL_strlen(aPrefNames[c]) -
(NS_ARRAY_LENGTH(idSuffix) - 1);
(ArrayLength(idSuffix) - 1);
if (PL_strcasecmp(aPrefNames[c] + prefNameLen, idSuffix) != 0)
continue;

View File

@ -41,6 +41,8 @@
/* A namespace class for static layout utilities. */
#include "mozilla/Util.h"
#include "jsapi.h"
#include "jsdbgapi.h"
@ -535,8 +537,8 @@ nsContentUtils::InitializeEventTable() {
sUserDefinedEvents = new nsCOMArray<nsIAtom>(64);
if (!sAtomEventTable || !sStringEventTable || !sUserDefinedEvents ||
!sAtomEventTable->Init(int(NS_ARRAY_LENGTH(eventArray) / 0.75) + 1) ||
!sStringEventTable->Init(int(NS_ARRAY_LENGTH(eventArray) / 0.75) + 1)) {
!sAtomEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1) ||
!sStringEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1)) {
delete sAtomEventTable;
sAtomEventTable = nsnull;
delete sStringEventTable;
@ -547,7 +549,7 @@ nsContentUtils::InitializeEventTable() {
}
// Subtract one from the length because of the trailing null
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(eventArray) - 1; ++i) {
for (PRUint32 i = 0; i < ArrayLength(eventArray) - 1; ++i) {
if (!sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]) ||
!sStringEventTable->Put(Substring(nsDependentAtomString(eventArray[i].mAtom), 2),
eventArray[i])) {
@ -578,7 +580,7 @@ nsContentUtils::InitializeTouchEventTable()
nsnull
};
// Subtract one from the length because of the trailing null
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(touchEventArray) - 1; ++i) {
for (PRUint32 i = 0; i < ArrayLength(touchEventArray) - 1; ++i) {
if (!sAtomEventTable->Put(touchEventArray[i].mAtom, touchEventArray[i]) ||
!sStringEventTable->Put(Substring(nsDependentAtomString(touchEventArray[i].mAtom), 2),
touchEventArray[i])) {
@ -4158,7 +4160,7 @@ nsContentUtils::GetLocalizedEllipsis()
if (!sBuf[0]) {
nsAdoptingString tmp = Preferences::GetLocalizedString("intl.ellipsis");
PRUint32 len = NS_MIN(PRUint32(tmp.Length()),
PRUint32(NS_ARRAY_LENGTH(sBuf) - 1));
PRUint32(ArrayLength(sBuf) - 1));
CopyUnicodeTo(tmp, 0, sBuf, len);
if (!sBuf[0])
sBuf[0] = PRUnichar(0x2026);
@ -5159,7 +5161,7 @@ nsContentUtils::CanAccessNativeAnon()
const char *filename;
if (fp && JS_IsScriptFrame(cx, fp) &&
(filename = JS_GetScriptFilename(cx, JS_GetFrameScript(cx, fp))) &&
!strncmp(filename, prefix, NS_ARRAY_LENGTH(prefix) - 1)) {
!strncmp(filename, prefix, ArrayLength(prefix) - 1)) {
return PR_TRUE;
}
@ -5677,7 +5679,7 @@ nsContentUtils::FindInternalContentViewer(const char* aType,
#ifdef MOZ_MEDIA
#ifdef MOZ_OGG
if (nsHTMLMediaElement::IsOggEnabled()) {
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(nsHTMLMediaElement::gOggTypes); ++i) {
for (unsigned int i = 0; i < ArrayLength(nsHTMLMediaElement::gOggTypes); ++i) {
const char* type = nsHTMLMediaElement::gOggTypes[i];
if (!strcmp(aType, type)) {
docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1");
@ -5692,7 +5694,7 @@ nsContentUtils::FindInternalContentViewer(const char* aType,
#ifdef MOZ_WEBM
if (nsHTMLMediaElement::IsWebMEnabled()) {
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(nsHTMLMediaElement::gWebMTypes); ++i) {
for (unsigned int i = 0; i < ArrayLength(nsHTMLMediaElement::gWebMTypes); ++i) {
const char* type = nsHTMLMediaElement::gWebMTypes[i];
if (!strcmp(aType, type)) {
docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1");

View File

@ -47,6 +47,8 @@
* 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
@ -1799,7 +1801,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
nsCAutoString uri;
if (tmp->mDocumentURI)
tmp->mDocumentURI->GetSpec(uri);
if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
if (nsid < ArrayLength(kNSURIs)) {
PR_snprintf(name, sizeof(name), "nsDocument%s %s", kNSURIs[nsid],
uri.get());
}

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsEventSource.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
@ -1096,11 +1098,11 @@ nsEventSource::ConsoleError()
if (mReadyState == nsIEventSource::CONNECTING) {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(),
formatStrings, NS_ARRAY_LENGTH(formatStrings));
formatStrings, ArrayLength(formatStrings));
} else {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("netInterrupt").get(),
formatStrings, NS_ARRAY_LENGTH(formatStrings));
formatStrings, ArrayLength(formatStrings));
}
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -43,6 +43,8 @@
* utility methods for subclasses, and so forth.
*/
#include "mozilla/Util.h"
#include "nsGenericElement.h"
#include "nsDOMAttribute.h"
@ -151,8 +153,8 @@
#include "xpcpublic.h"
using namespace mozilla;
using namespace mozilla::dom;
namespace css = mozilla::css;
NS_DEFINE_IID(kThisPtrOffsetsSID, NS_THISPTROFFSETS_SID);
@ -4323,7 +4325,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
char name[72];
PRUint32 nsid = tmp->GetNameSpaceID();
nsAtomCString localName(tmp->NodeInfo()->NameAtom());
if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
if (nsid < ArrayLength(kNSURIs)) {
PR_snprintf(name, sizeof(name), "nsGenericElement%s %s", kNSURIs[nsid],
localName.get());
}

View File

@ -41,9 +41,13 @@
* 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"
@ -61,6 +65,6 @@ static const nsStaticAtom GkAtoms_info[] = {
void nsGkAtoms::AddRefAtoms()
{
NS_RegisterStaticAtoms(GkAtoms_info, NS_ARRAY_LENGTH(GkAtoms_info));
NS_RegisterStaticAtoms(GkAtoms_info, ArrayLength(GkAtoms_info));
}

View File

@ -41,6 +41,8 @@
* prefix, namespace, and localName.
*/
#include "mozilla/Util.h"
#include "nscore.h"
#include "nsNodeInfo.h"
#include "nsNodeInfoManager.h"
@ -58,6 +60,8 @@
#include "nsIDocument.h"
#include "nsGkAtoms.h"
using namespace mozilla;
static const size_t kNodeInfoPoolSizes[] = {
sizeof(nsNodeInfo)
};
@ -192,7 +196,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsNodeInfo)
char name[72];
PRUint32 nsid = tmp->NamespaceID();
nsAtomCString localName(tmp->NameAtom());
if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
if (nsid < ArrayLength(kNSURIs)) {
PR_snprintf(name, sizeof(name), "nsNodeInfo%s %s", kNSURIs[nsid],
localName.get());
}

View File

@ -38,6 +38,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsTreeSanitizer.h"
#include "nsCSSParser.h"
#include "nsCSSProperty.h"
@ -54,6 +56,8 @@
#include "nsNullPrincipal.h"
#include "nsContentUtils.h"
using namespace mozilla;
//
// Thanks to Mark Pilgrim and Sam Ruby for the initial whitelist
//
@ -1453,37 +1457,37 @@ nsTreeSanitizer::InitializeStatics()
NS_PRECONDITION(!sElementsHTML, "Initializing a second time.");
sElementsHTML = new nsTHashtable<nsISupportsHashKey> ();
sElementsHTML->Init(NS_ARRAY_LENGTH(kElementsHTML));
sElementsHTML->Init(ArrayLength(kElementsHTML));
for (PRUint32 i = 0; kElementsHTML[i]; i++) {
sElementsHTML->PutEntry(*kElementsHTML[i]);
}
sAttributesHTML = new nsTHashtable<nsISupportsHashKey> ();
sAttributesHTML->Init(NS_ARRAY_LENGTH(kAttributesHTML));
sAttributesHTML->Init(ArrayLength(kAttributesHTML));
for (PRUint32 i = 0; kAttributesHTML[i]; i++) {
sAttributesHTML->PutEntry(*kAttributesHTML[i]);
}
sElementsSVG = new nsTHashtable<nsISupportsHashKey> ();
sElementsSVG->Init(NS_ARRAY_LENGTH(kElementsSVG));
sElementsSVG->Init(ArrayLength(kElementsSVG));
for (PRUint32 i = 0; kElementsSVG[i]; i++) {
sElementsSVG->PutEntry(*kElementsSVG[i]);
}
sAttributesSVG = new nsTHashtable<nsISupportsHashKey> ();
sAttributesSVG->Init(NS_ARRAY_LENGTH(kAttributesSVG));
sAttributesSVG->Init(ArrayLength(kAttributesSVG));
for (PRUint32 i = 0; kAttributesSVG[i]; i++) {
sAttributesSVG->PutEntry(*kAttributesSVG[i]);
}
sElementsMathML = new nsTHashtable<nsISupportsHashKey> ();
sElementsMathML->Init(NS_ARRAY_LENGTH(kElementsMathML));
sElementsMathML->Init(ArrayLength(kElementsMathML));
for (PRUint32 i = 0; kElementsMathML[i]; i++) {
sElementsMathML->PutEntry(*kElementsMathML[i]);
}
sAttributesMathML = new nsTHashtable<nsISupportsHashKey> ();
sAttributesMathML->Init(NS_ARRAY_LENGTH(kAttributesMathML));
sAttributesMathML->Init(ArrayLength(kAttributesMathML));
for (PRUint32 i = 0; kAttributesMathML[i]; i++) {
sAttributesMathML->PutEntry(*kAttributesMathML[i]);
}

View File

@ -38,6 +38,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsWebSocket.h"
#include "nsIScriptGlobalObject.h"
@ -418,11 +420,11 @@ nsWebSocketEstablishedConnection::ConsoleError()
if (mStatus < CONN_CONNECTED_AND_READY) {
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(),
formatStrings, NS_ARRAY_LENGTH(formatStrings));
formatStrings, ArrayLength(formatStrings));
} else {
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("netInterrupt").get(),
formatStrings, NS_ARRAY_LENGTH(formatStrings));
formatStrings, ArrayLength(formatStrings));
}
}
/// todo some specific errors - like for message too large

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsXMLHttpRequest.h"
#include "nsISimpleEnumerator.h"
#include "nsIXPConnect.h"
@ -101,6 +103,8 @@
#include "nsDOMFile.h"
#include "nsIFileChannel.h"
using namespace mozilla;
#define LOAD_STR "load"
#define ERROR_STR "error"
#define ABORT_STR "abort"
@ -1270,7 +1274,7 @@ nsXMLHttpRequest::GetResponseHeader(const nsACString& header,
};
bool safeHeader = false;
PRUint32 i;
for (i = 0; i < NS_ARRAY_LENGTH(kCrossOriginSafeHeaders); ++i) {
for (i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) {
if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) {
safeHeader = PR_TRUE;
break;
@ -2649,7 +2653,7 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
"transfer-encoding", "upgrade", "user-agent", "via"
};
PRUint32 i;
for (i = 0; i < NS_ARRAY_LENGTH(kInvalidHeaders); ++i) {
for (i = 0; i < ArrayLength(kInvalidHeaders); ++i) {
if (header.LowerCaseEqualsASCII(kInvalidHeaders[i])) {
NS_WARNING("refusing to set request header");
return NS_OK;
@ -2671,7 +2675,7 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
"accept", "accept-language", "content-language", "content-type",
"last-event-id"
};
for (i = 0; i < NS_ARRAY_LENGTH(kCrossOriginSafeHeaders); ++i) {
for (i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) {
if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) {
safeHeader = true;
break;

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsDOMDataTransfer.h"
#include "prlog.h"
@ -54,6 +56,8 @@
#include "nsCRT.h"
#include "nsIScriptObjectPrincipal.h"
using namespace mozilla;
NS_IMPL_CYCLE_COLLECTION_2(nsDOMDataTransfer, mDragTarget, mDragImage)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMDataTransfer)
@ -178,7 +182,7 @@ nsDOMDataTransfer::SetEffectAllowed(const nsAString& aEffectAllowed)
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_MOVE == 2);
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_LINK == 4);
for (PRUint32 e = 0; e < NS_ARRAY_LENGTH(sEffects); e++) {
for (PRUint32 e = 0; e < ArrayLength(sEffects); e++) {
if (aEffectAllowed.EqualsASCII(sEffects[e])) {
mEffectAllowed = e;
break;
@ -860,7 +864,7 @@ nsDOMDataTransfer::CacheExternalFormats()
PRUint32 count;
dragSession->GetNumDropItems(&count);
for (PRUint32 c = 0; c < count; c++) {
for (PRUint32 f = 0; f < NS_ARRAY_LENGTH(formats); f++) {
for (PRUint32 f = 0; f < ArrayLength(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

View File

@ -38,6 +38,10 @@
* ***** END LICENSE BLOCK ***** */
#include "base/basictypes.h"
/* This must occur *after* base/basictypes.h to avoid typedefs conflicts. */
#include "mozilla/Util.h"
#include "IPC/IPCMessageUtils.h"
#include "nsCOMPtr.h"
#include "nsDOMEvent.h"
@ -442,7 +446,7 @@ ReportUseOfDeprecatedMethod(nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
const PRUnichar *strings[] = { type.get() };
nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
aWarning,
strings, NS_ARRAY_LENGTH(strings),
strings, ArrayLength(strings),
nsnull,
EmptyString(), 0, 0,
nsIScriptError::warningFlag,

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsFormSubmission.h"
#include "nsCOMPtr.h"
@ -71,6 +73,8 @@
#include "nsIFileStreams.h"
#include "nsContentUtils.h"
using namespace mozilla;
static void
SendJSWarning(nsIDocument* aDocument,
const char* aWarningName,
@ -267,7 +271,7 @@ HandleMailtoSubject(nsCString& aPath) {
nsContentUtils::eFORMS_PROPERTIES,
"DefaultFormSubject",
formatStrings,
NS_ARRAY_LENGTH(formatStrings),
ArrayLength(formatStrings),
subjectStr);
if (NS_FAILED(rv))
return;

View File

@ -37,6 +37,9 @@
* 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"
@ -1446,7 +1449,7 @@ nsGenericHTMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc
@ -2167,7 +2170,7 @@ nsGenericHTMLElement::MapScrollingAttributeInto(const nsMappedAttributes* aAttri
aData->ValueForOverflowX(),
aData->ValueForOverflowY(),
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(overflowValues); ++i) {
for (PRUint32 i = 0; i < ArrayLength(overflowValues); ++i) {
if (overflowValues[i]->GetUnit() == eCSSUnit_Null) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::scrolling);
if (value && value->Type() == nsAttrValue::eEnum) {

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
using namespace mozilla;
class nsHTMLBRElement : public nsGenericHTMLElement,
public nsIDOMHTMLBRElement
{
@ -157,7 +162,7 @@ nsHTMLBRElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -36,6 +36,9 @@
* 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"
@ -61,6 +64,8 @@
//----------------------------------------------------------------------
using namespace mozilla;
class nsHTMLBodyElement;
class BodyRule: public nsIStyleRule {
@ -468,7 +473,7 @@ nsHTMLBodyElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
already_AddRefed<nsIEditor>

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#include "nsMappedAttributes.h"
#include "nsDOMMemoryReporter.h"
using namespace mozilla;
class nsHTMLDivElement : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
{
@ -165,7 +170,7 @@ nsHTMLDivElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sDivAlignAttributeMap,
sCommonAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
if (mNodeInfo->Equals(nsGkAtoms::marquee)) {
static const MappedAttributeEntry* const map[] = {
@ -173,7 +178,7 @@ nsHTMLDivElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundColorAttributeMap,
sCommonAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
return nsGenericHTMLElement::IsAttributeMapped(aAttribute);

View File

@ -34,6 +34,9 @@
* 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"
@ -45,6 +48,8 @@
#include "nsRuleData.h"
#include "nsIDocument.h"
using namespace mozilla;
class nsHTMLFontElement : public nsGenericHTMLElement,
public nsIDOMHTMLFontElement
{
@ -276,7 +281,7 @@ nsHTMLFontElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -41,6 +44,7 @@
#include "nsIDOMDocument.h"
#include "nsDOMError.h"
using namespace mozilla;
using namespace mozilla::dom;
class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
@ -175,7 +179,7 @@ nsHTMLFrameElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLHRElement.h"
@ -46,6 +48,8 @@
#include "nsRuleData.h"
#include "nsCSSProps.h"
using namespace mozilla;
class nsHTMLHRElement : public nsGenericHTMLElement,
public nsIDOMHTMLHRElement
{
@ -330,7 +334,7 @@ nsHTMLHRElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -43,6 +46,8 @@
#include "nsRuleData.h"
#include "mozAutoDocUpdate.h"
using namespace mozilla;
class nsHTMLHeadingElement : public nsGenericHTMLElement,
public nsIDOMHTMLHeadingElement
{
@ -139,7 +144,7 @@ nsHTMLHeadingElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -46,6 +49,7 @@
#include "nsRuleData.h"
#include "nsStyleConsts.h"
using namespace mozilla;
using namespace mozilla::dom;
class nsHTMLIFrameElement : public nsGenericHTMLFrameElement
@ -258,7 +262,7 @@ nsHTMLIFrameElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -400,7 +403,7 @@ nsHTMLImageElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sImageAlignAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsHTMLInputElement.h"
#include "nsIDOMHTMLInputElement.h"
@ -2607,7 +2609,7 @@ nsHTMLInputElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sImageBorderAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
using namespace mozilla;
class nsHTMLLIElement : public nsGenericHTMLElement,
public nsIDOMHTMLLIElement
{
@ -178,7 +183,7 @@ nsHTMLLIElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsIDOMHTMLMediaElement.h"
#include "nsIDOMHTMLSourceElement.h"
#include "nsHTMLMediaElement.h"
@ -1536,7 +1538,7 @@ static bool IsRawType(const nsACString& aType)
{
if (!IsRawEnabled())
return false;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gRawTypes); ++i) {
for (PRUint32 i = 0; i < ArrayLength(gRawTypes); ++i) {
if (aType.EqualsASCII(gRawTypes[i]))
return true;
}
@ -1569,7 +1571,7 @@ nsHTMLMediaElement::IsOggType(const nsACString& aType)
{
if (!IsOggEnabled())
return false;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gOggTypes); ++i) {
for (PRUint32 i = 0; i < ArrayLength(gOggTypes); ++i) {
if (aType.EqualsASCII(gOggTypes[i]))
return true;
}
@ -1604,7 +1606,7 @@ nsHTMLMediaElement::IsWaveType(const nsACString& aType)
{
if (!IsWaveEnabled())
return false;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gWaveTypes); ++i) {
for (PRUint32 i = 0; i < ArrayLength(gWaveTypes); ++i) {
if (aType.EqualsASCII(gWaveTypes[i]))
return true;
}
@ -1636,7 +1638,7 @@ nsHTMLMediaElement::IsWebMType(const nsACString& aType)
{
if (!IsWebMEnabled())
return false;
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gWebMTypes); ++i) {
for (PRUint32 i = 0; i < ArrayLength(gWebMTypes); ++i) {
if (aType.EqualsASCII(gWebMTypes[i]))
return true;
}

View File

@ -34,6 +34,9 @@
* 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"
@ -44,6 +47,8 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
using namespace mozilla;
class nsHTMLSharedListElement : public nsGenericHTMLElement,
public nsIDOMHTMLOListElement,
public nsIDOMHTMLDListElement,
@ -230,7 +235,7 @@ nsHTMLSharedListElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
return nsGenericHTMLElement::IsAttributeMapped(aAttribute);

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsAutoPtr.h"
#include "nsGenericHTMLElement.h"
#include "nsObjectLoadingContent.h"
@ -51,6 +53,7 @@
#include "nsNPAPIPluginInstance.h"
#include "nsIConstraintValidation.h"
using namespace mozilla;
using namespace mozilla::dom;
class nsHTMLObjectElement : public nsGenericHTMLFormElement
@ -489,7 +492,7 @@ nsHTMLObjectElement::IsAttributeMapped(const nsIAtom *aAttribute) const
sImageAlignAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -42,8 +45,9 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
// XXX missing nav attributes
using namespace mozilla;
// XXX missing nav attributes
class nsHTMLParagraphElement : public nsGenericHTMLElement,
public nsIDOMHTMLParagraphElement
@ -142,7 +146,7 @@ nsHTMLParagraphElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
using namespace mozilla;
class nsHTMLPreElement : public nsGenericHTMLElement,
public nsIDOMHTMLPreElement
{
@ -188,7 +193,7 @@ nsHTMLPreElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsHTMLSelectElement.h"
#include "nsHTMLOptionElement.h"
@ -71,6 +73,7 @@
#include "mozAutoDocUpdate.h"
#include "dombindings.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_ISUPPORTS1(nsSelectState, nsSelectState)
@ -1523,7 +1526,7 @@ nsHTMLSelectElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sImageAlignAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsIDOMHTMLParamElement.h"
#include "nsIDOMHTMLBaseElement.h"
#include "nsIDOMHTMLDirectoryElement.h"
@ -49,6 +51,7 @@
#include "nsMappedAttributes.h"
#include "nsContentUtils.h"
using namespace mozilla;
// XXX nav4 has type= start= (same as OL/UL)
extern nsAttrValue::EnumTable kListTypeTable[];
@ -311,7 +314,7 @@ nsHTMLSharedElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
return nsGenericHTMLElement::IsAttributeMapped(aAttribute);

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGenericHTMLElement.h"
#include "nsObjectLoadingContent.h"
#include "nsGkAtoms.h"
@ -55,6 +57,7 @@
#undef GetObject
#endif
using namespace mozilla;
using namespace mozilla::dom;
class nsHTMLSharedObjectElement : public nsGenericHTMLElement
@ -438,7 +441,7 @@ nsHTMLSharedObjectElement::IsAttributeMapped(const nsIAtom *aAttribute) const
sImageAlignAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
using namespace mozilla;
class nsHTMLTableCaptionElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableCaptionElement
{
@ -161,7 +166,7 @@ nsHTMLTableCaptionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -49,6 +52,8 @@
#include "nsIDocument.h"
#include "celldata.h"
using namespace mozilla;
class nsHTMLTableCellElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableCellElement
{
@ -427,7 +432,7 @@ nsHTMLTableCellElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -34,6 +34,9 @@
* 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"
@ -42,6 +45,8 @@
#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
@ -227,7 +232,7 @@ nsHTMLTableColElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -34,6 +34,9 @@
* 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"
@ -56,6 +59,8 @@
#include "nsHTMLStyleSheet.h"
#include "dombindings.h"
using namespace mozilla;
/* ------------------------------ TableRowsCollection -------------------------------- */
/**
* This class provides a late-bound collection of rows in a table.
@ -1156,7 +1161,7 @@ nsHTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -34,6 +34,9 @@
* 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"
@ -49,6 +52,8 @@
#include "nsRuleData.h"
#include "nsContentUtils.h"
using namespace mozilla;
class nsHTMLTableRowElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableRowElement
{
@ -457,7 +462,7 @@ nsHTMLTableRowElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -34,6 +34,9 @@
* 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"
@ -47,6 +50,8 @@
#include "nsIDocument.h"
#include "nsContentUtils.h"
using namespace mozilla;
// you will see the phrases "rowgroup" and "section" used interchangably
class nsHTMLTableSectionElement : public nsGenericHTMLElement,
@ -321,7 +326,7 @@ nsHTMLTableSectionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sBackgroundAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsITextControlElement.h"
#include "nsIDOMNSEditableElement.h"
@ -81,6 +83,7 @@
#include "nsTextEditorState.h"
using namespace mozilla;
using namespace mozilla::dom;
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
@ -665,7 +668,7 @@ nsHTMLTextAreaElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap,
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -35,6 +35,9 @@
* 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"
@ -64,6 +67,7 @@
#include "nsIDOMProgressEvent.h"
#include "nsMediaError.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_NS_NEW_HTML_ELEMENT(Video)
@ -150,7 +154,7 @@ nsHTMLVideoElement::IsAttributeMapped(const nsIAtom* aAttribute) const
sCommonAttributeMap
};
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
return FindAttributeDependence(aAttribute, map, ArrayLength(map));
}
nsMapRuleToAttributesFunc

View File

@ -40,6 +40,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsContentSink.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
@ -1479,7 +1481,7 @@ HTMLContentSink::~HTMLContentSink()
delete mHeadContext;
for (i = 0; PRUint32(i) < NS_ARRAY_LENGTH(mNodeInfoCache); ++i) {
for (i = 0; PRUint32(i) < ArrayLength(mNodeInfoCache); ++i) {
NS_IF_RELEASE(mNodeInfoCache[i]);
}
}
@ -1493,7 +1495,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLContentSink, nsContentSink)
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 < NS_ARRAY_LENGTH(tmp->mNodeInfoCache); ++i) {
for (PRUint32 i = 0; i < ArrayLength(tmp->mNodeInfoCache); ++i) {
NS_IF_RELEASE(tmp->mNodeInfoCache[i]);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
@ -1505,7 +1507,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLContentSink,
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 < NS_ARRAY_LENGTH(tmp->mNodeInfoCache); ++i) {
for (PRUint32 i = 0; i < ArrayLength(tmp->mNodeInfoCache); ++i) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mNodeInfoCache[i]");
cb.NoteXPCOMChild(tmp->mNodeInfoCache[i]);
}

View File

@ -37,6 +37,9 @@
* 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"
@ -3188,7 +3191,7 @@ ConvertToMidasInternalCommandInner(const nsAString & inCommandID,
NS_ConvertUTF16toUTF8 convertedParam(Substring(start, end));
PRUint32 j;
for (j = 0; j < NS_ARRAY_LENGTH(gBlocks); ++j) {
for (j = 0; j < ArrayLength(gBlocks); ++j) {
if (convertedParam.Equals(gBlocks[j],
nsCaseInsensitiveCStringComparator())) {
outParam.Assign(gBlocks[j]);
@ -3196,7 +3199,7 @@ ConvertToMidasInternalCommandInner(const nsAString & inCommandID,
}
}
return j != NS_ARRAY_LENGTH(gBlocks);
return j != ArrayLength(gBlocks);
}
else {
CopyUTF16toUTF8(inParam, outParam);

View File

@ -38,6 +38,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsMathMLElement.h"
#include "nsDOMClassInfoID.h" // for eDOMClassInfo_MathElement_id.
#include "nsGkAtoms.h"
@ -52,6 +54,8 @@
#include "nsPresContext.h"
#include "mozAutoDocUpdate.h"
using namespace mozilla;
//----------------------------------------------------------------------
// nsISupports methods:
@ -177,11 +181,11 @@ nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
tag == nsGkAtoms::mn_ || tag == nsGkAtoms::mo_ ||
tag == nsGkAtoms::mtext_ || tag == nsGkAtoms::mspace_)
return FindAttributeDependence(aAttribute, tokenMap,
NS_ARRAY_LENGTH(tokenMap));
ArrayLength(tokenMap));
if (tag == nsGkAtoms::mstyle_ ||
tag == nsGkAtoms::math)
return FindAttributeDependence(aAttribute, mstyleMap,
NS_ARRAY_LENGTH(mstyleMap));
ArrayLength(mstyleMap));
if (tag == nsGkAtoms::maction_ ||
tag == nsGkAtoms::maligngroup_ ||
@ -207,7 +211,7 @@ nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
tag == nsGkAtoms::munderover_ ||
tag == nsGkAtoms::none) {
return FindAttributeDependence(aAttribute, commonPresMap,
NS_ARRAY_LENGTH(commonPresMap));
ArrayLength(commonPresMap));
}
return PR_FALSE;
@ -405,7 +409,7 @@ nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
NS_STYLE_FONT_SIZE_LARGE
};
str.CompressWhitespace();
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sizes); ++i) {
for (PRUint32 i = 0; i < ArrayLength(sizes); ++i) {
if (str.EqualsASCII(sizes[i])) {
fontSize->SetIntValue(values[i], eCSSUnit_Enumerated);
break;

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "DOMSVGPathSeg.h"
#include "DOMSVGPathSegList.h"
#include "SVGPathSegUtils.h"
@ -172,7 +174,7 @@ DOMSVGPathSeg::IndexIsValid()
// Implementation of DOMSVGPathSeg sub-classes below this point
#define CHECK_ARG_COUNT_IN_SYNC(segType) \
NS_ABORT_IF_FALSE(NS_ARRAY_LENGTH(mArgs) == \
NS_ABORT_IF_FALSE(ArrayLength(mArgs) == \
SVGPathSegUtils::ArgCountForType(PRUint32(segType)) || \
PRUint32(segType) == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH, \
"Arg count/array size out of sync")

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "nsWhitespaceTokenizer.h"
#ifdef MOZ_SMIL
@ -102,7 +104,7 @@ static const char *sMeetOrSliceStrings[] = { "meet", "slice" };
static PRUint16
GetAlignForString(const nsAString &aAlignString)
{
for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(sAlignStrings) ; i++) {
for (PRUint32 i = 0 ; i < ArrayLength(sAlignStrings) ; i++) {
if (aAlignString.EqualsASCII(sAlignStrings[i])) {
return (i + nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE);
}
@ -127,7 +129,7 @@ GetAlignString(nsAString& aAlignString, PRUint16 aAlign)
static PRUint16
GetMeetOrSliceForString(const nsAString &aMeetOrSlice)
{
for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(sMeetOrSliceStrings) ; i++) {
for (PRUint32 i = 0 ; i < ArrayLength(sMeetOrSliceStrings) ; i++) {
if (aMeetOrSlice.EqualsASCII(sMeetOrSliceStrings[i])) {
return (i + nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET);
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "SVGLength.h"
#include "nsSVGElement.h"
#include "nsSVGSVGElement.h"
@ -271,7 +273,7 @@ GetUnitTypeForString(const char* unitStr)
nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr);
for (PRUint32 i = 1 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) {
for (PRUint32 i = 1 ; i < ArrayLength(unitMap) ; i++) {
if (unitMap[i] && *unitMap[i] == unitAtom) {
return i;
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "SVGNumberList.h"
#include "SVGAnimatedNumberList.h"
#include "nsSVGElement.h"
@ -68,7 +70,7 @@ SVGNumberList::GetValueAsString(nsAString& aValue) const
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, NS_ARRAY_LENGTH(buf),
nsTextFormatter::snprintf(buf, ArrayLength(buf),
NS_LITERAL_STRING("%g").get(),
double(mNumbers[i]));
// We ignore OOM, since it's not useful for us to return an error.

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "SVGPointList.h"
#include "SVGAnimatedPointList.h"
#include "nsSVGElement.h"
@ -68,7 +70,7 @@ SVGPointList::GetValueAsString(nsAString& aValue) const
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, NS_ARRAY_LENGTH(buf),
nsTextFormatter::snprintf(buf, ArrayLength(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.

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "SVGTransformListParser.h"
#include "SVGTransform.h"
#include "prdtoa.h"
@ -235,7 +237,7 @@ SVGTransformListParser::MatchTranslate()
float t[2];
PRUint32 count;
ENSURE_MATCHED(MatchNumberArguments(t, NS_ARRAY_LENGTH(t), &count));
ENSURE_MATCHED(MatchNumberArguments(t, ArrayLength(t), &count));
switch (count) {
case 1:
@ -264,7 +266,7 @@ SVGTransformListParser::MatchScale()
float s[2];
PRUint32 count;
ENSURE_MATCHED(MatchNumberArguments(s, NS_ARRAY_LENGTH(s), &count));
ENSURE_MATCHED(MatchNumberArguments(s, ArrayLength(s), &count));
switch (count) {
case 1:
@ -293,7 +295,7 @@ SVGTransformListParser::MatchRotate()
float r[3];
PRUint32 count;
ENSURE_MATCHED(MatchNumberArguments(r, NS_ARRAY_LENGTH(r), &count));
ENSURE_MATCHED(MatchNumberArguments(r, ArrayLength(r), &count));
switch (count) {
case 1:
@ -366,7 +368,7 @@ SVGTransformListParser::MatchMatrix()
float m[6];
PRUint32 count;
ENSURE_MATCHED(MatchNumberArguments(m, NS_ARRAY_LENGTH(m), &count));
ENSURE_MATCHED(MatchNumberArguments(m, ArrayLength(m), &count));
if (count != 6) {
return NS_ERROR_FAILURE;

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGAElement.h"
#include "nsSVGGraphicElement.h"
#include "nsIDOMSVGAElement.h"
@ -45,6 +47,8 @@
#include "nsGkAtoms.h"
#include "nsContentUtils.h"
using namespace mozilla;
nsSVGElement::StringInfo nsSVGAElement::sStringInfo[2] =
{
{ &nsGkAtoms::href, kNameSpaceID_XLink, PR_TRUE },
@ -189,7 +193,7 @@ nsSVGAElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGAElementBase::IsAttributeMapped(name);
}
@ -335,5 +339,5 @@ nsSVGElement::StringAttributesInfo
nsSVGAElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -32,6 +32,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGAltGlyphElement.h"
#include "nsIDOMSVGURIReference.h"
@ -39,6 +41,8 @@
#include "nsSVGTextPositioningElement.h"
#include "nsContentUtils.h"
using namespace mozilla;
typedef nsSVGTextPositioningElement nsSVGAltGlyphElementBase;
class nsSVGAltGlyphElement : public nsSVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement
@ -173,7 +177,7 @@ nsSVGAltGlyphElement::IsAttributeMapped(const nsIAtom* name) const
sTextContentElementsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGAltGlyphElementBase::IsAttributeMapped(name);
}
@ -190,5 +194,5 @@ nsSVGElement::StringAttributesInfo
nsSVGAltGlyphElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGAngle.h"
#include "prdtoa.h"
#include "nsTextFormatter.h"
@ -191,7 +193,7 @@ GetUnitTypeForString(const char* unitStr)
nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr);
for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) {
for (PRUint32 i = 0 ; i < ArrayLength(unitMap) ; i++) {
if (unitMap[i] && *unitMap[i] == unitAtom) {
return i;
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGPathGeometryElement.h"
#include "nsIDOMSVGCircleElement.h"
#include "nsSVGLength2.h"
@ -43,6 +45,8 @@
#include "nsSVGUtils.h"
#include "gfxContext.h"
using namespace mozilla;
typedef nsSVGPathGeometryElement nsSVGCircleElementBase;
class nsSVGCircleElement : public nsSVGCircleElementBase,
@ -142,7 +146,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGCircleElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
//----------------------------------------------------------------------

View File

@ -34,9 +34,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGClipPathElement.h"
#include "nsGkAtoms.h"
using namespace mozilla;
nsSVGElement::EnumInfo nsSVGClipPathElement::sEnumInfo[1] =
{
{ &nsGkAtoms::clipPathUnits,
@ -80,7 +84,7 @@ nsSVGElement::EnumAttributesInfo
nsSVGClipPathElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
//----------------------------------------------------------------------

View File

@ -36,9 +36,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGGraphicElement.h"
#include "nsIDOMSVGDefsElement.h"
using namespace mozilla;
typedef nsSVGGraphicElement nsSVGDefsElementBase;
class nsSVGDefsElement : public nsSVGDefsElementBase,
@ -122,6 +126,6 @@ nsSVGDefsElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGDefsElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGElement.h"
#include "nsSVGSVGElement.h"
#include "nsSVGSwitchElement.h"
@ -2146,7 +2148,7 @@ nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument,
attributeValue.get() };
return nsSVGUtils::ReportToConsole(aDocument,
"AttributeParseWarning",
strings, NS_ARRAY_LENGTH(strings));
strings, ArrayLength(strings));
}
void

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGPathGeometryElement.h"
#include "nsIDOMSVGEllipseElement.h"
#include "nsSVGLength2.h"
@ -44,6 +46,8 @@
#include "nsSVGUtils.h"
#include "gfxContext.h"
using namespace mozilla;
typedef nsSVGPathGeometryElement nsSVGEllipseElementBase;
class nsSVGEllipseElement : public nsSVGEllipseElementBase,
@ -150,7 +154,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGEllipseElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
//----------------------------------------------------------------------

View File

@ -34,11 +34,15 @@
*
* ***** 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 },
@ -191,7 +195,7 @@ nsSVGFilterElement::IsAttributeMapped(const nsIAtom* name) const
sTextContentElementsMap,
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGGraphicElementBase::IsAttributeMapped(name);
}
@ -218,26 +222,26 @@ nsSVGElement::LengthAttributesInfo
nsSVGFilterElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::IntegerPairAttributesInfo
nsSVGFilterElement::GetIntegerPairInfo()
{
return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo,
NS_ARRAY_LENGTH(sIntegerPairInfo));
ArrayLength(sIntegerPairInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFilterElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFilterElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGElement.h"
#include "nsGkAtoms.h"
#include "nsSVGNumber2.h"
@ -293,7 +295,7 @@ nsSVGFE::IsAttributeMapped(const nsIAtom* name) const
sFiltersMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGFEBase::IsAttributeMapped(name);
}
@ -304,7 +306,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGFE::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
inline static void DidAnimateAttr(Element *aFilterPrimitive)
@ -846,14 +848,14 @@ nsSVGElement::NumberPairAttributesInfo
nsSVGFEGaussianBlurElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
NS_ARRAY_LENGTH(sNumberPairInfo));
ArrayLength(sNumberPairInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEGaussianBlurElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Blend------------------------
@ -1048,14 +1050,14 @@ nsSVGElement::EnumAttributesInfo
nsSVGFEBlendElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEBlendElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Color Matrix------------------------
@ -1344,21 +1346,21 @@ nsSVGElement::EnumAttributesInfo
nsSVGFEColorMatrixElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEColorMatrixElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
nsSVGElement::NumberListAttributesInfo
nsSVGFEColorMatrixElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
NS_ARRAY_LENGTH(sNumberListInfo));
ArrayLength(sNumberListInfo));
}
//---------------------Composite------------------------
@ -1638,21 +1640,21 @@ nsSVGElement::NumberAttributesInfo
nsSVGFECompositeElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFECompositeElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFECompositeElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Component Transfer------------------------
@ -1750,7 +1752,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFEComponentTransferElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//--------------------------------------------
@ -2042,21 +2044,21 @@ nsSVGElement::NumberListAttributesInfo
nsSVGComponentTransferFunctionElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
NS_ARRAY_LENGTH(sNumberListInfo));
ArrayLength(sNumberListInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGComponentTransferFunctionElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::NumberAttributesInfo
nsSVGComponentTransferFunctionElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
class nsSVGFEFuncRElement : public nsSVGComponentTransferFunctionElement,
@ -2393,7 +2395,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFEMergeElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Merge Node------------------------
@ -2447,7 +2449,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFEMergeNodeElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Offset------------------------
@ -2629,14 +2631,14 @@ nsSVGElement::NumberAttributesInfo
nsSVGFEOffsetElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEOffsetElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Flood------------------------
@ -2766,7 +2768,7 @@ nsSVGFEFloodElement::IsAttributeMapped(const nsIAtom* name) const
sFEFloodMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGFEFloodElementBase::IsAttributeMapped(name);
}
@ -2777,7 +2779,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFEFloodElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Tile------------------------
@ -2968,7 +2970,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFETileElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Turbulence------------------------
@ -3469,35 +3471,35 @@ nsSVGElement::NumberAttributesInfo
nsSVGFETurbulenceElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::NumberPairAttributesInfo
nsSVGFETurbulenceElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
NS_ARRAY_LENGTH(sNumberPairInfo));
ArrayLength(sNumberPairInfo));
}
nsSVGElement::IntegerAttributesInfo
nsSVGFETurbulenceElement::GetIntegerInfo()
{
return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo,
NS_ARRAY_LENGTH(sIntegerInfo));
ArrayLength(sIntegerInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFETurbulenceElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFETurbulenceElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Morphology------------------------
@ -3804,21 +3806,21 @@ nsSVGElement::NumberPairAttributesInfo
nsSVGFEMorphologyElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
NS_ARRAY_LENGTH(sNumberPairInfo));
ArrayLength(sNumberPairInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFEMorphologyElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEMorphologyElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------Convolve Matrix------------------------
@ -4262,56 +4264,56 @@ nsSVGElement::NumberAttributesInfo
nsSVGFEConvolveMatrixElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::NumberPairAttributesInfo
nsSVGFEConvolveMatrixElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
NS_ARRAY_LENGTH(sNumberPairInfo));
ArrayLength(sNumberPairInfo));
}
nsSVGElement::IntegerAttributesInfo
nsSVGFEConvolveMatrixElement::GetIntegerInfo()
{
return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo,
NS_ARRAY_LENGTH(sIntegerInfo));
ArrayLength(sIntegerInfo));
}
nsSVGElement::IntegerPairAttributesInfo
nsSVGFEConvolveMatrixElement::GetIntegerPairInfo()
{
return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo,
NS_ARRAY_LENGTH(sIntegerPairInfo));
ArrayLength(sIntegerPairInfo));
}
nsSVGElement::BooleanAttributesInfo
nsSVGFEConvolveMatrixElement::GetBooleanInfo()
{
return BooleanAttributesInfo(mBooleanAttributes, sBooleanInfo,
NS_ARRAY_LENGTH(sBooleanInfo));
ArrayLength(sBooleanInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFEConvolveMatrixElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEConvolveMatrixElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
nsSVGElement::NumberListAttributesInfo
nsSVGFEConvolveMatrixElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
NS_ARRAY_LENGTH(sNumberListInfo));
ArrayLength(sNumberListInfo));
}
//---------------------DistantLight------------------------
@ -4402,7 +4404,7 @@ nsSVGElement::NumberAttributesInfo
nsSVGFEDistantLightElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
//---------------------PointLight------------------------
@ -4498,7 +4500,7 @@ nsSVGElement::NumberAttributesInfo
nsSVGFEPointLightElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
//---------------------SpotLight------------------------
@ -4633,7 +4635,7 @@ nsSVGElement::NumberAttributesInfo
nsSVGFESpotLightElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
//------------------------------------------------------------
@ -4732,7 +4734,7 @@ nsSVGFELightingElement::IsAttributeMapped(const nsIAtom* name) const
sLightingEffectsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGFELightingElementBase::IsAttributeMapped(name);
}
@ -4991,21 +4993,21 @@ nsSVGElement::NumberAttributesInfo
nsSVGFELightingElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::NumberPairAttributesInfo
nsSVGFELightingElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
NS_ARRAY_LENGTH(sNumberPairInfo));
ArrayLength(sNumberPairInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFELightingElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//---------------------DiffuseLighting------------------------
@ -5460,7 +5462,7 @@ nsSVGFEImageElement::IsAttributeMapped(const nsIAtom* name) const
sGraphicsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGFEImageElementBase::IsAttributeMapped(name);
}
@ -5615,7 +5617,7 @@ nsSVGElement::StringAttributesInfo
nsSVGFEImageElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
void
@ -5950,19 +5952,19 @@ nsSVGElement::NumberAttributesInfo
nsSVGFEDisplacementMapElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
NS_ARRAY_LENGTH(sNumberInfo));
ArrayLength(sNumberInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGFEDisplacementMapElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGFEDisplacementMapElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -36,9 +36,13 @@
*
* ***** 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 },
@ -136,7 +140,7 @@ nsSVGForeignObjectElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGForeignObjectElementBase::IsAttributeMapped(name);
}
@ -147,5 +151,5 @@ nsSVGElement::LengthAttributesInfo
nsSVGForeignObjectElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}

View File

@ -36,9 +36,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGGraphicElement.h"
#include "nsIDOMSVGGElement.h"
using namespace mozilla;
typedef nsSVGGraphicElement nsSVGGElementBase;
class nsSVGGElement : public nsSVGGElementBase,
@ -123,6 +127,6 @@ nsSVGGElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGGElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "DOMSVGAnimatedTransformList.h"
#include "nsIDOMSVGAnimatedEnum.h"
#include "nsIDOMSVGURIReference.h"
@ -101,14 +103,14 @@ nsSVGElement::EnumAttributesInfo
nsSVGGradientElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGGradientElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//----------------------------------------------------------------------
@ -156,7 +158,7 @@ nsSVGGradientElement::IsAttributeMapped(const nsIAtom* name) const
sGradientStopMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGGradientElementBase::IsAttributeMapped(name);
}
@ -245,7 +247,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGLinearGradientElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
//-------------------------- Radial Gradients ----------------------------
@ -330,5 +332,5 @@ nsSVGElement::LengthAttributesInfo
nsSVGRadialGradientElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGSVGElement.h"
#include "DOMSVGAnimatedTransformList.h"
@ -173,7 +175,7 @@ nsSVGGraphicElement::IsAttributeMapped(const nsIAtom* name) const
sGraphicsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGGraphicElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGImageElement.h"
#include "nsCOMPtr.h"
#include "nsIURI.h"
@ -234,7 +236,7 @@ nsSVGImageElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap,
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGImageElementBase::IsAttributeMapped(name);
}
@ -263,7 +265,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGImageElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
SVGAnimatedPreserveAspectRatio *
@ -276,7 +278,7 @@ nsSVGElement::StringAttributesInfo
nsSVGImageElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
void

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGLength2.h"
#include "prdtoa.h"
#include "nsTextFormatter.h"
@ -49,6 +51,8 @@
#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)
@ -140,7 +144,7 @@ GetUnitTypeForString(const char* unitStr)
nsCOMPtr<nsIAtom> unitAtom = do_GetAtom(unitStr);
for (PRUint32 i = 0 ; i < NS_ARRAY_LENGTH(unitMap) ; i++) {
for (PRUint32 i = 0 ; i < ArrayLength(unitMap) ; i++) {
if (unitMap[i] && *unitMap[i] == unitAtom) {
return i;
}

View File

@ -37,12 +37,16 @@
*
* ***** 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,
@ -157,7 +161,7 @@ nsSVGLineElement::IsAttributeMapped(const nsIAtom* name) const
sMarkersMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGLineElementBase::IsAttributeMapped(name);
}
@ -168,7 +172,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGLineElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
//----------------------------------------------------------------------

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGkAtoms.h"
#include "nsCOMPtr.h"
#include "SVGAnimatedPreserveAspectRatio.h"
@ -244,7 +246,7 @@ nsSVGMarkerElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGMarkerElementBase::IsAttributeMapped(name);
}
@ -308,21 +310,21 @@ nsSVGElement::LengthAttributesInfo
nsSVGMarkerElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::AngleAttributesInfo
nsSVGMarkerElement::GetAngleInfo()
{
return AngleAttributesInfo(mAngleAttributes, sAngleInfo,
NS_ARRAY_LENGTH(sAngleInfo));
ArrayLength(sAngleInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGMarkerElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGViewBox *

View File

@ -34,10 +34,14 @@
*
* ***** 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] =
@ -136,14 +140,14 @@ nsSVGElement::LengthAttributesInfo
nsSVGMaskElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGMaskElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
//----------------------------------------------------------------------
@ -163,6 +167,6 @@ nsSVGMaskElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGMaskElementBase::IsAttributeMapped(name);
}

View File

@ -35,12 +35,15 @@
*
* ***** 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] =
@ -191,7 +194,7 @@ nsSVGElement::StringAttributesInfo
nsSVGMpathElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//----------------------------------------------------------------------

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGPathSeg.h"
#include "DOMSVGPathSeg.h"
@ -386,7 +388,7 @@ nsSVGPathElement::IsAttributeMapped(const nsIAtom* name) const
sMarkersMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGPathElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "DOMSVGAnimatedTransformList.h"
#include "nsIDOMMutationEvent.h"
#include "nsCOMPtr.h"
@ -196,7 +198,7 @@ nsSVGPatternElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGPatternElementBase::IsAttributeMapped(name);
}
@ -216,14 +218,14 @@ nsSVGElement::LengthAttributesInfo
nsSVGPatternElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGPatternElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGViewBox *
@ -242,6 +244,6 @@ nsSVGElement::StringAttributesInfo
nsSVGPatternElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGPolyElement.h"
#include "DOMSVGPointList.h"
#include "gfxContext.h"
@ -91,7 +93,7 @@ nsSVGPolyElement::IsAttributeMapped(const nsIAtom* name) const
sMarkersMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGPolyElementBase::IsAttributeMapped(name);
}

View File

@ -37,12 +37,16 @@
*
* ***** 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,
@ -163,7 +167,7 @@ nsSVGElement::LengthAttributesInfo
nsSVGRectElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
//----------------------------------------------------------------------

View File

@ -38,6 +38,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsGkAtoms.h"
#include "DOMSVGNumber.h"
#include "DOMSVGLength.h"
@ -906,7 +908,7 @@ nsSVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGSVGElementBase::IsAttributeMapped(name);
}
@ -1203,14 +1205,14 @@ nsSVGElement::LengthAttributesInfo
nsSVGSVGElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGSVGElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGViewBox *

View File

@ -37,6 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGElement.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGScriptElement.h"
@ -49,6 +51,7 @@
#include "nsScriptElement.h"
#include "nsContentUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
typedef nsSVGElement nsSVGScriptElementBase;
@ -265,7 +268,7 @@ nsSVGElement::StringAttributesInfo
nsSVGScriptElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//----------------------------------------------------------------------

View File

@ -36,12 +36,16 @@
*
* ***** 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,
@ -139,7 +143,7 @@ nsSVGStopElement::IsAttributeMapped(const nsIAtom* name) const
sGradientStopMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGStopElementBase::IsAttributeMapped(name);
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGFeatures.h"
#include "nsSVGSwitchElement.h"
#include "nsIFrame.h"
@ -150,7 +152,7 @@ nsSVGSwitchElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGSwitchElementBase::IsAttributeMapped(name);
}

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsIDOMSVGSymbolElement.h"
#include "nsSVGStylableElement.h"
#include "nsSVGViewBox.h"
@ -147,7 +149,7 @@ nsSVGSymbolElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGSymbolElementBase::IsAttributeMapped(name);
}

View File

@ -36,12 +36,16 @@
*
* ***** 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
@ -134,7 +138,7 @@ nsSVGTSpanElement::IsAttributeMapped(const nsIAtom* name) const
sTextContentElementsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGTSpanElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGGraphicElement.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGTextElement.h"
@ -357,7 +359,7 @@ nsSVGTextElement::IsAttributeMapped(const nsIAtom* name) const
sFontSpecificationMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGTextElementBase::IsAttributeMapped(name);
}
@ -376,7 +378,7 @@ nsSVGElement::LengthListAttributesInfo
nsSVGTextElement::GetLengthListInfo()
{
return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo,
NS_ARRAY_LENGTH(sLengthListInfo));
ArrayLength(sLengthListInfo));
}
nsSVGElement::NumberListInfo nsSVGTextElement::sNumberListInfo[1] =
@ -388,6 +390,6 @@ nsSVGElement::NumberListAttributesInfo
nsSVGTextElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
NS_ARRAY_LENGTH(sNumberListInfo));
ArrayLength(sNumberListInfo));
}

View File

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGStylableElement.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGTextPathElement.h"
@ -44,6 +46,8 @@
#include "nsDOMError.h"
#include "nsContentUtils.h"
using namespace mozilla;
nsSVGElement::LengthInfo nsSVGTextPathElement::sLengthInfo[1] =
{
{ &nsGkAtoms::startOffset, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X },
@ -151,7 +155,7 @@ nsSVGTextPathElement::IsAttributeMapped(const nsIAtom* name) const
sTextContentElementsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGTextPathElementBase::IsAttributeMapped(name);
}
@ -168,19 +172,19 @@ nsSVGElement::LengthAttributesInfo
nsSVGTextPathElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGTextPathElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
NS_ARRAY_LENGTH(sEnumInfo));
ArrayLength(sEnumInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGTextPathElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}

View File

@ -33,6 +33,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGTextPositioningElement.h"
#include "SVGAnimatedLengthList.h"
#include "DOMSVGAnimatedLengthList.h"
@ -54,7 +56,7 @@ nsSVGElement::LengthListAttributesInfo
nsSVGTextPositioningElement::GetLengthListInfo()
{
return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo,
NS_ARRAY_LENGTH(sLengthListInfo));
ArrayLength(sLengthListInfo));
}
@ -67,7 +69,7 @@ nsSVGElement::NumberListAttributesInfo
nsSVGTextPositioningElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
NS_ARRAY_LENGTH(sNumberListInfo));
ArrayLength(sNumberListInfo));
}
//----------------------------------------------------------------------

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsSVGUseElement.h"
#include "nsIDOMSVGGElement.h"
#include "nsGkAtoms.h"
@ -45,6 +47,7 @@
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
////////////////////////////////////////////////////////////////////////
@ -502,14 +505,14 @@ nsSVGElement::LengthAttributesInfo
nsSVGUseElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
NS_ARRAY_LENGTH(sLengthInfo));
ArrayLength(sLengthInfo));
}
nsSVGElement::StringAttributesInfo
nsSVGUseElement::GetStringInfo()
{
return StringAttributesInfo(mStringAttributes, sStringInfo,
NS_ARRAY_LENGTH(sStringInfo));
ArrayLength(sStringInfo));
}
//----------------------------------------------------------------------
@ -529,7 +532,7 @@ nsSVGUseElement::IsAttributeMapped(const nsIAtom* name) const
sViewportsMap
};
return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
return FindAttributeDependence(name, map, ArrayLength(map)) ||
nsSVGUseElementBase::IsAttributeMapped(name);
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsXBLContentSink.h"
#include "nsIDocument.h"
#include "nsBindingManager.h"
@ -61,6 +63,7 @@
#include "nsIPrincipal.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
using namespace mozilla::dom;
nsresult
@ -246,7 +249,7 @@ nsXBLContentSink::ReportUnexpectedElement(nsIAtom* aElementName,
return nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
"UnexpectedElement",
params, NS_ARRAY_LENGTH(params),
params, ArrayLength(params),
nsnull,
EmptyString() /* source line */,
aLineNumber, 0 /* column number */,

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "nsIInputStream.h"
@ -74,6 +76,8 @@
#include "nsXBLResourceLoader.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
// Helper Classes =====================================================================
// nsXBLAttributeEntry and helpers. This class is used to efficiently handle
@ -172,7 +176,7 @@ public:
sizeof(nsXBLInsertionPointEntry)
};
kPool->Init("XBL Insertion Point Entries", kBucketSizes,
NS_ARRAY_LENGTH(kBucketSizes), aInitialSize);
ArrayLength(kBucketSizes), aInitialSize);
}
}
}

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsCOMPtr.h"
#include "nsXBLPrototypeHandler.h"
#include "nsXBLPrototypeBinding.h"
@ -990,7 +992,7 @@ nsXBLPrototypeHandler::ReportKeyConflict(const PRUnichar* aKey, const PRUnichar*
const PRUnichar* params[] = { aKey, aModifiers };
nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
aMessageName,
params, NS_ARRAY_LENGTH(params),
params, ArrayLength(params),
nsnull, EmptyString(), mLineNumber, 0,
nsIScriptError::warningFlag,
"XBL Prototype Handler", doc);

Some files were not shown because too many files have changed in this diff Show More