diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3bc0451be686..6c3d0b0ce67c 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -99,7 +99,7 @@ #include "nsIMultiPartChannel.h" #include "nsIRefreshURI.h" #include "nsIWebNavigation.h" -#include "nsIConsoleService.h" +#include "nsIScriptError.h" #include "nsNetUtil.h" // for NS_MakeAbsoluteURI @@ -2306,13 +2306,14 @@ PRBool nsDocument::CheckGetElementByIdArg(const nsAString& aId) { if (aId.IsEmpty()) { - nsCOMPtr consoleService - (do_GetService("@mozilla.org/consoleservice;1")); - - if (consoleService) { - consoleService->LogStringMessage(NS_LITERAL_STRING( - "Empty string passed to getElementById().").get()); - } + nsContentUtils::ReportToConsole( + nsContentUtils::eDOM_PROPERTIES, + "EmptyGetElementByIdParam", + nsnull, 0, + nsnull, + EmptyString(), 0, 0, + nsIScriptError::warningFlag, + "DOM"); return PR_FALSE; } return PR_TRUE; diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index 2b6ae86f6e98..51972c316d35 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -17,3 +17,4 @@ UseOfRouteEventWarning=Use of routeEvent() is deprecated, see bug 330494. UseOfPreventBubbleWarning=Event=%S, use of preventBubble() is deprecated. Use W3C standard stopPropagation() instead. UseOfPreventCaptureWarning=Event=%S, use of preventCapture() is deprecated. Use W3C standard stopPropagation() instead. UnexpectedCanvasVariantStyle=canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored. +EmptyGetElementByIdParam=Empty string passed to getElementById().