mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1265072 part 3. Get rid of the use of GetDocumentFromScriptContext in DOMEventTargetHelper. r=smaug
This commit is contained in:
parent
fb36e28a0d
commit
4091ff6549
@ -377,11 +377,10 @@ DOMEventTargetHelper::GetContextForEventHandlers(nsresult* aRv)
|
||||
nsresult
|
||||
DOMEventTargetHelper::WantsUntrusted(bool* aRetVal)
|
||||
{
|
||||
nsresult rv;
|
||||
nsIScriptContext* context = GetContextForEventHandlers(&rv);
|
||||
nsresult rv = CheckInnerWindowCorrectness();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDocument> doc =
|
||||
nsContentUtils::GetDocumentFromScriptContext(context);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = GetDocumentIfCurrent();
|
||||
// We can let listeners on workers to always handle all the events.
|
||||
*aRetVal = (doc && !nsContentUtils::IsChromeDoc(doc)) || !NS_IsMainThread();
|
||||
return rv;
|
||||
|
Loading…
x
Reference in New Issue
Block a user