Bug 1685303: part 8) Annotate `nsFrameSelection::SetDragState` with `MOZ_CAN_RUN_SCRIPT`. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D101467
This commit is contained in:
Mirko Brodesser 2021-01-14 13:24:16 +00:00
Родитель 6ff7e927f9
Коммит f6f7a6f1aa
8 изменённых файлов: 22 добавлений и 20 удалений

Просмотреть файл

@ -231,7 +231,8 @@ class nsFocusManager final : public nsIFocusManager,
/** /**
* Called when a window has been lowered. * Called when a window has been lowered.
*/ */
void WindowLowered(mozIDOMWindowProxy* aWindow, uint64_t aActionId); MOZ_CAN_RUN_SCRIPT_BOUNDARY void WindowLowered(mozIDOMWindowProxy* aWindow,
uint64_t aActionId);
/** /**
* Called when a new document in a window is shown. * Called when a new document in a window is shown.

Просмотреть файл

@ -15,6 +15,7 @@
#include "nsCOMArray.h" #include "nsCOMArray.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsRefPtrHashtable.h" #include "nsRefPtrHashtable.h"
#include "mozilla/Attributes.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/layers/APZPublicUtils.h" #include "mozilla/layers/APZPublicUtils.h"
#include "Units.h" #include "Units.h"
@ -1216,7 +1217,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
void CreateClickHoldTimer(nsPresContext* aPresContext, nsIFrame* aDownFrame, void CreateClickHoldTimer(nsPresContext* aPresContext, nsIFrame* aDownFrame,
WidgetGUIEvent* aMouseDownEvent); WidgetGUIEvent* aMouseDownEvent);
void KillClickHoldTimer(); void KillClickHoldTimer();
void FireContextClick(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void FireContextClick();
MOZ_CAN_RUN_SCRIPT static void SetPointerLock(nsIWidget* aWidget, MOZ_CAN_RUN_SCRIPT static void SetPointerLock(nsIWidget* aWidget,
nsIContent* aElement); nsIContent* aElement);

Просмотреть файл

@ -9,6 +9,7 @@
#include "AccessibleCaret.h" #include "AccessibleCaret.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/CaretStateChangedEvent.h" #include "mozilla/dom/CaretStateChangedEvent.h"
#include "mozilla/dom/MouseEventBinding.h" #include "mozilla/dom/MouseEventBinding.h"
#include "mozilla/EnumSet.h" #include "mozilla/EnumSet.h"
@ -191,7 +192,7 @@ class AccessibleCaretManager {
MOZ_CAN_RUN_SCRIPT MOZ_CAN_RUN_SCRIPT
nsresult SelectWord(nsIFrame* aFrame, const nsPoint& aPoint) const; nsresult SelectWord(nsIFrame* aFrame, const nsPoint& aPoint) const;
void SetSelectionDragState(bool aState) const; MOZ_CAN_RUN_SCRIPT void SetSelectionDragState(bool aState) const;
// Return true if the candidate string is a phone number. // Return true if the candidate string is a phone number.
bool IsPhoneNumber(nsAString& aCandidate) const; bool IsPhoneNumber(nsAString& aCandidate) const;

Просмотреть файл

@ -1881,7 +1881,7 @@ class PresShell final : public nsStubDocumentObserver,
// Utility method to restore the root scrollframe state // Utility method to restore the root scrollframe state
void RestoreRootScrollPosition(); void RestoreRootScrollPosition();
void MaybeReleaseCapturingContent(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void MaybeReleaseCapturingContent();
class DelayedEvent { class DelayedEvent {
public: public:

Просмотреть файл

@ -135,7 +135,7 @@ class nsTextControlFrame : public nsContainerFrame,
const nsDisplayListSet& aLists) override; const nsDisplayListSet& aLists) override;
//==== BEGIN NSIFORMCONTROLFRAME //==== BEGIN NSIFORMCONTROLFRAME
void SetFocus(bool aOn, bool aRepaint) override; MOZ_CAN_RUN_SCRIPT_BOUNDARY void SetFocus(bool aOn, bool aRepaint) override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
SetFormProperty(nsAtom* aName, const nsAString& aValue) override; SetFormProperty(nsAtom* aName, const nsAString& aValue) override;

Просмотреть файл

@ -371,7 +371,7 @@ class nsFrameSelection final {
* *
* @param aState is the new state of drag * @param aState is the new state of drag
*/ */
MOZ_CAN_RUN_SCRIPT_BOUNDARY MOZ_CAN_RUN_SCRIPT
void SetDragState(bool aState); void SetDragState(bool aState);
/** /**

Просмотреть файл

@ -5043,14 +5043,12 @@ NS_IMETHODIMP nsIFrame::HandleDrag(nsPresContext* aPresContext,
* This static method handles part of the nsIFrame::HandleRelease in a way * This static method handles part of the nsIFrame::HandleRelease in a way
* which doesn't rely on the nsFrame object to stay alive. * which doesn't rely on the nsFrame object to stay alive.
*/ */
static nsresult HandleFrameSelection(nsFrameSelection* aFrameSelection, MOZ_CAN_RUN_SCRIPT_BOUNDARY static nsresult HandleFrameSelection(
nsIFrame::ContentOffsets& aOffsets, nsFrameSelection* aFrameSelection, nsIFrame::ContentOffsets& aOffsets,
bool aHandleTableSel, bool aHandleTableSel, int32_t aContentOffsetForTableSel,
int32_t aContentOffsetForTableSel, TableSelectionMode aTargetForTableSel,
TableSelectionMode aTargetForTableSel, nsIContent* aParentContentForTableSel, WidgetGUIEvent* aEvent,
nsIContent* aParentContentForTableSel, const nsEventStatus* aEventStatus) {
WidgetGUIEvent* aEvent,
const nsEventStatus* aEventStatus) {
if (!aFrameSelection) { if (!aFrameSelection) {
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -54,6 +54,7 @@
#include "LayoutConstants.h" #include "LayoutConstants.h"
#include "mozilla/layout/FrameChildList.h" #include "mozilla/layout/FrameChildList.h"
#include "mozilla/AspectRatio.h" #include "mozilla/AspectRatio.h"
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h" #include "mozilla/EventForwards.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/RelativeTo.h" #include "mozilla/RelativeTo.h"
@ -2164,9 +2165,9 @@ class nsIFrame : public nsQueryFrame {
// Selection Methods // Selection Methods
NS_IMETHOD HandlePress(nsPresContext* aPresContext, MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD
mozilla::WidgetGUIEvent* aEvent, HandlePress(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus); nsEventStatus* aEventStatus);
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext, NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent, mozilla::WidgetGUIEvent* aEvent,
@ -2178,9 +2179,9 @@ class nsIFrame : public nsQueryFrame {
mozilla::WidgetGUIEvent* aEvent, mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus); nsEventStatus* aEventStatus);
NS_IMETHOD HandleRelease(nsPresContext* aPresContext, MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD
mozilla::WidgetGUIEvent* aEvent, HandleRelease(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus); nsEventStatus* aEventStatus);
// Test if we are selecting a table object: // Test if we are selecting a table object:
// Most table/cell selection requires that Ctrl (Cmd on Mac) key is down // Most table/cell selection requires that Ctrl (Cmd on Mac) key is down