mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1017762 - Remove the language argument to EventListenerManager::SetEventHandler; r=smaug
This commit is contained in:
parent
fd8c47231c
commit
de2a24ea3b
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user