mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1743439 - Part 5: Mark callers in dom/events and dom/html as MOZ_CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D133364
This commit is contained in:
parent
459cd4e879
commit
d4de9cf54d
@ -64,8 +64,10 @@ class DOMEventTargetHelper : public dom::EventTarget,
|
||||
bool ComputeDefaultWantsUntrusted(ErrorResult& aRv) override;
|
||||
|
||||
using EventTarget::DispatchEvent;
|
||||
bool DispatchEvent(dom::Event& aEvent, dom::CallerType aCallerType,
|
||||
ErrorResult& aRv) override;
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY bool DispatchEvent(dom::Event& aEvent,
|
||||
dom::CallerType aCallerType,
|
||||
ErrorResult& aRv) override;
|
||||
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
|
||||
|
@ -166,20 +166,25 @@ class EventTarget : public nsISupports, public nsWrapperCache {
|
||||
/**
|
||||
* The most general DispatchEvent method. This is the one the bindings call.
|
||||
*/
|
||||
virtual bool DispatchEvent(Event& aEvent, CallerType aCallerType,
|
||||
ErrorResult& aRv) = 0;
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY virtual bool DispatchEvent(Event& aEvent,
|
||||
CallerType aCallerType,
|
||||
ErrorResult& aRv) = 0;
|
||||
|
||||
/**
|
||||
* A version of DispatchEvent you can use if you really don't care whether it
|
||||
* succeeds or not and whether default is prevented or not.
|
||||
*/
|
||||
void DispatchEvent(Event& aEvent);
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void DispatchEvent(Event& aEvent);
|
||||
|
||||
/**
|
||||
* A version of DispatchEvent you can use if you really don't care whether
|
||||
* default is prevented or not.
|
||||
*/
|
||||
void DispatchEvent(Event& aEvent, ErrorResult& aRv);
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void DispatchEvent(Event& aEvent,
|
||||
ErrorResult& aRv);
|
||||
|
||||
nsIGlobalObject* GetParentObject() const { return GetOwnerGlobal(); }
|
||||
|
||||
|
@ -1036,8 +1036,9 @@ nsresult HTMLFormElement::ConstructEntryList(FormData* aFormData) {
|
||||
FormDataEvent::Constructor(this, u"formdata"_ns, init);
|
||||
event->SetTrusted(true);
|
||||
|
||||
EventDispatcher::DispatchDOMEvent(ToSupports(this), nullptr, event, nullptr,
|
||||
nullptr);
|
||||
// TODO: Bug 1506441
|
||||
EventDispatcher::DispatchDOMEvent(MOZ_KnownLive(ToSupports(this)), nullptr,
|
||||
event, nullptr, nullptr);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -257,7 +257,8 @@ class HTMLFormElement final : public nsGenericHTMLElement,
|
||||
*
|
||||
* @param aFormData the form data object
|
||||
*/
|
||||
nsresult ConstructEntryList(FormData* aFormData);
|
||||
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230)
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult ConstructEntryList(FormData* aFormData);
|
||||
|
||||
/**
|
||||
* Whether the submission of this form has been ever prevented because of
|
||||
|
Loading…
Reference in New Issue
Block a user