Bug 581850 - Stop generating 'charCode is meaningless' warnings., r=jst, a=jst

--HG--
extra : rebase_source : e95a7b04813816e141e3ed7d47dc7f3144723701
This commit is contained in:
Olli Pettay 2010-11-07 19:24:41 +02:00
parent fe8c9c4a20
commit ed79642e80
4 changed files with 0 additions and 25 deletions

View File

@ -1355,25 +1355,6 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
return nsnull;
}
nsresult
nsDOMEvent::ReportWrongPropertyAccessWarning(const char* aPropertyName)
{
nsCOMPtr<nsIDocument> doc(GetDocumentForReport(mEvent));
nsAutoString propertyName, type;
GetType(type);
propertyName.AssignASCII(aPropertyName);
const PRUnichar *strings[] = { propertyName.get(), type.get() };
return nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
"WrongEventPropertyAccessWarning",
strings, NS_ARRAY_LENGTH(strings),
doc ? doc->GetDocumentURI() : nsnull,
EmptyString(), 0, 0,
nsIScriptError::warningFlag,
"DOM Events");
}
NS_IMETHODIMP
nsDOMEvent::GetPreventDefault(PRBool* aReturn)
{

View File

@ -225,7 +225,6 @@ protected:
// Internal helper functions
nsresult SetEventType(const nsAString& aEventTypeArg);
already_AddRefed<nsIContent> GetTargetFromFrame();
nsresult ReportWrongPropertyAccessWarning(const char* aPropertyName);
nsEvent* mEvent;
nsRefPtr<nsPresContext> mPresContext;

View File

@ -114,14 +114,12 @@ nsDOMKeyboardEvent::GetCharCode(PRUint32* aCharCode)
switch (mEvent->message) {
case NS_KEY_UP:
case NS_KEY_DOWN:
ReportWrongPropertyAccessWarning("charCode");
*aCharCode = 0;
break;
case NS_KEY_PRESS:
*aCharCode = ((nsKeyEvent*)mEvent)->charCode;
break;
default:
ReportWrongPropertyAccessWarning("charCode");
break;
}
return NS_OK;
@ -139,7 +137,6 @@ nsDOMKeyboardEvent::GetKeyCode(PRUint32* aKeyCode)
*aKeyCode = ((nsKeyEvent*)mEvent)->keyCode;
break;
default:
ReportWrongPropertyAccessWarning("keyCode");
*aKeyCode = 0;
break;
}
@ -169,7 +166,6 @@ nsDOMKeyboardEvent::GetWhich(PRUint32* aWhich)
}
break;
default:
ReportWrongPropertyAccessWarning("which");
*aWhich = 0;
break;
}

View File

@ -62,7 +62,6 @@ UnexpectedCanvasVariantStyle=canvas: an attempt to set strokeStyle or fillStyle
EmptyGetElementByIdParam=Empty string passed to getElementById().
LowMemoryTitle=Warning: Low memory
LowMemoryMessage=A script on this page has been stopped due to a low memory condition.
WrongEventPropertyAccessWarning=The '%S' property of a %S event should not be used. The value is meaningless.
SpeculationFailed=An unbalanced tree was written using document.write() causing data from the network to be reparsed. For more information https://developer.mozilla.org/en/Optimizing_Your_Pages_for_Speculative_Parsing
DocumentWriteIgnored=A call to document.write() from an asynchronously-loaded external script was ignored.
FormValidationTextTooLong=Please shorten this text to %S characters or less (you are currently using %S characters).