зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303) Backed out changeset bd2020c26531 (bug 1685303) Backed out changeset 3f2e96b93f19 (bug 1685303) Backed out changeset 8cf49a7677c9 (bug 1685303)
This commit is contained in:
Родитель
b687ddf139
Коммит
0700454a9e
|
@ -231,8 +231,7 @@ class nsFocusManager final : public nsIFocusManager,
|
|||
/**
|
||||
* Called when a window has been lowered.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void WindowLowered(mozIDOMWindowProxy* aWindow,
|
||||
uint64_t aActionId);
|
||||
void WindowLowered(mozIDOMWindowProxy* aWindow, uint64_t aActionId);
|
||||
|
||||
/**
|
||||
* Called when a new document in a window is shown.
|
||||
|
|
|
@ -258,7 +258,6 @@ interface nsISelectionController : nsISelectionDisplay
|
|||
* @param aForward forward or backward if PR_FALSE
|
||||
* @param aExtend should it collapse the selection of extend it?
|
||||
*/
|
||||
[can_run_script]
|
||||
void completeMove(in boolean forward, in boolean extend);
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "nsCOMArray.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/layers/APZPublicUtils.h"
|
||||
#include "Units.h"
|
||||
|
@ -1217,7 +1216,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
|
|||
void CreateClickHoldTimer(nsPresContext* aPresContext, nsIFrame* aDownFrame,
|
||||
WidgetGUIEvent* aMouseDownEvent);
|
||||
void KillClickHoldTimer();
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void FireContextClick();
|
||||
void FireContextClick();
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT static void SetPointerLock(nsIWidget* aWidget,
|
||||
nsIContent* aElement);
|
||||
|
|
|
@ -340,14 +340,12 @@ class TextInputSelectionController final : public nsSupportsWeakReference,
|
|||
bool aExtend) override;
|
||||
NS_IMETHOD CharacterMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD WordMove(bool aForward, bool aExtend) override;
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD LineMove(bool aForward,
|
||||
bool aExtend) override;
|
||||
NS_IMETHOD LineMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) override;
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
NS_IMETHOD PageMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD CompleteScroll(bool aForward) override;
|
||||
MOZ_CAN_RUN_SCRIPT NS_IMETHOD CompleteMove(bool aForward,
|
||||
bool aExtend) override;
|
||||
NS_IMETHOD CompleteMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD ScrollPage(bool aForward) override;
|
||||
NS_IMETHOD ScrollLine(bool aForward) override;
|
||||
NS_IMETHOD ScrollCharacter(bool aRight) override;
|
||||
|
@ -701,11 +699,10 @@ TextInputSelectionController::CompleteMove(bool aForward, bool aExtend) {
|
|||
}
|
||||
}
|
||||
|
||||
const RefPtr<nsIContent> pinnedParentDIV{parentDIV};
|
||||
const nsFrameSelection::FocusMode focusMode =
|
||||
aExtend ? nsFrameSelection::FocusMode::kExtendSelection
|
||||
: nsFrameSelection::FocusMode::kCollapseToNewPoint;
|
||||
frameSelection->HandleClick(pinnedParentDIV, offset, offset, focusMode, hint);
|
||||
frameSelection->HandleClick(parentDIV, offset, offset, focusMode, hint);
|
||||
|
||||
// if we got this far, attempt to scroll no matter what the above result is
|
||||
return CompleteScroll(aForward);
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "AccessibleCaret.h"
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/CaretStateChangedEvent.h"
|
||||
#include "mozilla/dom/MouseEventBinding.h"
|
||||
#include "mozilla/EnumSet.h"
|
||||
|
@ -192,7 +191,7 @@ class AccessibleCaretManager {
|
|||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
nsresult SelectWord(nsIFrame* aFrame, const nsPoint& aPoint) const;
|
||||
MOZ_CAN_RUN_SCRIPT void SetSelectionDragState(bool aState) const;
|
||||
void SetSelectionDragState(bool aState) const;
|
||||
|
||||
// Return true if the candidate string is a phone number.
|
||||
bool IsPhoneNumber(nsAString& aCandidate) const;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "mozilla/RangeUtils.h"
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticAnalysisFunctions.h"
|
||||
#include "mozilla/StaticPrefs_apz.h"
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
#include "mozilla/StaticPrefs_font.h"
|
||||
|
@ -2468,8 +2467,7 @@ PresShell::CompleteMove(bool aForward, bool aExtend) {
|
|||
aExtend ? nsFrameSelection::FocusMode::kExtendSelection
|
||||
: nsFrameSelection::FocusMode::kCollapseToNewPoint;
|
||||
frameSelection->HandleClick(
|
||||
MOZ_KnownLive(pos.mResultContent) /* bug 1636889 */, pos.mContentOffset,
|
||||
pos.mContentOffset, focusMode,
|
||||
pos.mResultContent, pos.mContentOffset, pos.mContentOffset, focusMode,
|
||||
aForward ? CARET_ASSOCIATE_AFTER : CARET_ASSOCIATE_BEFORE);
|
||||
if (limiter) {
|
||||
// HandleClick resets ancestorLimiter, so set it again.
|
||||
|
@ -6878,12 +6876,12 @@ nsresult PresShell::EventHandler::HandleEvent(nsIFrame* aFrameForPresShell,
|
|||
|
||||
if (MaybeHandleEventWithAccessibleCaret(aFrameForPresShell, aGUIEvent,
|
||||
aEventStatus)) {
|
||||
// Handled by AccessibleCaretEventHub.
|
||||
// Probably handled by AccessibleCaretEventHub.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (MaybeDiscardEvent(aGUIEvent)) {
|
||||
// Cannot handle the event for now.
|
||||
// Nobody cannot handle the event for now.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1319,10 +1319,8 @@ class PresShell final : public nsStubDocumentObserver,
|
|||
NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount,
|
||||
bool aExtend) override;
|
||||
NS_IMETHOD CharacterMove(bool aForward, bool aExtend) override;
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD WordMove(bool aForward,
|
||||
bool aExtend) override;
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD LineMove(bool aForward,
|
||||
bool aExtend) override;
|
||||
NS_IMETHOD WordMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD LineMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) override;
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
NS_IMETHOD PageMove(bool aForward, bool aExtend) override;
|
||||
|
@ -1330,8 +1328,7 @@ class PresShell final : public nsStubDocumentObserver,
|
|||
NS_IMETHOD ScrollLine(bool aForward) override;
|
||||
NS_IMETHOD ScrollCharacter(bool aRight) override;
|
||||
NS_IMETHOD CompleteScroll(bool aForward) override;
|
||||
MOZ_CAN_RUN_SCRIPT NS_IMETHOD CompleteMove(bool aForward,
|
||||
bool aExtend) override;
|
||||
NS_IMETHOD CompleteMove(bool aForward, bool aExtend) override;
|
||||
NS_IMETHOD CheckVisibility(nsINode* node, int16_t startOffset,
|
||||
int16_t EndOffset, bool* _retval) override;
|
||||
nsresult CheckVisibilityContent(nsIContent* aNode, int16_t aStartOffset,
|
||||
|
@ -1884,7 +1881,7 @@ class PresShell final : public nsStubDocumentObserver,
|
|||
// Utility method to restore the root scrollframe state
|
||||
void RestoreRootScrollPosition();
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void MaybeReleaseCapturingContent();
|
||||
void MaybeReleaseCapturingContent();
|
||||
|
||||
class DelayedEvent {
|
||||
public:
|
||||
|
|
|
@ -135,7 +135,7 @@ class nsTextControlFrame : public nsContainerFrame,
|
|||
const nsDisplayListSet& aLists) override;
|
||||
|
||||
//==== BEGIN NSIFORMCONTROLFRAME
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void SetFocus(bool aOn, bool aRepaint) override;
|
||||
void SetFocus(bool aOn, bool aRepaint) override;
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
|
||||
SetFormProperty(nsAtom* aName, const nsAString& aValue) override;
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ class nsFrameSelection final {
|
|||
* @param aHint will tell the selection which direction geometrically to
|
||||
* actually show the caret on. 1 = end of this line 0 = beginning of this line
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT nsresult HandleClick(nsIContent* aNewFocus,
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult HandleClick(nsIContent* aNewFocus,
|
||||
uint32_t aContentOffset,
|
||||
uint32_t aContentEndOffset,
|
||||
FocusMode aFocusMode,
|
||||
|
@ -256,6 +256,7 @@ class nsFrameSelection final {
|
|||
*
|
||||
* @param aPoint is relative to aFrame
|
||||
*/
|
||||
// TODO: replace with `MOZ_CAN_RUN_SCRIPT`.
|
||||
MOZ_CAN_RUN_SCRIPT void HandleDrag(nsIFrame* aFrame, const nsPoint& aPoint);
|
||||
|
||||
/**
|
||||
|
@ -370,7 +371,7 @@ class nsFrameSelection final {
|
|||
*
|
||||
* @param aState is the new state of drag
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
void SetDragState(bool aState);
|
||||
|
||||
/**
|
||||
|
@ -630,17 +631,17 @@ class nsFrameSelection final {
|
|||
* by the selection during MouseDown processing. It can be nullptr
|
||||
* if the data is no longer valid.
|
||||
*/
|
||||
bool HasDelayedCaretData() const { return mDelayedMouseEvent.mIsValid; }
|
||||
bool IsShiftDownInDelayedCaretData() const {
|
||||
bool HasDelayedCaretData() { return mDelayedMouseEvent.mIsValid; }
|
||||
bool IsShiftDownInDelayedCaretData() {
|
||||
NS_ASSERTION(mDelayedMouseEvent.mIsValid, "No valid delayed caret data");
|
||||
return mDelayedMouseEvent.mIsShift;
|
||||
}
|
||||
uint32_t GetClickCountInDelayedCaretData() const {
|
||||
uint32_t GetClickCountInDelayedCaretData() {
|
||||
NS_ASSERTION(mDelayedMouseEvent.mIsValid, "No valid delayed caret data");
|
||||
return mDelayedMouseEvent.mClickCount;
|
||||
}
|
||||
|
||||
bool MouseDownRecorded() const {
|
||||
bool MouseDownRecorded() {
|
||||
return !GetDragState() && HasDelayedCaretData() &&
|
||||
GetClickCountInDelayedCaretData() < 2;
|
||||
}
|
||||
|
|
|
@ -5043,11 +5043,13 @@ NS_IMETHODIMP nsIFrame::HandleDrag(nsPresContext* aPresContext,
|
|||
* This static method handles part of the nsIFrame::HandleRelease in a way
|
||||
* which doesn't rely on the nsFrame object to stay alive.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY static nsresult HandleFrameSelection(
|
||||
nsFrameSelection* aFrameSelection, nsIFrame::ContentOffsets& aOffsets,
|
||||
bool aHandleTableSel, int32_t aContentOffsetForTableSel,
|
||||
static nsresult HandleFrameSelection(nsFrameSelection* aFrameSelection,
|
||||
nsIFrame::ContentOffsets& aOffsets,
|
||||
bool aHandleTableSel,
|
||||
int32_t aContentOffsetForTableSel,
|
||||
TableSelectionMode aTargetForTableSel,
|
||||
nsIContent* aParentContentForTableSel, WidgetGUIEvent* aEvent,
|
||||
nsIContent* aParentContentForTableSel,
|
||||
WidgetGUIEvent* aEvent,
|
||||
const nsEventStatus* aEventStatus) {
|
||||
if (!aFrameSelection) {
|
||||
return NS_OK;
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "LayoutConstants.h"
|
||||
#include "mozilla/layout/FrameChildList.h"
|
||||
#include "mozilla/AspectRatio.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/RelativeTo.h"
|
||||
|
@ -2151,9 +2150,10 @@ class nsIFrame : public nsQueryFrame {
|
|||
nsSelectionAmount aEndAmountType,
|
||||
uint32_t aSelectFlags);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult PeekBackwardAndForward(
|
||||
nsSelectionAmount aAmountBack, nsSelectionAmount aAmountForward,
|
||||
int32_t aStartPos, bool aJumpLines, uint32_t aSelectFlags);
|
||||
nsresult PeekBackwardAndForward(nsSelectionAmount aAmountBack,
|
||||
nsSelectionAmount aAmountForward,
|
||||
int32_t aStartPos, bool aJumpLines,
|
||||
uint32_t aSelectFlags);
|
||||
|
||||
enum { SELECT_ACCUMULATE = 0x01 };
|
||||
|
||||
|
@ -2164,8 +2164,8 @@ class nsIFrame : public nsQueryFrame {
|
|||
|
||||
// Selection Methods
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD
|
||||
HandlePress(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent,
|
||||
NS_IMETHOD HandlePress(nsPresContext* aPresContext,
|
||||
mozilla::WidgetGUIEvent* aEvent,
|
||||
nsEventStatus* aEventStatus);
|
||||
|
||||
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
||||
|
@ -2178,8 +2178,8 @@ class nsIFrame : public nsQueryFrame {
|
|||
mozilla::WidgetGUIEvent* aEvent,
|
||||
nsEventStatus* aEventStatus);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD
|
||||
HandleRelease(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent,
|
||||
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
||||
mozilla::WidgetGUIEvent* aEvent,
|
||||
nsEventStatus* aEventStatus);
|
||||
|
||||
// Test if we are selecting a table object:
|
||||
|
|
|
@ -3578,7 +3578,7 @@ void SVGTextFrame::SelectSubString(nsIContent* aContent, uint32_t charnum,
|
|||
return;
|
||||
}
|
||||
charnum = chit.TextElementCharIndex();
|
||||
const RefPtr<nsIContent> content = chit.TextFrame()->GetContent();
|
||||
nsIContent* content = chit.TextFrame()->GetContent();
|
||||
chit.NextWithinSubtree(nchars);
|
||||
nchars = chit.TextElementCharIndex() - charnum;
|
||||
|
||||
|
|
|
@ -236,9 +236,7 @@ class SVGTextFrame final : public SVGDisplayContainerFrame {
|
|||
// SVG DOM text methods:
|
||||
uint32_t GetNumberOfChars(nsIContent* aContent);
|
||||
float GetComputedTextLength(nsIContent* aContent);
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void SelectSubString(nsIContent* aContent,
|
||||
uint32_t charnum,
|
||||
uint32_t nchars,
|
||||
void SelectSubString(nsIContent* aContent, uint32_t charnum, uint32_t nchars,
|
||||
ErrorResult& aRv);
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
float GetSubStringLength(nsIContent* aContent, uint32_t charnum,
|
||||
|
|
Загрузка…
Ссылка в новой задаче