diff options
author | Liang Qi <liang.qi@qt.io> | 2017-07-04 15:29:25 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-07-04 15:30:15 +0200 |
commit | db2ecc45564609f940ff564e777f76a1a4b734d4 (patch) | |
tree | d4756dffb486a2a1c64f13402bafd0327b7ddbb3 /Source/WebCore/editing/Editor.cpp | |
parent | 8231f9776c2e4028937411bd2a0886aa72c97831 (diff) | |
parent | d10511e0a3f655ab2b1dfebfd9c17ade151a7cfe (diff) |
Merge remote-tracking branch 'origin/5.212' into dev
Change-Id: I006cd9023fadc5407bbaa2ddfda45cb8e88b548b
Diffstat (limited to 'Source/WebCore/editing/Editor.cpp')
-rw-r--r-- | Source/WebCore/editing/Editor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp index cdbfbda74..41a9730ab 100644 --- a/Source/WebCore/editing/Editor.cpp +++ b/Source/WebCore/editing/Editor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2011, 2013-2015 Apple Inc. All rights reserved. + * Copyright (C) 2006-2008, 2011, 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without @@ -1743,6 +1743,8 @@ void Editor::setComposition(const String& text, SetCompositionMode mode) void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd) { + Ref<Frame> protection(m_frame); + UserTypingGestureIndicator typingGestureIndicator(m_frame); setIgnoreCompositionSelectionChange(true); @@ -1876,6 +1878,8 @@ void Editor::learnSpelling() #if !PLATFORM(IOS) void Editor::advanceToNextMisspelling(bool startBeforeSelection) { + Ref<Frame> protection(m_frame); + // The basic approach is to search in two phases - from the selection end to the end of the doc, and // then we wrap and search from the doc start to (approximately) where we started. @@ -2191,6 +2195,8 @@ void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelecti void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement) { + Ref<Frame> protection(m_frame); + #if PLATFORM(IOS) UNUSED_PARAM(selectionAfterTyping); UNUSED_PARAM(doReplacement); @@ -2437,6 +2443,7 @@ static void correctSpellcheckingPreservingTextCheckingParagraph(TextCheckingPara void Editor::markAndReplaceFor(PassRefPtr<SpellCheckRequest> request, const Vector<TextCheckingResult>& results) { + Ref<Frame> protection(m_frame); ASSERT(request); TextCheckingTypeMask textCheckingOptions = request->data().mask(); @@ -2889,6 +2896,8 @@ void Editor::dismissCorrectionPanelAsIgnored() void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions options, AXTextStateChangeIntent intent) { + Ref<Frame> protection(m_frame); + // If the new selection is orphaned, then don't update the selection. if (newSelection.start().isOrphan() || newSelection.end().isOrphan()) return; @@ -3079,6 +3088,8 @@ void Editor::applyEditingStyleToElement(Element* element) const bool Editor::findString(const String& target, FindOptions options) { + Ref<Frame> protection(m_frame); + VisibleSelection selection = m_frame.selection().selection(); RefPtr<Range> resultRange = rangeOfString(target, selection.firstRange().get(), options); |