Bug 1671768 - Part 1: Use MOZ_CAN_RUN_SCRIPT for Selection::StyledRanges::MaybeFocusCommonEditingHost r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D103777
This commit is contained in:
Kagami Sascha Rosylight 2021-02-03 21:52:02 +00:00
Родитель 2cdca4441a
Коммит 03a9abe590
2 изменённых файлов: 3 добавлений и 2 удалений

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

@ -3130,7 +3130,8 @@ nsresult Selection::NotifySelectionListeners() {
// browsers don't do it either. // browsers don't do it either.
if (mSelectionType == SelectionType::eNormal && if (mSelectionType == SelectionType::eNormal &&
calledByJSRestorer.SavedValue()) { calledByJSRestorer.SavedValue()) {
mStyledRanges.MaybeFocusCommonEditingHost(GetPresShell()); RefPtr<PresShell> presShell = GetPresShell();
mStyledRanges.MaybeFocusCommonEditingHost(presShell);
} }
RefPtr<nsFrameSelection> frameSelection = mFrameSelection; RefPtr<nsFrameSelection> frameSelection = mFrameSelection;

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

@ -860,7 +860,7 @@ class Selection final : public nsSupportsWeakReference,
*/ */
Element* GetCommonEditingHost() const; Element* GetCommonEditingHost() const;
MOZ_CAN_RUN_SCRIPT_BOUNDARY void MaybeFocusCommonEditingHost( MOZ_CAN_RUN_SCRIPT void MaybeFocusCommonEditingHost(
PresShell* aPresShell) const; PresShell* aPresShell) const;
static nsresult SubtractRange(StyledRange& aRange, nsRange& aSubtract, static nsresult SubtractRange(StyledRange& aRange, nsRange& aSubtract,