Bug 1017762 - Remove the language argument to EventListenerManager::SetEventHandler; r=smaug

This commit is contained in:
Ms2ger 2014-06-06 10:06:26 +02:00
parent fd8c47231c
commit de2a24ea3b
3 changed files with 0 additions and 17 deletions

View File

@ -1775,7 +1775,6 @@ Element::SetEventHandler(nsIAtom* aEventName,
defer = defer && aDefer; // only defer if everyone agrees...
manager->SetEventHandler(aEventName, aValue,
nsIProgrammingLanguage::JAVASCRIPT,
defer, !nsContentUtils::IsChromeDoc(ownerDoc),
this);
return NS_OK;

View File

@ -641,25 +641,10 @@ EventListenerManager::SetEventHandlerInternal(
nsresult
EventListenerManager::SetEventHandler(nsIAtom* aName,
const nsAString& aBody,
uint32_t aLanguage,
bool aDeferCompilation,
bool aPermitUntrustedEvents,
Element* aElement)
{
NS_PRECONDITION(aLanguage != nsIProgrammingLanguage::UNKNOWN,
"Must know the language for the script event listener");
// |aPermitUntrustedEvents| is set to False for chrome - events
// *generated* from an unknown source are not allowed.
// However, for script languages with no 'sandbox', we want to reject
// such scripts based on the source of their code, not just the source
// of the event.
if (aPermitUntrustedEvents &&
aLanguage != nsIProgrammingLanguage::JAVASCRIPT) {
NS_WARNING("Discarding non-JS event listener from untrusted source");
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIScriptGlobalObject> global =
GetScriptGlobalAndDocument(getter_AddRefs(doc));

View File

@ -292,7 +292,6 @@ public:
// documents? Need to double-check the spec here.
nsresult SetEventHandler(nsIAtom *aName,
const nsAString& aFunc,
uint32_t aLanguage,
bool aDeferCompilation,
bool aPermitUntrustedEvents,
dom::Element* aElement);