Commit b4170928 authored by andersca@apple.com's avatar andersca@apple.com

Frame::editor() should return a reference

https://bugs.webkit.org/show_bug.cgi?id=116037

Reviewed by Darin Adler.

Source/WebCore:

A frame's editor can never be null. Change Frame::editor() to return a reference to reflect this.
Also, make Frame::m_editor a const member variable so nobody will accidentally set it to null.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasMisspelling):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes):
* dom/Document.cpp:
(WebCore::acceptsEditingFocus):
(WebCore::Document::setFocusedNode):
(WebCore::command):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired):
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteButton.cpp:
(WebCore::DeleteButton::defaultEventHandler):
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::show):
* editing/DeleteButtonController.h:
(WebCore::DeleteButtonControllerDisableScope::DeleteButtonControllerDisableScope):
(WebCore::DeleteButtonControllerDisableScope::~DeleteButtonControllerDisableScope):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::mergeParagraphs):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* editing/EditorCommand.cpp:
(WebCore::applyCommandToFrame):
(WebCore::executeToggleStyle):
(WebCore::executeApplyParagraphStyle):
(WebCore::expandSelectionToGranularity):
(WebCore::stateStyle):
(WebCore::valueStyle):
(WebCore::executeCopy):
(WebCore::executeCut):
(WebCore::executeDefaultParagraphSeparator):
(WebCore::executeDelete):
(WebCore::executeDeleteBackward):
(WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
(WebCore::executeDeleteForward):
(WebCore::executeDeleteToBeginningOfLine):
(WebCore::executeDeleteToBeginningOfParagraph):
(WebCore::executeDeleteToEndOfLine):
(WebCore::executeDeleteToEndOfParagraph):
(WebCore::executeDeleteToMark):
(WebCore::executeDeleteWordBackward):
(WebCore::executeDeleteWordForward):
(WebCore::executeFindString):
(WebCore::executeForwardDelete):
(WebCore::executeIgnoreSpelling):
(WebCore::executeInsertNewline):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
(WebCore::executeToggleOverwrite):
(WebCore::executePaste):
(WebCore::executePasteGlobalSelection):
(WebCore::executePasteAndMatchStyle):
(WebCore::executePasteAsPlainText):
(WebCore::executeRedo):
(WebCore::executeRemoveFormat):
(WebCore::executeSelectToMark):
(WebCore::executeSetMark):
(WebCore::executeStyleWithCSS):
(WebCore::executeUseCSS):
(WebCore::executeSwapWithMark):
(WebCore::executeTakeFindStringFromSelection):
(WebCore::executeTranspose):
(WebCore::executeUndo):
(WebCore::executeYank):
(WebCore::executeYankAndSelect):
(WebCore::supportedCopyCut):
(WebCore::supportedPaste):
(WebCore::enabledVisibleSelection):
(WebCore::enabledVisibleSelectionAndMark):
(WebCore::enableCaretInEditableText):
(WebCore::enabledCopy):
(WebCore::enabledCut):
(WebCore::enabledInEditableText):
(WebCore::enabledDelete):
(WebCore::enabledPaste):
(WebCore::enabledRedo):
(WebCore::enabledTakeFindStringFromSelection):
(WebCore::enabledUndo):
(WebCore::stateOrderedList):
(WebCore::stateStyleWithCSS):
(WebCore::stateUnorderedList):
(WebCore::valueDefaultParagraphSeparator):
* editing/FrameSelection.cpp:
(WebCore::shouldAlwaysUseDirectionalSelection):
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::nextWordPositionForPlatform):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modify):
(WebCore::shouldStopBlinkingDueToTypingCommand):
(WebCore::FrameSelection::shouldDeleteSelection):
(WebCore::FrameSelection::shouldChangeSelection):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheck):
* editing/SpellingCorrectionCommand.cpp:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::typingAddedToOpenCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/htmlediting.cpp:
(WebCore::createDefaultParagraphElement):
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
* editing/markup.cpp:
(WebCore::createMarkup):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::endEditing):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::subtreeHasChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::clear):
* page/ContextMenuController.cpp:
(WebCore::insertUnicodeCharacter):
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find):
* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::handlePasteGlobalSelection):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::keyEvent):
(WebCore::EventHandler::defaultKeyboardEventHandler):
(WebCore::EventHandler::defaultTextInputEventHandler):
(WebCore::EventHandler::defaultBackspaceEventHandler):
* page/FocusController.cpp:
(WebCore::relinquishesEditingFocus):
* page/Frame.cpp:
(WebCore::Frame::rangeForPoint):
* page/Frame.h:
(Frame):
(WebCore::Frame::editor):
* page/Page.cpp:
(WebCore::Page::findString):
(WebCore::Page::findStringMatchingRanges):
(WebCore::Page::rangeOfString):
(WebCore::Page::markAllMatchesForText):
(WebCore::Page::setDeviceScaleFactor):
* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::writeRange):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asURL):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::getStringSelection):
(WebCore::Pasteboard::getDataSelection):
(WebCore::Pasteboard::writeSelectionForTypes):
(WebCore::writeURLForTypes):
(WebCore::Pasteboard::plainText):
(WebCore::documentFragmentWithRTF):
(WebCore::Pasteboard::documentFragment):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::dictationAlternatives):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintTextMatchMarker):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPointWithInlineChildren):
* testing/Internals.cpp:
(WebCore::spellchecker):
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::hasSpellingMarker):
(WebCore::Internals::hasAutocorrectedMarker):
(WebCore::Internals::setContinuousSpellCheckingEnabled):
(WebCore::Internals::setAutomaticQuoteSubstitutionEnabled):
(WebCore::Internals::setAutomaticLinkDetectionEnabled):
(WebCore::Internals::setAutomaticDashSubstitutionEnabled):
(WebCore::Internals::setAutomaticTextReplacementEnabled):
(WebCore::Internals::setAutomaticSpellingCorrectionEnabled):
(WebCore::Internals::isOverwriteModeEnabled):
(WebCore::Internals::toggleOverwriteModeEnabled):
(WebCore::Internals::hasGrammarMarker):

Source/WebKit/blackberry:

* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField):
(WebCore::EditorClientBlackBerry::handleKeyboardEvent):
* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::elementHasContinuousSpellCheckingEnabled):
* WebKitSupport/InPageSearchManager.cpp:
(BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
(BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectedText):

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::executeCoreCommandByName):
(DumpRenderTreeSupportEfl::isCommandEnabled):
* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::respondToChangedSelection):
(WebCore::EditorClientEfl::handleEditingKeyboardEvent):
* ewk/ewk_frame.cpp:
(ewk_frame_editable_set):
(ewk_frame_selection_get):
(ewk_frame_text_search):
(ewk_frame_text_matches_mark):
(ewk_frame_text_matches_highlight_set):
(ewk_frame_text_matches_highlight_get):
* ewk/ewk_view.cpp:
(ewk_view_selection_get):
(ewk_view_editor_command_execute):

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::paint):
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::executeCoreCommandByName):
(DumpRenderTreeSupportGtk::isCommandEnabled):
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::respondToChangedSelection):
(WebKit::EditorClient::executePendingEditorCommands):
(WebKit::EditorClient::handleKeyboardEvent):
* WebCoreSupport/WebViewInputMethodFilter.cpp:
(WebKit::WebViewInputMethodFilter::canEdit):
(WebKit::WebViewInputMethodFilter::confirmCompositionText):
(WebKit::WebViewInputMethodFilter::confirmCurrentComposition):
(WebKit::WebViewInputMethodFilter::cancelCurrentComposition):
(WebKit::WebViewInputMethodFilter::setPreedit):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_replace_selection):
* webkit/webkitwebview.cpp:
(getLocationForKeyboardGeneratedContextMenu):
(webkit_web_view_focus_in_event):
(webkit_web_view_real_select_all):
(webkit_web_view_real_cut_clipboard):
(webkit_web_view_real_copy_clipboard):
(webkit_web_view_real_undo):
(webkit_web_view_real_redo):
(webkit_web_view_real_paste_clipboard):
(webkit_web_view_set_highlight_text_matches):
(webkit_web_view_can_cut_clipboard):
(webkit_web_view_can_copy_clipboard):
(webkit_web_view_can_paste_clipboard):
(webkit_web_view_delete_selection):
(webkit_web_view_set_editable):
(webkit_web_view_can_undo):
(webkit_web_view_can_redo):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _selectedString]):
(-[WebFrame _firstRectForDOMRange:]):
(-[WebFrame _markDOMRange]):
(-[WebFrame _insertParagraphSeparatorInQuotedContent]):
(-[WebFrame _setTypingStyle:withUndoAction:]):
(-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
* WebView/WebHTMLRepresentation.mm:
(-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _pasteWithPasteboard:allowPlainText:]):
(-[WebHTMLView _shouldDeleteRange:]):
(-[WebHTMLView _canEdit]):
(-[WebHTMLView _canEditRichly]):
(-[WebHTMLView _insertOrderedList]):
(-[WebHTMLView _insertUnorderedList]):
(-[WebHTMLView _canIncreaseSelectionListLevel]):
(-[WebHTMLView _canDecreaseSelectionListLevel]):
(-[WebHTMLView _increaseSelectionListLevel]):
(-[WebHTMLView _increaseSelectionListLevelOrdered]):
(-[WebHTMLView _increaseSelectionListLevelUnordered]):
(-[WebHTMLView _decreaseSelectionListLevel]):
(-[WebHTMLView Editor::coreCommandBySelector:]):
(-[WebHTMLView Editor::coreCommandByName:]):
(-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
(-[WebHTMLView becomeFirstResponder]):
(-[WebHTMLView _selectionStartFontAttributesAsRTF]):
(-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
(-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
(-[WebHTMLView checkSpelling:]):
(-[WebHTMLView showGuessPanel:]):
(-[WebHTMLView toggleBaseWritingDirection:]):
(-[WebHTMLView changeBaseWritingDirection:]):
(-[WebHTMLView _changeBaseWritingDirectionTo:]):
(-[WebHTMLView _updateFontPanel]):
(-[WebHTMLView markedRange]):
(-[WebHTMLView hasMarkedText]):
(-[WebHTMLView unmarkText]):
(-[WebHTMLView setMarkedText:selectedRange:]):
(-[WebHTMLView doCommandBySelector:]):
(-[WebHTMLView insertText:]):
(-[WebHTMLView _updateSelectionForInputManager]):
(-[WebHTMLView countMatchesForText:inDOMRange:options:limit:markMatches:]):
(-[WebHTMLView setMarkedTextMatchesAreHighlighted:]):
(-[WebHTMLView markedTextMatchesAreHighlighted]):
(-[WebHTMLView _findString:options:]):
* WebView/WebView.mm:
(-[WebView _executeCoreCommandByName:value:]):
(-[WebView editableDOMRangeForPoint:]):
(-[WebView setEditable:]):
(-[WebView deleteSelection]):
(-[WebView applyStyle:]):
(-[WebView typingAttributes]):
(-[WebView _simplifyMarkup:endNode:]):
(-[WebView handleAcceptedAlternativeText:]):

Source/WebKit/qt:

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::executeCoreCommandByName):
(DumpRenderTreeSupportQt::isCommandEnabled):
(DumpRenderTreeSupportQt::firstRectForCharacterRange):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::respondToChangedSelection):
(WebCore::EditorClientQt::registerUndoStep):
(WebCore::EditorClientQt::handleKeyboardEvent):
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::selectedText):
(QWebPageAdapter::selectedHtml):
(QWebPageAdapter::setContentEditable):

Source/WebKit/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):
* WebFrame.cpp:
(WebFrame::hasSpellingMarker):
(WebFrame::setTextDirection):
(WebFrame::selectedString):
(WebFrame::selectAll):
* WebView.cpp:
(WebView::execCommand):
(WebView::handleEditingKeyboardEvent):
(WebView::executeCoreCommandByName):
(WebView::selectedText):
(WebView::deleteEnabled):
(WebView::editingEnabled):
(WebView::replaceSelectionWithText):
(WebView::copy):
(WebView::cut):
(WebView::paste):
(WebView::copyURL):
(WebView::delete_):
(WebView::checkSpelling):
(WebView::showGuessPanel):
(WebView::clearUndoRedoOperations):
(WebView::prepareCandidateWindow):
(WebView::resetIME):
(WebView::updateSelectionForIME):
(WebView::onIMEComposition):
(WebView::onIMEEndComposition):
(WebView::onIMERequestCharPosition):
(WebView::onIMERequest):
(WebView::setCompositionForTesting):
(WebView::hasCompositionForTesting):
(WebView::confirmCompositionForTesting):
(WebView::compositionRangeForTesting):
(WebView::firstRectForCharacterRangeForTesting):
(WebView::selectedRangeForTesting):

Source/WebKit/wince:

* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::handleEditingKeyboardEvent):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit::WebContextMenuClient::searchWithGoogle):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):
* WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::executePendingEditorCommands):
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
(WebKit::WebContextMenuClient::searchWithGoogle):
(WebKit::WebContextMenuClient::searchWithSpotlight):
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::changeWordCase):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::selectionAsString):
(WebKit::WebFrame::setTextDirection):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
(WebKit::WebPage::executeEditingCommand):
(WebKit::WebPage::isEditingCommandEnabled):
(WebKit::WebPage::validateCommand):
(WebKit::WebPage::handleEditingKeyboardEvent):
(WebKit::WebPage::advanceToNextMisspelling):
(WebKit::WebPage::uppercaseWord):
(WebKit::WebPage::lowercaseWord):
(WebKit::WebPage::capitalizeWord):
(WebKit::WebPage::replaceSelectionWithText):
(WebKit::WebPage::handleAlternativeTextUIResult):
(WebKit::WebPage::setCompositionForTesting):
(WebKit::WebPage::hasCompositionForTesting):
(WebKit::WebPage::confirmCompositionForTesting):
(WebKit::WebPage::setComposition):
(WebKit::WebPage::cancelComposition):
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::confirmComposition):
(WebKit::WebPage::setComposition):
(WebKit::WebPage::cancelComposition):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):
(WebKit::WebPage::handleEditingKeyboardEvent):
(WebKit::WebPage::setComposition):
(WebKit::WebPage::confirmComposition):
(WebKit::WebPage::cancelComposition):
(WebKit::WebPage::insertText):
(WebKit::WebPage::insertDictatedText):
(WebKit::WebPage::getMarkedRange):
(WebKit::WebPage::firstRectForCharacterRange):
(WebKit::WebPage::readSelectionFromPasteboard):
(WebKit::WebPage::getStringSelectionForPasteboard):
(WebKit::WebPage::getDataSelectionForPasteboard):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 59c55963
2013-05-13 Anders Carlsson <andersca@apple.com>
Frame::editor() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=116037
Reviewed by Darin Adler.
A frame's editor can never be null. Change Frame::editor() to return a reference to reflect this.
Also, make Frame::m_editor a const member variable so nobody will accidentally set it to null.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasMisspelling):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes):
* dom/Document.cpp:
(WebCore::acceptsEditingFocus):
(WebCore::Document::setFocusedNode):
(WebCore::command):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired):
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteButton.cpp:
(WebCore::DeleteButton::defaultEventHandler):
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::show):
* editing/DeleteButtonController.h:
(WebCore::DeleteButtonControllerDisableScope::DeleteButtonControllerDisableScope):
(WebCore::DeleteButtonControllerDisableScope::~DeleteButtonControllerDisableScope):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::mergeParagraphs):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* editing/EditorCommand.cpp:
(WebCore::applyCommandToFrame):
(WebCore::executeToggleStyle):
(WebCore::executeApplyParagraphStyle):
(WebCore::expandSelectionToGranularity):
(WebCore::stateStyle):
(WebCore::valueStyle):
(WebCore::executeCopy):
(WebCore::executeCut):
(WebCore::executeDefaultParagraphSeparator):
(WebCore::executeDelete):
(WebCore::executeDeleteBackward):
(WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
(WebCore::executeDeleteForward):
(WebCore::executeDeleteToBeginningOfLine):
(WebCore::executeDeleteToBeginningOfParagraph):
(WebCore::executeDeleteToEndOfLine):
(WebCore::executeDeleteToEndOfParagraph):
(WebCore::executeDeleteToMark):
(WebCore::executeDeleteWordBackward):
(WebCore::executeDeleteWordForward):
(WebCore::executeFindString):
(WebCore::executeForwardDelete):
(WebCore::executeIgnoreSpelling):
(WebCore::executeInsertNewline):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
(WebCore::executeToggleOverwrite):
(WebCore::executePaste):
(WebCore::executePasteGlobalSelection):
(WebCore::executePasteAndMatchStyle):
(WebCore::executePasteAsPlainText):
(WebCore::executeRedo):
(WebCore::executeRemoveFormat):
(WebCore::executeSelectToMark):
(WebCore::executeSetMark):
(WebCore::executeStyleWithCSS):
(WebCore::executeUseCSS):
(WebCore::executeSwapWithMark):
(WebCore::executeTakeFindStringFromSelection):
(WebCore::executeTranspose):
(WebCore::executeUndo):
(WebCore::executeYank):
(WebCore::executeYankAndSelect):
(WebCore::supportedCopyCut):
(WebCore::supportedPaste):
(WebCore::enabledVisibleSelection):
(WebCore::enabledVisibleSelectionAndMark):
(WebCore::enableCaretInEditableText):
(WebCore::enabledCopy):
(WebCore::enabledCut):
(WebCore::enabledInEditableText):
(WebCore::enabledDelete):
(WebCore::enabledPaste):
(WebCore::enabledRedo):
(WebCore::enabledTakeFindStringFromSelection):
(WebCore::enabledUndo):
(WebCore::stateOrderedList):
(WebCore::stateStyleWithCSS):
(WebCore::stateUnorderedList):
(WebCore::valueDefaultParagraphSeparator):
* editing/FrameSelection.cpp:
(WebCore::shouldAlwaysUseDirectionalSelection):
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::nextWordPositionForPlatform):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modify):
(WebCore::shouldStopBlinkingDueToTypingCommand):
(WebCore::FrameSelection::shouldDeleteSelection):
(WebCore::FrameSelection::shouldChangeSelection):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheck):
* editing/SpellingCorrectionCommand.cpp:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::typingAddedToOpenCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/htmlediting.cpp:
(WebCore::createDefaultParagraphElement):
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
* editing/markup.cpp:
(WebCore::createMarkup):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::endEditing):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::subtreeHasChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::clear):
* page/ContextMenuController.cpp:
(WebCore::insertUnicodeCharacter):
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find):
* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::handlePasteGlobalSelection):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::keyEvent):
(WebCore::EventHandler::defaultKeyboardEventHandler):
(WebCore::EventHandler::defaultTextInputEventHandler):
(WebCore::EventHandler::defaultBackspaceEventHandler):
* page/FocusController.cpp:
(WebCore::relinquishesEditingFocus):
* page/Frame.cpp:
(WebCore::Frame::rangeForPoint):
* page/Frame.h:
(Frame):
(WebCore::Frame::editor):
* page/Page.cpp:
(WebCore::Page::findString):
(WebCore::Page::findStringMatchingRanges):
(WebCore::Page::rangeOfString):
(WebCore::Page::markAllMatchesForText):
(WebCore::Page::setDeviceScaleFactor):
* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::writeRange):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asURL):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::getStringSelection):
(WebCore::Pasteboard::getDataSelection):
(WebCore::Pasteboard::writeSelectionForTypes):
(WebCore::writeURLForTypes):
(WebCore::Pasteboard::plainText):
(WebCore::documentFragmentWithRTF):
(WebCore::Pasteboard::documentFragment):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::dictationAlternatives):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintTextMatchMarker):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPointWithInlineChildren):
* testing/Internals.cpp:
(WebCore::spellchecker):
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::hasSpellingMarker):
(WebCore::Internals::hasAutocorrectedMarker):
(WebCore::Internals::setContinuousSpellCheckingEnabled):
(WebCore::Internals::setAutomaticQuoteSubstitutionEnabled):
(WebCore::Internals::setAutomaticLinkDetectionEnabled):
(WebCore::Internals::setAutomaticDashSubstitutionEnabled):
(WebCore::Internals::setAutomaticTextReplacementEnabled):
(WebCore::Internals::setAutomaticSpellingCorrectionEnabled):
(WebCore::Internals::isOverwriteModeEnabled):
(WebCore::Internals::toggleOverwriteModeEnabled):
(WebCore::Internals::hasGrammarMarker):
2013-05-15 Darin Adler <darin@apple.com>
[Mac] Make Clipboard class no longer polymorphic by removing the last virtual functions
......
......@@ -320,11 +320,9 @@ bool AccessibilityObject::hasMisspelling() const
if (!frame)
return false;
Editor* editor = frame->editor();
if (!editor)
return false;
Editor& editor = frame->editor();
TextCheckerClient* textChecker = editor->textChecker();
TextCheckerClient* textChecker = editor.textChecker();
if (!textChecker)
return false;
......
......@@ -79,7 +79,7 @@ static void webkitAccessibleEditableTextInsertText(AtkEditableText* text, const
coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(*position, 0)));
coreObject->setFocused(true);
// FIXME: We should set position to the actual inserted text length, which may be less than that requested.
if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
if (document->frame()->editor().insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
*position += length;
}
......@@ -106,7 +106,7 @@ static void webkitAccessibleEditableTextDeleteText(AtkEditableText* text, gint s
coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(startPos, endPos - startPos)));
coreObject->setFocused(true);
document->frame()->editor()->performDelete();
document->frame()->editor().performDelete();
}
static void webkitAccessibleEditableTextPasteText(AtkEditableText*, gint)
......
......@@ -724,7 +724,7 @@ static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString,
{
if (unifiedTextCheckerEnabled(node->document()->frame())) {
// Check the spelling directly since document->markersForNode() does not store the misspelled marking when the cursor is in a word.
TextCheckerClient* checker = node->document()->frame()->editor()->textChecker();
TextCheckerClient* checker = node->document()->frame()->editor().textChecker();
// checkTextOfParagraph is the only spelling/grammar checker implemented in WK1 and WK2
Vector<TextCheckingResult> results;
......@@ -742,7 +742,7 @@ static void AXAttributeStringSetSpelling(NSMutableAttributedString* attrString,
int currentPosition = 0;
while (charLength > 0) {
const UChar* charData = chars + currentPosition;
TextCheckerClient* checker = node->document()->frame()->editor()->textChecker();
TextCheckerClient* checker = node->document()->frame()->editor().textChecker();
int misspellingLocation = -1;
int misspellingLength = 0;
......
......@@ -345,7 +345,7 @@ void Clipboard::writeRange(Range* range, Frame* frame)
// FIXME: This is a design mistake, a layering violation that should be fixed.
// The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument.
// FIXME: The frame argument seems redundant, since a Range is in a particular document, which has a corresponding frame.
m_pasteboard->writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
m_pasteboard->writeSelection(range, frame->editor().smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
}
void Clipboard::writePlainText(const String& text)
......
......@@ -833,7 +833,7 @@ void ContainerNode::cloneChildNodes(ContainerNode *clone)
#if ENABLE(DELETION_UI)
HTMLElement* deleteButtonContainerElement = 0;
if (Frame* frame = document()->frame())
deleteButtonContainerElement = frame->editor()->deleteButtonController()->containerElement();
deleteButtonContainerElement = frame->editor().deleteButtonController()->containerElement();
cloneChildNodesAvoidingDeleteButton(this, clone, deleteButtonContainerElement);
#else
cloneChildNodesAvoidingDeleteButton(this, clone, 0);
......
......@@ -370,7 +370,7 @@ static bool acceptsEditingFocus(Node* node)
if (!frame || !root)
return false;
return frame->editor()->shouldBeginEditing(rangeOfContents(root).get());
return frame->editor().shouldBeginEditing(rangeOfContents(root).get());
}
static bool canAccessAncestor(const SecurityOrigin* activeSecurityOrigin, Frame* targetFrame)
......@@ -3361,7 +3361,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode, FocusDirection
return true;
if (oldFocusedNode->isRootEditableElement())
frame()->editor()->didEndEditing();
frame()->editor().didEndEditing();
if (view()) {
Widget* oldWidget = widgetForNode(oldFocusedNode.get());
......@@ -3410,7 +3410,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode, FocusDirection
m_focusedNode->setFocus(true);
if (m_focusedNode->isRootEditableElement())
frame()->editor()->didBeginEditing();
frame()->editor().didBeginEditing();
// eww, I suck. set the qt focus correctly
// ### find a better place in the code for this
......@@ -4191,7 +4191,7 @@ static Editor::Command command(Document* document, const String& commandName, bo
document->updateStyleIfNeeded();
return frame->editor()->command(commandName,
return frame->editor().command(commandName,
userInterface ? CommandFromDOMWithUserInterface : CommandFromDOM);
}
......
......@@ -339,7 +339,7 @@ void AlternativeTextController::timerFired(Timer<AlternativeTextController>*)
VisiblePosition start(selection.start(), selection.affinity());
VisiblePosition p = startOfWord(start, LeftWordIfOnBoundary);
VisibleSelection adjacentWords = VisibleSelection(p, start);
m_frame->editor()->markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeReplacement | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
m_frame->editor().markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeReplacement | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
}
break;
case AlternativeTextTypeReversion: {
......@@ -742,9 +742,9 @@ Vector<String> AlternativeTextController::dictationAlternativesForMarker(const D
void AlternativeTextController::applyDictationAlternative(const String& alternativeString)
{
#if USE(DICTATION_ALTERNATIVES)
Editor* editor = m_frame->editor();
RefPtr<Range> selection = editor->selectedRange();
if (!selection || !editor->shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
Editor& editor = m_frame->editor();
RefPtr<Range> selection = editor.selectedRange();
if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
return;
DocumentMarkerController* markers = selection->startContainer()->document()->markers();
Vector<DocumentMarker*> dictationAlternativesMarkers = markers->markersInRange(selection.get(), DocumentMarker::DictationAlternatives);
......
......@@ -115,7 +115,7 @@ void EditCommandComposition::unapply()
m_commands[i - 1]->doUnapply();
}
frame->editor()->unappliedEditing(this);
frame->editor().unappliedEditing(this);
}
void EditCommandComposition::reapply()
......@@ -138,7 +138,7 @@ void EditCommandComposition::reapply()
m_commands[i]->doReapply();
}
frame->editor()->reappliedEditing(this);
frame->editor().reappliedEditing(this);
}
void EditCommandComposition::append(SimpleEditCommand* command)
......@@ -219,7 +219,7 @@ void CompositeEditCommand::apply()
// Only need to call appliedEditing for top-level commands,
// and TypingCommands do it on their own (see TypingCommand::typingAddedToOpenCommand).
if (!callsAppliedEditingInDoApply())
frame->editor()->appliedEditing(this);
frame->editor().appliedEditing(this);
setShouldRetainAutocorrectionIndicator(false);
}
......@@ -1222,7 +1222,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
// FIXME (5098931): We should add a new insert action "WebViewInsertActionMoved" and call shouldInsertFragment here.
setEndingSelection(VisibleSelection(start, end, DOWNSTREAM));
document()->frame()->editor()->clearMisspellingsAndBadGrammar(endingSelection());
document()->frame()->editor().clearMisspellingsAndBadGrammar(endingSelection());
deleteSelection(false, false, false, false);
ASSERT(destination.deepEquivalent().anchorNode()->inDocument());
......@@ -1255,7 +1255,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
options |= ReplaceSelectionCommand::MatchStyle;
applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, options));
document()->frame()->editor()->markMisspellingsAndBadGrammar(endingSelection());
document()->frame()->editor().markMisspellingsAndBadGrammar(endingSelection());
// If the selection is in an empty paragraph, restore styles from the old empty paragraph to the new empty paragraph.
bool selectionIsEmptyParagraph = endingSelection().isCaret() && isStartOfParagraph(endingSelection().visibleStart()) && isEndOfParagraph(endingSelection().visibleStart());
......
......@@ -53,7 +53,7 @@ PassRefPtr<DeleteButton> DeleteButton::create(Document* document)
void DeleteButton::defaultEventHandler(Event* event)
{
if (event->type() == eventNames().clickEvent) {
document()->frame()->editor()->deleteButtonController()->deleteTarget();
document()->frame()->editor().deleteButtonController()->deleteTarget();
event->setDefaultHandled();
return;
}
......
......@@ -283,7 +283,7 @@ void DeleteButtonController::show(HTMLElement* element)
if (!enabled() || !element || !element->inDocument() || !isDeletableElement(element))
return;
EditorClient* client = m_frame->editor()->client();
EditorClient* client = m_frame->editor().client();
if (!client || !client->shouldShowDeleteInterface(element))
return;
......
......@@ -83,13 +83,13 @@ public:
: m_frame(frame)
{
if (frame)
frame->editor()->deleteButtonController()->disable();
frame->editor().deleteButtonController()->disable();
}
~DeleteButtonControllerDisableScope()
{
if (m_frame)
m_frame->editor()->deleteButtonController()->enable();
m_frame->editor().deleteButtonController()->enable();
}
private:
......
......@@ -648,7 +648,7 @@ void DeleteSelectionCommand::mergeParagraphs()
RefPtr<Range> range = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), endOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent());
RefPtr<Range> rangeToBeReplaced = Range::create(document(), mergeDestination.deepEquivalent().parentAnchoredEquivalent(), mergeDestination.deepEquivalent().parentAnchoredEquivalent());
if (!document()->frame()->editor()->client()->shouldMoveRangeAfterDelete(range.get(), rangeToBeReplaced.get()))
if (!document()->frame()->editor().client()->shouldMoveRangeAfterDelete(range.get(), rangeToBeReplaced.get()))
return;
// moveParagraphs will insert placeholders if it removes blocks that would require their use, don't let block
......@@ -794,7 +794,7 @@ void DeleteSelectionCommand::doApply()
if (!m_replace) {
Element* textControl = enclosingTextFormControl(m_selectionToDelete.start());
if (textControl && textControl->focused())
document()->frame()->editor()->textWillBeDeletedInTextField(textControl);
document()->frame()->editor().textWillBeDeletedInTextField(textControl);
}
// save this to later make the selection with
......@@ -854,7 +854,7 @@ void DeleteSelectionCommand::doApply()
if (!originalString.isEmpty()) {
if (Frame* frame = document()->frame())
frame->editor()->deletedAutocorrectionAtPosition(m_endingPosition, originalString);
frame->editor().deletedAutocorrectionAtPosition(m_endingPosition, originalString);
}
setEndingSelection(VisibleSelection(m_endingPosition, affinity, endingSelection().isDirectional()));
......
......@@ -45,7 +45,7 @@ EditCommand::EditCommand(Document* document)
{
ASSERT(m_document);
ASSERT(m_document->frame());
setStartingSelection(m_document->frame()->editor()->avoidIntersectionWithDeleteButtonController(m_document->frame()->selection()->selection()));
setStartingSelection(m_document->frame()->editor().avoidIntersectionWithDeleteButtonController(m_document->frame()->selection()->selection()));
setEndingSelection(m_startingSelection);
}
......
......@@ -1344,7 +1344,7 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
RefPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
reconcileTextDecorationProperties(mutableStyle.get());
if (!document->frame()->editor()->shouldStyleWithCSS())
if (!document->frame()->editor().shouldStyleWithCSS())
extractTextStyles(document, mutableStyle.get(), computedStyle->useFixedFontDefaultSize());
// Changing the whitespace style in a tab span would collapse the tab into a space.
......
......@@ -2012,9 +2012,9 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
frame()->selection()->setSelection(newSelection);
}
if (!frame()->editor()->shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
if (!frame()->editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
return;
frame()->editor()->replaceSelectionWithText(autocorrectedString, false, false);
frame()->editor().replaceSelectionWithText(autocorrectedString, false, false);
// Reset the charet one character further.
frame()->selection()->moveTo(frame()->selection()->end());
......
This diff is collapsed.
......@@ -102,7 +102,7 @@ bool DragCaretController::isContentRichlyEditable() const
static inline bool shouldAlwaysUseDirectionalSelection(Frame* frame)
{
return !frame || frame->editor()->behavior().shouldConsiderSelectionAsDirectional();
return !frame || frame->editor().behavior().shouldConsiderSelectionAsDirectional();
}
FrameSelection::FrameSelection(Frame* frame)
......@@ -327,11 +327,11 @@ void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation();
selectFrameElementInParentIfFullySelected();
notifyRendererOfSelectionChange(userTriggered);
m_frame->editor()->respondToChangedSelection(oldSelection, options);
m_frame->editor().respondToChangedSelection(oldSelection, options);
if (userTriggered == UserTriggered) {
ScrollAlignment alignment;
if (m_frame->editor()->behavior().shouldCenterAlignWhenSelectionIsRevealed())
if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsRevealed())
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignCenterAlways : ScrollAlignment::alignCenterIfNeeded;
else
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
......@@ -586,7 +586,7 @@ VisiblePosition FrameSelection::nextWordPositionForPlatform(const VisiblePositio
{
VisiblePosition positionAfterCurrentWord = nextWordPosition(originalPosition);
if (m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight()) {
if (m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight()) {
// In order to skip spaces when moving right, we advance one
// word further and then move one word back. Given the
// semantics of previousWordPosition() this will put us at the
......@@ -713,7 +713,7 @@ VisiblePosition FrameSelection::modifyMovingRight(TextGranularity granularity)
#if USE(ICU_UNICODE)
// Visual word movement relies on isWordTextBreak which is not implemented in WinCE and QT.
// https://bugs.webkit.org/show_bug.cgi?id=81136.
bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight();
bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight();
pos = rightWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight);
break;
#endif
......@@ -887,7 +887,7 @@ VisiblePosition FrameSelection::modifyMovingLeft(TextGranularity granularity)
break;
case WordGranularity: {
#if USE(ICU_UNICODE)
bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight();
bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight();
pos = leftWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight);
break;
#endif
......@@ -1024,7 +1024,7 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
if (!m_selection.isCaret()
&& (granularity == WordGranularity || granularity == ParagraphGranularity || granularity == LineGranularity)
&& m_frame && !m_frame->editor()->behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) {
&& m_frame && !m_frame->editor().behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) {
// Don't let the selection go across the base position directly. Needed to match mac
// behavior when, for instance, word-selecting backwards starting with the caret in
// the middle of a word and then word-selecting forward, leaving the caret in the
......@@ -1037,7 +1037,7 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
// Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the
// base in place and moving the extent. Matches NSTextView.
if (!m_frame || !m_frame->editor()->behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
if (!m_frame || !m_frame->editor().behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
setExtent(position, userTriggered);
else {
TextDirection textDirection = directionOfEnclosingBlock();
......@@ -1749,7 +1749,7 @@ bool FrameSelection::isFocusedAndActive() const
inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame)
{
return frame->editor()->lastEditCommand() && frame->editor()->lastEditCommand()->shouldStopCaretBlinking();
return frame->editor().lastEditCommand() && frame->editor().lastEditCommand()->shouldStopCaretBlinking();
}
void FrameSelection::updateAppearance()
......@@ -1928,7 +1928,7 @@ PassRefPtr<MutableStylePropertySet> FrameSelection::copyTypingStyle() const
bool FrameSelection::shouldDeleteSelection(const VisibleSelection& selection) const
{
return m_frame->editor()->client()->shouldDeleteRange(selection.toNormalizedRange().get());
return m_frame->editor().client()->shouldDeleteRange(selection.toNormalizedRange().get());
}
FloatRect FrameSelection::bounds(bool clipToVisibleContent) const
......@@ -2047,7 +2047,7 @@ void FrameSelection::setSelectionFromNone()
bool FrameSelection::shouldChangeSelection(const VisibleSelection& newSelection) const
{
return m_frame->editor()->shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
return m_frame->editor().shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
}
bool FrameSelection::dispatchSelectStart()
......
......@@ -147,7 +147,7 @@ void InsertTextCommand::doApply()
// anything other than NoSelection. The rest of this function requires a real endingSelection, so bail out.
if (endingSelection().isNone())
return;
} else if (document()->frame()->editor()->isOverwriteModeEnabled()) {
} else if (document()->frame()->editor().isOverwriteModeEnabled()) {
if (performOverwrite(m_text, m_selectInsertedText))
return;
}
......
......@@ -212,7 +212,7 @@ void SpellChecker::didCheck(int sequence, const Vector<TextCheckingResult>& resu
return;
}
m_frame->editor()->markAndReplaceFor(m_processingRequest, results);
m_frame->editor().markAndReplaceFor(m_processingRequest, results);
if (m_lastProcessedSequence < sequence)
m_lastProcessedSequence = sequence;
......
......@@ -63,7 +63,7 @@ private:
virtual void doUnapply() OVERRIDE
{
if (!m_hasBeenUndone) {
document()->frame()->editor()->unappliedSpellCorrection(startingSelection(), m_corrected, m_correction);
document()->frame()->editor().unappliedSpellCorrection(startingSelection(), m_corrected, m_correction);
m_hasBeenUndone = true;
}
......
......@@ -161,7 +161,7 @@ void TypingCommand::insertText(Document* document, const String& text, Options o
ASSERT(frame);
if (!text.isEmpty())
document->frame()->editor()->updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));
document->frame()->editor().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));
insertText(document, text, frame->selection()->selection(), options, composition);
}
......@@ -237,7 +237,7 @@ PassRefPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpenForTyping(F
{