Bug 1539884 - Part 31: Mark nsTreeBodyFrame::FireScrollEvent as CAN_RUN_SCRIPT r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D134414
This commit is contained in:
Kagami Sascha Rosylight 2021-12-23 16:27:24 +00:00
parent f5525de4f5
commit 964184af24
2 changed files with 6 additions and 4 deletions

View File

@ -4178,8 +4178,8 @@ void nsTreeBodyFrame::ScrollCallback(nsITimer* aTimer, void* aClosure) {
}
}
NS_IMETHODIMP
nsTreeBodyFrame::ScrollEvent::Run() {
// TODO: Convert this to MOZ_CAN_RUN_SCRIPT (bug 1415230, bug 1535398)
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHODIMP nsTreeBodyFrame::ScrollEvent::Run() {
if (mInner) {
mInner->FireScrollEvent();
}
@ -4191,7 +4191,9 @@ void nsTreeBodyFrame::FireScrollEvent() {
WidgetGUIEvent event(true, eScroll, nullptr);
// scroll events fired at elements don't bubble
event.mFlags.mBubbles = false;
EventDispatcher::Dispatch(GetContent(), PresContext(), &event);
RefPtr<nsIContent> content = GetContent();
RefPtr<nsPresContext> presContext = PresContext();
EventDispatcher::Dispatch(content, presContext, &event);
}
void nsTreeBodyFrame::PostScrollEvent() {

View File

@ -443,7 +443,7 @@ class nsTreeBodyFrame final : public nsLeafBoxFrame,
};
void PostScrollEvent();
void FireScrollEvent();
MOZ_CAN_RUN_SCRIPT void FireScrollEvent();
/**
* Clear the pointer to this frame for all nsTreeImageListeners that were