Changeset 150140 in webkit


Ignore:
Timestamp:
May 15, 2013 12:47:47 PM (11 years ago)
Author:
andersca@apple.com
Message:

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):

Location:
trunk/Source
Files:
93 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150138 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        A frame's editor can never be null. Change Frame::editor() to return a reference to reflect this.
     9        Also, make Frame::m_editor a const member variable so nobody will accidentally set it to null.
     10
     11        * accessibility/AccessibilityObject.cpp:
     12        (WebCore::AccessibilityObject::hasMisspelling):
     13        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     14        (AXAttributeStringSetSpelling):
     15        * dom/ContainerNode.cpp:
     16        (WebCore::ContainerNode::cloneChildNodes):
     17        * dom/Document.cpp:
     18        (WebCore::acceptsEditingFocus):
     19        (WebCore::Document::setFocusedNode):
     20        (WebCore::command):
     21        * editing/AlternativeTextController.cpp:
     22        (WebCore::AlternativeTextController::timerFired):
     23        (WebCore::AlternativeTextController::applyDictationAlternative):
     24        * editing/CompositeEditCommand.cpp:
     25        (WebCore::EditCommandComposition::unapply):
     26        (WebCore::EditCommandComposition::reapply):
     27        (WebCore::CompositeEditCommand::apply):
     28        (WebCore::CompositeEditCommand::moveParagraphs):
     29        * editing/DeleteButton.cpp:
     30        (WebCore::DeleteButton::defaultEventHandler):
     31        * editing/DeleteButtonController.cpp:
     32        (WebCore::DeleteButtonController::show):
     33        * editing/DeleteButtonController.h:
     34        (WebCore::DeleteButtonControllerDisableScope::DeleteButtonControllerDisableScope):
     35        (WebCore::DeleteButtonControllerDisableScope::~DeleteButtonControllerDisableScope):
     36        * editing/DeleteSelectionCommand.cpp:
     37        (WebCore::DeleteSelectionCommand::mergeParagraphs):
     38        (WebCore::DeleteSelectionCommand::doApply):
     39        * editing/EditCommand.cpp:
     40        (WebCore::EditCommand::EditCommand):
     41        * editing/EditingStyle.cpp:
     42        (WebCore::StyleChange::StyleChange):
     43        * editing/Editor.cpp:
     44        (WebCore::Editor::markMisspellingsAfterTypingToWord):
     45        * editing/EditorCommand.cpp:
     46        (WebCore::applyCommandToFrame):
     47        (WebCore::executeToggleStyle):
     48        (WebCore::executeApplyParagraphStyle):
     49        (WebCore::expandSelectionToGranularity):
     50        (WebCore::stateStyle):
     51        (WebCore::valueStyle):
     52        (WebCore::executeCopy):
     53        (WebCore::executeCut):
     54        (WebCore::executeDefaultParagraphSeparator):
     55        (WebCore::executeDelete):
     56        (WebCore::executeDeleteBackward):
     57        (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
     58        (WebCore::executeDeleteForward):
     59        (WebCore::executeDeleteToBeginningOfLine):
     60        (WebCore::executeDeleteToBeginningOfParagraph):
     61        (WebCore::executeDeleteToEndOfLine):
     62        (WebCore::executeDeleteToEndOfParagraph):
     63        (WebCore::executeDeleteToMark):
     64        (WebCore::executeDeleteWordBackward):
     65        (WebCore::executeDeleteWordForward):
     66        (WebCore::executeFindString):
     67        (WebCore::executeForwardDelete):
     68        (WebCore::executeIgnoreSpelling):
     69        (WebCore::executeInsertNewline):
     70        (WebCore::executeMakeTextWritingDirectionLeftToRight):
     71        (WebCore::executeMakeTextWritingDirectionNatural):
     72        (WebCore::executeMakeTextWritingDirectionRightToLeft):
     73        (WebCore::executeToggleOverwrite):
     74        (WebCore::executePaste):
     75        (WebCore::executePasteGlobalSelection):
     76        (WebCore::executePasteAndMatchStyle):
     77        (WebCore::executePasteAsPlainText):
     78        (WebCore::executeRedo):
     79        (WebCore::executeRemoveFormat):
     80        (WebCore::executeSelectToMark):
     81        (WebCore::executeSetMark):
     82        (WebCore::executeStyleWithCSS):
     83        (WebCore::executeUseCSS):
     84        (WebCore::executeSwapWithMark):
     85        (WebCore::executeTakeFindStringFromSelection):
     86        (WebCore::executeTranspose):
     87        (WebCore::executeUndo):
     88        (WebCore::executeYank):
     89        (WebCore::executeYankAndSelect):
     90        (WebCore::supportedCopyCut):
     91        (WebCore::supportedPaste):
     92        (WebCore::enabledVisibleSelection):
     93        (WebCore::enabledVisibleSelectionAndMark):
     94        (WebCore::enableCaretInEditableText):
     95        (WebCore::enabledCopy):
     96        (WebCore::enabledCut):
     97        (WebCore::enabledInEditableText):
     98        (WebCore::enabledDelete):
     99        (WebCore::enabledPaste):
     100        (WebCore::enabledRedo):
     101        (WebCore::enabledTakeFindStringFromSelection):
     102        (WebCore::enabledUndo):
     103        (WebCore::stateOrderedList):
     104        (WebCore::stateStyleWithCSS):
     105        (WebCore::stateUnorderedList):
     106        (WebCore::valueDefaultParagraphSeparator):
     107        * editing/FrameSelection.cpp:
     108        (WebCore::shouldAlwaysUseDirectionalSelection):
     109        (WebCore::FrameSelection::setSelection):
     110        (WebCore::FrameSelection::nextWordPositionForPlatform):
     111        (WebCore::FrameSelection::modifyMovingRight):
     112        (WebCore::FrameSelection::modifyMovingLeft):
     113        (WebCore::FrameSelection::modify):
     114        (WebCore::shouldStopBlinkingDueToTypingCommand):
     115        (WebCore::FrameSelection::shouldDeleteSelection):
     116        (WebCore::FrameSelection::shouldChangeSelection):
     117        * editing/InsertTextCommand.cpp:
     118        (WebCore::InsertTextCommand::doApply):
     119        * editing/SpellChecker.cpp:
     120        (WebCore::SpellChecker::didCheck):
     121        * editing/SpellingCorrectionCommand.cpp:
     122        * editing/TypingCommand.cpp:
     123        (WebCore::TypingCommand::insertText):
     124        (WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
     125        (WebCore::TypingCommand::markMisspellingsAfterTyping):
     126        (WebCore::TypingCommand::typingAddedToOpenCommand):
     127        (WebCore::TypingCommand::deleteKeyPressed):
     128        (WebCore::TypingCommand::forwardDeleteKeyPressed):
     129        * editing/htmlediting.cpp:
     130        (WebCore::createDefaultParagraphElement):
     131        * editing/mac/EditorMac.mm:
     132        (WebCore::Editor::pasteWithPasteboard):
     133        * editing/markup.cpp:
     134        (WebCore::createMarkup):
     135        * html/HTMLInputElement.cpp:
     136        (WebCore::HTMLInputElement::endEditing):
     137        * html/HTMLTextAreaElement.cpp:
     138        (WebCore::HTMLTextAreaElement::subtreeHasChanged):
     139        * html/TextFieldInputType.cpp:
     140        (WebCore::TextFieldInputType::handleKeydownEvent):
     141        (WebCore::TextFieldInputType::didSetValueByUserEdit):
     142        * loader/FrameLoader.cpp:
     143        (WebCore::FrameLoader::closeURL):
     144        (WebCore::FrameLoader::didOpenURL):
     145        (WebCore::FrameLoader::clear):
     146        * page/ContextMenuController.cpp:
     147        (WebCore::insertUnicodeCharacter):
     148        (WebCore::ContextMenuController::contextMenuItemSelected):
     149        (WebCore::ContextMenuController::populate):
     150        (WebCore::ContextMenuController::checkOrEnableIfNeeded):
     151        * page/DOMWindow.cpp:
     152        (WebCore::DOMWindow::find):
     153        * page/DragController.cpp:
     154        (WebCore::DragController::dispatchTextInputEventFor):
     155        (WebCore::DragController::concludeEditDrag):
     156        (WebCore::DragController::startDrag):
     157        * page/EventHandler.cpp:
     158        (WebCore::EventHandler::selectClosestWordFromMouseEvent):
     159        (WebCore::EventHandler::handleMousePressEventSingleClick):
     160        (WebCore::EventHandler::handlePasteGlobalSelection):
     161        (WebCore::EventHandler::sendContextMenuEvent):
     162        (WebCore::EventHandler::sendContextMenuEventForKey):
     163        (WebCore::EventHandler::keyEvent):
     164        (WebCore::EventHandler::defaultKeyboardEventHandler):
     165        (WebCore::EventHandler::defaultTextInputEventHandler):
     166        (WebCore::EventHandler::defaultBackspaceEventHandler):
     167        * page/FocusController.cpp:
     168        (WebCore::relinquishesEditingFocus):
     169        * page/Frame.cpp:
     170        (WebCore::Frame::rangeForPoint):
     171        * page/Frame.h:
     172        (Frame):
     173        (WebCore::Frame::editor):
     174        * page/Page.cpp:
     175        (WebCore::Page::findString):
     176        (WebCore::Page::findStringMatchingRanges):
     177        (WebCore::Page::rangeOfString):
     178        (WebCore::Page::markAllMatchesForText):
     179        (WebCore::Page::setDeviceScaleFactor):
     180        * platform/mac/ClipboardMac.mm:
     181        (WebCore::ClipboardMac::writeRange):
     182        * platform/mac/DragDataMac.mm:
     183        (WebCore::DragData::asURL):
     184        * platform/mac/PasteboardMac.mm:
     185        (WebCore::Pasteboard::getStringSelection):
     186        (WebCore::Pasteboard::getDataSelection):
     187        (WebCore::Pasteboard::writeSelectionForTypes):
     188        (WebCore::writeURLForTypes):
     189        (WebCore::Pasteboard::plainText):
     190        (WebCore::documentFragmentWithRTF):
     191        (WebCore::Pasteboard::documentFragment):
     192        * rendering/HitTestResult.cpp:
     193        (WebCore::HitTestResult::dictationAlternatives):
     194        * rendering/InlineTextBox.cpp:
     195        (WebCore::InlineTextBox::paint):
     196        (WebCore::InlineTextBox::paintTextMatchMarker):
     197        * rendering/RenderBlock.cpp:
     198        (WebCore::RenderBlock::positionForPointWithInlineChildren):
     199        * testing/Internals.cpp:
     200        (WebCore::spellchecker):
     201        (WebCore::Internals::resetToConsistentState):
     202        (WebCore::Internals::hasSpellingMarker):
     203        (WebCore::Internals::hasAutocorrectedMarker):
     204        (WebCore::Internals::setContinuousSpellCheckingEnabled):
     205        (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled):
     206        (WebCore::Internals::setAutomaticLinkDetectionEnabled):
     207        (WebCore::Internals::setAutomaticDashSubstitutionEnabled):
     208        (WebCore::Internals::setAutomaticTextReplacementEnabled):
     209        (WebCore::Internals::setAutomaticSpellingCorrectionEnabled):
     210        (WebCore::Internals::isOverwriteModeEnabled):
     211        (WebCore::Internals::toggleOverwriteModeEnabled):
     212        (WebCore::Internals::hasGrammarMarker):
     213
    12142013-05-15  Darin Adler  <darin@apple.com>
    2215
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r149583 r150140  
    321321        return false;
    322322   
    323     Editor* editor = frame->editor();
    324     if (!editor)
    325         return false;
    326    
    327     TextCheckerClient* textChecker = editor->textChecker();
     323    Editor& editor = frame->editor();
     324   
     325    TextCheckerClient* textChecker = editor.textChecker();
    328326    if (!textChecker)
    329327        return false;
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp

    r148545 r150140  
    8080    coreObject->setFocused(true);
    8181    // FIXME: We should set position to the actual inserted text length, which may be less than that requested.
    82     if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
     82    if (document->frame()->editor().insertTextWithoutSendingTextEvent(String::fromUTF8(string).substring(0, length), false, 0))
    8383        *position += length;
    8484}
     
    107107    coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(startPos, endPos - startPos)));
    108108    coreObject->setFocused(true);
    109     document->frame()->editor()->performDelete();
     109    document->frame()->editor().performDelete();
    110110}
    111111
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r149581 r150140  
    725725    if (unifiedTextCheckerEnabled(node->document()->frame())) {
    726726        // Check the spelling directly since document->markersForNode() does not store the misspelled marking when the cursor is in a word.
    727         TextCheckerClient* checker = node->document()->frame()->editor()->textChecker();
     727        TextCheckerClient* checker = node->document()->frame()->editor().textChecker();
    728728       
    729729        // checkTextOfParagraph is the only spelling/grammar checker implemented in WK1 and WK2
     
    743743    while (charLength > 0) {
    744744        const UChar* charData = chars + currentPosition;
    745         TextCheckerClient* checker = node->document()->frame()->editor()->textChecker();
     745        TextCheckerClient* checker = node->document()->frame()->editor().textChecker();
    746746       
    747747        int misspellingLocation = -1;
  • trunk/Source/WebCore/dom/Clipboard.cpp

    r150100 r150140  
    346346    // The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument.
    347347    // FIXME: The frame argument seems redundant, since a Range is in a particular document, which has a corresponding frame.
    348     m_pasteboard->writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
     348    m_pasteboard->writeSelection(range, frame->editor().smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
    349349}
    350350
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r150104 r150140  
    834834    HTMLElement* deleteButtonContainerElement = 0;
    835835    if (Frame* frame = document()->frame())
    836         deleteButtonContainerElement = frame->editor()->deleteButtonController()->containerElement();
     836        deleteButtonContainerElement = frame->editor().deleteButtonController()->containerElement();
    837837    cloneChildNodesAvoidingDeleteButton(this, clone, deleteButtonContainerElement);
    838838#else
  • trunk/Source/WebCore/dom/Document.cpp

    r150013 r150140  
    371371        return false;
    372372
    373     return frame->editor()->shouldBeginEditing(rangeOfContents(root).get());
     373    return frame->editor().shouldBeginEditing(rangeOfContents(root).get());
    374374}
    375375
     
    33623362           
    33633363        if (oldFocusedNode->isRootEditableElement())
    3364             frame()->editor()->didEndEditing();
     3364            frame()->editor().didEndEditing();
    33653365
    33663366        if (view()) {
     
    34113411
    34123412        if (m_focusedNode->isRootEditableElement())
    3413             frame()->editor()->didBeginEditing();
     3413            frame()->editor().didBeginEditing();
    34143414
    34153415        // eww, I suck. set the qt focus correctly
     
    41924192    document->updateStyleIfNeeded();
    41934193
    4194     return frame->editor()->command(commandName,
     4194    return frame->editor().command(commandName,
    41954195        userInterface ? CommandFromDOMWithUserInterface : CommandFromDOM);
    41964196}
  • trunk/Source/WebCore/editing/AlternativeTextController.cpp

    r149465 r150140  
    340340        VisiblePosition p = startOfWord(start, LeftWordIfOnBoundary);
    341341        VisibleSelection adjacentWords = VisibleSelection(p, start);
    342         m_frame->editor()->markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeReplacement | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
     342        m_frame->editor().markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeReplacement | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
    343343    }
    344344        break;
     
    743743{
    744744#if USE(DICTATION_ALTERNATIVES)
    745     Editor* editor = m_frame->editor();
    746     RefPtr<Range> selection = editor->selectedRange();
    747     if (!selection || !editor->shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
     745    Editor& editor = m_frame->editor();
     746    RefPtr<Range> selection = editor.selectedRange();
     747    if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
    748748        return;
    749749    DocumentMarkerController* markers = selection->startContainer()->document()->markers();
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r148908 r150140  
    116116    }
    117117
    118     frame->editor()->unappliedEditing(this);
     118    frame->editor().unappliedEditing(this);
    119119}
    120120
     
    139139    }
    140140   
    141     frame->editor()->reappliedEditing(this);
     141    frame->editor().reappliedEditing(this);
    142142}
    143143
     
    220220    // and TypingCommands do it on their own (see TypingCommand::typingAddedToOpenCommand).
    221221    if (!callsAppliedEditingInDoApply())
    222         frame->editor()->appliedEditing(this);
     222        frame->editor().appliedEditing(this);
    223223    setShouldRetainAutocorrectionIndicator(false);
    224224}
     
    12231223   
    12241224    setEndingSelection(VisibleSelection(start, end, DOWNSTREAM));
    1225     document()->frame()->editor()->clearMisspellingsAndBadGrammar(endingSelection());
     1225    document()->frame()->editor().clearMisspellingsAndBadGrammar(endingSelection());
    12261226    deleteSelection(false, false, false, false);
    12271227
     
    12561256    applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, options));
    12571257
    1258     document()->frame()->editor()->markMisspellingsAndBadGrammar(endingSelection());
     1258    document()->frame()->editor().markMisspellingsAndBadGrammar(endingSelection());
    12591259
    12601260    // If the selection is in an empty paragraph, restore styles from the old empty paragraph to the new empty paragraph.
  • trunk/Source/WebCore/editing/DeleteButton.cpp

    r142533 r150140  
    5454{
    5555    if (event->type() == eventNames().clickEvent) {
    56         document()->frame()->editor()->deleteButtonController()->deleteTarget();
     56        document()->frame()->editor().deleteButtonController()->deleteTarget();
    5757        event->setDefaultHandled();
    5858        return;
  • trunk/Source/WebCore/editing/DeleteButtonController.cpp

    r142576 r150140  
    284284        return;
    285285
    286     EditorClient* client = m_frame->editor()->client();
     286    EditorClient* client = m_frame->editor().client();
    287287    if (!client || !client->shouldShowDeleteInterface(element))
    288288        return;
  • trunk/Source/WebCore/editing/DeleteButtonController.h

    r148545 r150140  
    8484    {
    8585        if (frame)
    86             frame->editor()->deleteButtonController()->disable();
     86            frame->editor().deleteButtonController()->disable();
    8787    }
    8888
     
    9090    {
    9191        if (m_frame)
    92             m_frame->editor()->deleteButtonController()->enable();
     92            m_frame->editor().deleteButtonController()->enable();
    9393    }
    9494
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r144911 r150140  
    649649    RefPtr<Range> range = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), endOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent());
    650650    RefPtr<Range> rangeToBeReplaced = Range::create(document(), mergeDestination.deepEquivalent().parentAnchoredEquivalent(), mergeDestination.deepEquivalent().parentAnchoredEquivalent());
    651     if (!document()->frame()->editor()->client()->shouldMoveRangeAfterDelete(range.get(), rangeToBeReplaced.get()))
     651    if (!document()->frame()->editor().client()->shouldMoveRangeAfterDelete(range.get(), rangeToBeReplaced.get()))
    652652        return;
    653653   
     
    795795        Element* textControl = enclosingTextFormControl(m_selectionToDelete.start());
    796796        if (textControl && textControl->focused())
    797             document()->frame()->editor()->textWillBeDeletedInTextField(textControl);
     797            document()->frame()->editor().textWillBeDeletedInTextField(textControl);
    798798    }
    799799
     
    855855    if (!originalString.isEmpty()) {
    856856        if (Frame* frame = document()->frame())
    857             frame->editor()->deletedAutocorrectionAtPosition(m_endingPosition, originalString);
     857            frame->editor().deletedAutocorrectionAtPosition(m_endingPosition, originalString);
    858858    }
    859859
  • trunk/Source/WebCore/editing/EditCommand.cpp

    r142705 r150140  
    4646    ASSERT(m_document);
    4747    ASSERT(m_document->frame());
    48     setStartingSelection(m_document->frame()->editor()->avoidIntersectionWithDeleteButtonController(m_document->frame()->selection()->selection()));
     48    setStartingSelection(m_document->frame()->editor().avoidIntersectionWithDeleteButtonController(m_document->frame()->selection()->selection()));
    4949    setEndingSelection(m_startingSelection);
    5050}
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r149532 r150140  
    13451345
    13461346    reconcileTextDecorationProperties(mutableStyle.get());
    1347     if (!document->frame()->editor()->shouldStyleWithCSS())
     1347    if (!document->frame()->editor().shouldStyleWithCSS())
    13481348        extractTextStyles(document, mutableStyle.get(), computedStyle->useFixedFontDefaultSize());
    13491349
  • trunk/Source/WebCore/editing/Editor.cpp

    r150122 r150140  
    20132013        }
    20142014
    2015         if (!frame()->editor()->shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
     2015        if (!frame()->editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
    20162016            return;
    2017         frame()->editor()->replaceSelectionWithText(autocorrectedString, false, false);
     2017        frame()->editor().replaceSelectionWithText(autocorrectedString, false, false);
    20182018
    20192019        // Reset the charet one character further.
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r148395 r150140  
    106106    switch (source) {
    107107    case CommandFromMenuOrKeyBinding:
    108         frame->editor()->applyStyleToSelection(style, action);
     108        frame->editor().applyStyleToSelection(style, action);
    109109        return true;
    110110    case CommandFromDOM:
    111111    case CommandFromDOMWithUserInterface:
    112         frame->editor()->applyStyle(style);
     112        frame->editor().applyStyle(style);
    113113        return true;
    114114    }
     
    165165
    166166    bool styleIsPresent;
    167     if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection())
    168         styleIsPresent = frame->editor()->selectionStartHasStyle(propertyID, onValue);
     167    if (frame->editor().behavior().shouldToggleStyleBasedOnStartOfSelection())
     168        styleIsPresent = frame->editor().selectionStartHasStyle(propertyID, onValue);
    169169    else
    170         styleIsPresent = frame->editor()->selectionHasStyle(propertyID, onValue) == TrueTriState;
     170        styleIsPresent = frame->editor().selectionHasStyle(propertyID, onValue) == TrueTriState;
    171171
    172172    RefPtr<EditingStyle> style = EditingStyle::create(propertyID, styleIsPresent ? offValue : onValue);
     
    181181    switch (source) {
    182182    case CommandFromMenuOrKeyBinding:
    183         frame->editor()->applyParagraphStyleToSelection(style.get(), action);
     183        frame->editor().applyParagraphStyleToSelection(style.get(), action);
    184184        return true;
    185185    case CommandFromDOM:
    186186    case CommandFromDOMWithUserInterface:
    187         frame->editor()->applyParagraphStyle(style.get());
     187        frame->editor().applyParagraphStyle(style.get());
    188188        return true;
    189189    }
     
    219219    RefPtr<Range> oldRange = frame->selection()->selection().toNormalizedRange();
    220220    EAffinity affinity = frame->selection()->affinity();
    221     if (!frame->editor()->client()->shouldChangeSelectedRange(oldRange.get(), newRange.get(), affinity, false))
     221    if (!frame->editor().client()->shouldChangeSelectedRange(oldRange.get(), newRange.get(), affinity, false))
    222222        return false;
    223223    frame->selection()->setSelectedRange(newRange.get(), affinity, true);
     
    227227static TriState stateStyle(Frame* frame, CSSPropertyID propertyID, const char* desiredValue)
    228228{
    229     if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection())
    230         return frame->editor()->selectionStartHasStyle(propertyID, desiredValue) ? TrueTriState : FalseTriState;
    231     return frame->editor()->selectionHasStyle(propertyID, desiredValue);
     229    if (frame->editor().behavior().shouldToggleStyleBasedOnStartOfSelection())
     230        return frame->editor().selectionStartHasStyle(propertyID, desiredValue) ? TrueTriState : FalseTriState;
     231    return frame->editor().selectionHasStyle(propertyID, desiredValue);
    232232}
    233233
     
    236236    // FIXME: Rather than retrieving the style at the start of the current selection,
    237237    // we should retrieve the style present throughout the selection for non-Mac platforms.
    238     return frame->editor()->selectionStartCSSPropertyValue(propertyID);
     238    return frame->editor().selectionStartCSSPropertyValue(propertyID);
    239239}
    240240
     
    282282static bool executeCopy(Frame* frame, Event*, EditorCommandSource, const String&)
    283283{
    284     frame->editor()->copy();
     284    frame->editor().copy();
    285285    return true;
    286286}
     
    299299    if (source == CommandFromMenuOrKeyBinding) {
    300300        UserTypingGestureIndicator typingGestureIndicator(frame);
    301         frame->editor()->cut();
     301        frame->editor().cut();
    302302    } else
    303         frame->editor()->cut();
     303        frame->editor().cut();
    304304    return true;
    305305}
     
    308308{
    309309    if (equalIgnoringCase(value, "div"))
    310         frame->editor()->setDefaultParagraphSeparator(EditorParagraphSeparatorIsDiv);
     310        frame->editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsDiv);
    311311    else if (equalIgnoringCase(value, "p"))
    312         frame->editor()->setDefaultParagraphSeparator(EditorParagraphSeparatorIsP);
     312        frame->editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsP);
    313313
    314314    return true;
     
    321321        // Doesn't modify the text if the current selection isn't a range.
    322322        UserTypingGestureIndicator typingGestureIndicator(frame);
    323         frame->editor()->performDelete();
     323        frame->editor().performDelete();
    324324        return true;
    325325    }
     
    337337static bool executeDeleteBackward(Frame* frame, Event*, EditorCommandSource, const String&)
    338338{
    339     frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
     339    frame->editor().deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
    340340    return true;
    341341}
     
    344344{
    345345    LOG_ERROR("DeleteBackwardByDecomposingPreviousCharacter is not implemented, doing DeleteBackward instead");
    346     frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
     346    frame->editor().deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
    347347    return true;
    348348}
     
    350350static bool executeDeleteForward(Frame* frame, Event*, EditorCommandSource, const String&)
    351351{
    352     frame->editor()->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
     352    frame->editor().deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
    353353    return true;
    354354}
     
    356356static bool executeDeleteToBeginningOfLine(Frame* frame, Event*, EditorCommandSource, const String&)
    357357{
    358     frame->editor()->deleteWithDirection(DirectionBackward, LineBoundary, true, false);
     358    frame->editor().deleteWithDirection(DirectionBackward, LineBoundary, true, false);
    359359    return true;
    360360}
     
    362362static bool executeDeleteToBeginningOfParagraph(Frame* frame, Event*, EditorCommandSource, const String&)
    363363{
    364     frame->editor()->deleteWithDirection(DirectionBackward, ParagraphBoundary, true, false);
     364    frame->editor().deleteWithDirection(DirectionBackward, ParagraphBoundary, true, false);
    365365    return true;
    366366}
     
    370370    // Despite its name, this command should delete the newline at the end of
    371371    // a paragraph if you are at the end of a paragraph (like DeleteToEndOfParagraph).
    372     frame->editor()->deleteWithDirection(DirectionForward, LineBoundary, true, false);
     372    frame->editor().deleteWithDirection(DirectionForward, LineBoundary, true, false);
    373373    return true;
    374374}
     
    378378    // Despite its name, this command should delete the newline at the end of
    379379    // a paragraph if you are at the end of a paragraph.
    380     frame->editor()->deleteWithDirection(DirectionForward, ParagraphBoundary, true, false);
     380    frame->editor().deleteWithDirection(DirectionForward, ParagraphBoundary, true, false);
    381381    return true;
    382382}
     
    384384static bool executeDeleteToMark(Frame* frame, Event*, EditorCommandSource, const String&)
    385385{
    386     RefPtr<Range> mark = frame->editor()->mark().toNormalizedRange();
     386    RefPtr<Range> mark = frame->editor().mark().toNormalizedRange();
    387387    if (mark) {
    388388        FrameSelection* selection = frame->selection();
    389         bool selected = selection->setSelectedRange(unionDOMRanges(mark.get(), frame->editor()->selectedRange().get()).get(), DOWNSTREAM, true);
     389        bool selected = selection->setSelectedRange(unionDOMRanges(mark.get(), frame->editor().selectedRange().get()).get(), DOWNSTREAM, true);
    390390        ASSERT(selected);
    391391        if (!selected)
    392392            return false;
    393393    }
    394     frame->editor()->performDelete();
    395     frame->editor()->setMark(frame->selection()->selection());
     394    frame->editor().performDelete();
     395    frame->editor().setMark(frame->selection()->selection());
    396396    return true;
    397397}
     
    399399static bool executeDeleteWordBackward(Frame* frame, Event*, EditorCommandSource, const String&)
    400400{
    401     frame->editor()->deleteWithDirection(DirectionBackward, WordGranularity, true, false);
     401    frame->editor().deleteWithDirection(DirectionBackward, WordGranularity, true, false);
    402402    return true;
    403403}
     
    405405static bool executeDeleteWordForward(Frame* frame, Event*, EditorCommandSource, const String&)
    406406{
    407     frame->editor()->deleteWithDirection(DirectionForward, WordGranularity, true, false);
     407    frame->editor().deleteWithDirection(DirectionForward, WordGranularity, true, false);
    408408    return true;
    409409}
     
    411411static bool executeFindString(Frame* frame, Event*, EditorCommandSource, const String& value)
    412412{
    413     return frame->editor()->findString(value, true, false, true, false);
     413    return frame->editor().findString(value, true, false, true, false);
    414414}
    415415
     
    457457    switch (source) {
    458458    case CommandFromMenuOrKeyBinding:
    459         frame->editor()->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
     459        frame->editor().deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
    460460        return true;
    461461    case CommandFromDOM:
     
    473473static bool executeIgnoreSpelling(Frame* frame, Event*, EditorCommandSource, const String&)
    474474{
    475     frame->editor()->ignoreSpelling();
     475    frame->editor().ignoreSpelling();
    476476    return true;
    477477}
     
    529529{
    530530    Frame* targetFrame = WebCore::targetFrame(frame, event);
    531     return targetFrame->eventHandler()->handleTextInputEvent("\n", event, targetFrame->editor()->canEditRichly() ? TextEventInputKeyboard : TextEventInputLineBreak);
     531    return targetFrame->eventHandler()->handleTextInputEvent("\n", event, targetFrame->editor().canEditRichly() ? TextEventInputKeyboard : TextEventInputLineBreak);
    532532}
    533533
     
    592592    style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
    593593    style->setProperty(CSSPropertyDirection, CSSValueLtr);
    594     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     594    frame->editor().applyStyle(style.get(), EditActionSetWritingDirection);
    595595    return true;
    596596}
     
    600600    RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
    601601    style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
    602     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     602    frame->editor().applyStyle(style.get(), EditActionSetWritingDirection);
    603603    return true;
    604604}
     
    609609    style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
    610610    style->setProperty(CSSPropertyDirection, CSSValueRtl);
    611     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     611    frame->editor().applyStyle(style.get(), EditActionSetWritingDirection);
    612612    return true;
    613613}
     
    905905static bool executeToggleOverwrite(Frame* frame, Event*, EditorCommandSource, const String&)
    906906{
    907     frame->editor()->toggleOverwriteModeEnabled();
     907    frame->editor().toggleOverwriteModeEnabled();
    908908    return true;
    909909}
     
    913913    if (source == CommandFromMenuOrKeyBinding) {
    914914        UserTypingGestureIndicator typingGestureIndicator(frame);
    915         frame->editor()->paste();
     915        frame->editor().paste();
    916916    } else
    917         frame->editor()->paste();
     917        frame->editor().paste();
    918918    return true;
    919919}
     
    921921static bool executePasteGlobalSelection(Frame* frame, Event*, EditorCommandSource source, const String&)
    922922{
    923     if (!frame->editor()->client()->supportsGlobalSelection())
     923    if (!frame->editor().client()->supportsGlobalSelection())
    924924        return false;
    925925    ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding);
     
    928928    bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
    929929    Pasteboard::generalPasteboard()->setSelectionMode(true);
    930     frame->editor()->paste();
     930    frame->editor().paste();
    931931    Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    932932    return true;
     
    937937    if (source == CommandFromMenuOrKeyBinding) {
    938938        UserTypingGestureIndicator typingGestureIndicator(frame);
    939         frame->editor()->pasteAsPlainText();
     939        frame->editor().pasteAsPlainText();
    940940    } else
    941         frame->editor()->pasteAsPlainText();
     941        frame->editor().pasteAsPlainText();
    942942    return true;
    943943}
     
    947947    if (source == CommandFromMenuOrKeyBinding) {
    948948        UserTypingGestureIndicator typingGestureIndicator(frame);
    949         frame->editor()->pasteAsPlainText();
     949        frame->editor().pasteAsPlainText();
    950950    } else
    951         frame->editor()->pasteAsPlainText();
     951        frame->editor().pasteAsPlainText();
    952952    return true;
    953953}
     
    964964static bool executeRedo(Frame* frame, Event*, EditorCommandSource, const String&)
    965965{
    966     frame->editor()->redo();
     966    frame->editor().redo();
    967967    return true;
    968968}
     
    970970static bool executeRemoveFormat(Frame* frame, Event*, EditorCommandSource, const String&)
    971971{
    972     frame->editor()->removeFormattingAndStyle();
     972    frame->editor().removeFormattingAndStyle();
    973973    return true;
    974974}
     
    10271027static bool executeSelectToMark(Frame* frame, Event*, EditorCommandSource, const String&)
    10281028{
    1029     RefPtr<Range> mark = frame->editor()->mark().toNormalizedRange();
    1030     RefPtr<Range> selection = frame->editor()->selectedRange();
     1029    RefPtr<Range> mark = frame->editor().mark().toNormalizedRange();
     1030    RefPtr<Range> selection = frame->editor().selectedRange();
    10311031    if (!mark || !selection) {
    10321032        systemBeep();
     
    10441044static bool executeSetMark(Frame* frame, Event*, EditorCommandSource, const String&)
    10451045{
    1046     frame->editor()->setMark(frame->selection()->selection());
     1046    frame->editor().setMark(frame->selection()->selection());
    10471047    return true;
    10481048}
     
    10561056static bool executeStyleWithCSS(Frame* frame, Event*, EditorCommandSource, const String& value)
    10571057{
    1058     frame->editor()->setShouldStyleWithCSS(!equalIgnoringCase(value, "false"));
     1058    frame->editor().setShouldStyleWithCSS(!equalIgnoringCase(value, "false"));
    10591059    return true;
    10601060}
     
    10621062static bool executeUseCSS(Frame* frame, Event*, EditorCommandSource, const String& value)
    10631063{
    1064     frame->editor()->setShouldStyleWithCSS(equalIgnoringCase(value, "false"));
     1064    frame->editor().setShouldStyleWithCSS(equalIgnoringCase(value, "false"));
    10651065    return true;
    10661066}
     
    10781078static bool executeSwapWithMark(Frame* frame, Event*, EditorCommandSource, const String&)
    10791079{
    1080     const VisibleSelection& mark = frame->editor()->mark();
     1080    const VisibleSelection& mark = frame->editor().mark();
    10811081    const VisibleSelection& selection = frame->selection()->selection();
    10821082    if (mark.isNone() || selection.isNone()) {
     
    10851085    }
    10861086    frame->selection()->setSelection(mark);
    1087     frame->editor()->setMark(selection);
     1087    frame->editor().setMark(selection);
    10881088    return true;
    10891089}
     
    10921092static bool executeTakeFindStringFromSelection(Frame* frame, Event*, EditorCommandSource, const String&)
    10931093{
    1094     frame->editor()->takeFindStringFromSelection();
     1094    frame->editor().takeFindStringFromSelection();
    10951095    return true;
    10961096}
     
    11091109static bool executeTranspose(Frame* frame, Event*, EditorCommandSource, const String&)
    11101110{
    1111     frame->editor()->transpose();
     1111    frame->editor().transpose();
    11121112    return true;
    11131113}
     
    11211121static bool executeUndo(Frame* frame, Event*, EditorCommandSource, const String&)
    11221122{
    1123     frame->editor()->undo();
     1123    frame->editor().undo();
    11241124    return true;
    11251125}
     
    11441144static bool executeYank(Frame* frame, Event*, EditorCommandSource, const String&)
    11451145{
    1146     frame->editor()->insertTextWithoutSendingTextEvent(frame->editor()->killRing()->yank(), false, 0);
    1147     frame->editor()->killRing()->setToYankedState();
     1146    frame->editor().insertTextWithoutSendingTextEvent(frame->editor().killRing()->yank(), false, 0);
     1147    frame->editor().killRing()->setToYankedState();
    11481148    return true;
    11491149}
     
    11511151static bool executeYankAndSelect(Frame* frame, Event*, EditorCommandSource, const String&)
    11521152{
    1153     frame->editor()->insertTextWithoutSendingTextEvent(frame->editor()->killRing()->yank(), true, 0);
    1154     frame->editor()->killRing()->setToYankedState();
     1153    frame->editor().insertTextWithoutSendingTextEvent(frame->editor().killRing()->yank(), true, 0);
     1154    frame->editor().killRing()->setToYankedState();
    11551155    return true;
    11561156}
     
    11761176    bool defaultValue = settings && settings->javaScriptCanAccessClipboard();
    11771177
    1178     EditorClient* client = frame->editor()->client();
     1178    EditorClient* client = frame->editor().client();
    11791179    return client ? client->canCopyCut(frame, defaultValue) : defaultValue;
    11801180}
     
    11881188    bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed();
    11891189
    1190     EditorClient* client = frame->editor()->client();
     1190    EditorClient* client = frame->editor().client();
    11911191    return client ? client->canPaste(frame, defaultValue) : defaultValue;
    11921192}
     
    12021202{
    12031203    // The term "visible" here includes a caret in editable text or a range in any text.
    1204     const VisibleSelection& selection = frame->editor()->selectionForCommand(event);
     1204    const VisibleSelection& selection = frame->editor().selectionForCommand(event);
    12051205    return (selection.isCaret() && selection.isContentEditable()) || selection.isRange();
    12061206}
     
    12211221static bool enabledVisibleSelectionAndMark(Frame* frame, Event* event, EditorCommandSource)
    12221222{
    1223     const VisibleSelection& selection = frame->editor()->selectionForCommand(event);
     1223    const VisibleSelection& selection = frame->editor().selectionForCommand(event);
    12241224    return ((selection.isCaret() && selection.isContentEditable()) || selection.isRange())
    1225         && frame->editor()->mark().isCaretOrRange();
     1225        && frame->editor().mark().isCaretOrRange();
    12261226}
    12271227
    12281228static bool enableCaretInEditableText(Frame* frame, Event* event, EditorCommandSource)
    12291229{
    1230     const VisibleSelection& selection = frame->editor()->selectionForCommand(event);
     1230    const VisibleSelection& selection = frame->editor().selectionForCommand(event);
    12311231    return selection.isCaret() && selection.isContentEditable();
    12321232}
     
    12341234static bool enabledCopy(Frame* frame, Event*, EditorCommandSource)
    12351235{
    1236     return frame->editor()->canDHTMLCopy() || frame->editor()->canCopy();
     1236    return frame->editor().canDHTMLCopy() || frame->editor().canCopy();
    12371237}
    12381238
    12391239static bool enabledCut(Frame* frame, Event*, EditorCommandSource)
    12401240{
    1241     return frame->editor()->canDHTMLCut() || frame->editor()->canCut();
     1241    return frame->editor().canDHTMLCut() || frame->editor().canCut();
    12421242}
    12431243
    12441244static bool enabledInEditableText(Frame* frame, Event* event, EditorCommandSource)
    12451245{
    1246     return frame->editor()->selectionForCommand(event).rootEditableElement();
     1246    return frame->editor().selectionForCommand(event).rootEditableElement();
    12471247}
    12481248
     
    12511251    switch (source) {
    12521252    case CommandFromMenuOrKeyBinding:   
    1253         return frame->editor()->canDelete();
     1253        return frame->editor().canDelete();
    12541254    case CommandFromDOM:
    12551255    case CommandFromDOMWithUserInterface:
     
    12751275static bool enabledPaste(Frame* frame, Event*, EditorCommandSource)
    12761276{
    1277     return frame->editor()->canPaste();
     1277    return frame->editor().canPaste();
    12781278}
    12791279
     
    12901290static bool enabledRedo(Frame* frame, Event*, EditorCommandSource)
    12911291{
    1292     return frame->editor()->canRedo();
     1292    return frame->editor().canRedo();
    12931293}
    12941294
     
    12961296static bool enabledTakeFindStringFromSelection(Frame* frame, Event*, EditorCommandSource)
    12971297{
    1298     return frame->editor()->canCopyExcludingStandaloneImages();
     1298    return frame->editor().canCopyExcludingStandaloneImages();
    12991299}
    13001300#endif
     
    13021302static bool enabledUndo(Frame* frame, Event*, EditorCommandSource)
    13031303{
    1304     return frame->editor()->canUndo();
     1304    return frame->editor().canUndo();
    13051305}
    13061306
     
    13241324static TriState stateOrderedList(Frame* frame, Event*)
    13251325{
    1326     return frame->editor()->selectionOrderedListState();
     1326    return frame->editor().selectionOrderedListState();
    13271327}
    13281328
     
    13341334static TriState stateStyleWithCSS(Frame* frame, Event*)
    13351335{
    1336     return frame->editor()->shouldStyleWithCSS() ? TrueTriState : FalseTriState;
     1336    return frame->editor().shouldStyleWithCSS() ? TrueTriState : FalseTriState;
    13371337}
    13381338
     
    13691369static TriState stateUnorderedList(Frame* frame, Event*)
    13701370{
    1371     return frame->editor()->selectionUnorderedListState();
     1371    return frame->editor().selectionUnorderedListState();
    13721372}
    13731373
     
    14061406static String valueDefaultParagraphSeparator(Frame* frame, Event*)
    14071407{
    1408     switch (frame->editor()->defaultParagraphSeparator()) {
     1408    switch (frame->editor().defaultParagraphSeparator()) {
    14091409    case EditorParagraphSeparatorIsDiv:
    14101410        return divTag.localName();
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r149432 r150140  
    103103static inline bool shouldAlwaysUseDirectionalSelection(Frame* frame)
    104104{
    105     return !frame || frame->editor()->behavior().shouldConsiderSelectionAsDirectional();
     105    return !frame || frame->editor().behavior().shouldConsiderSelectionAsDirectional();
    106106}
    107107
     
    328328    selectFrameElementInParentIfFullySelected();
    329329    notifyRendererOfSelectionChange(userTriggered);
    330     m_frame->editor()->respondToChangedSelection(oldSelection, options);
     330    m_frame->editor().respondToChangedSelection(oldSelection, options);
    331331    if (userTriggered == UserTriggered) {
    332332        ScrollAlignment alignment;
    333333
    334         if (m_frame->editor()->behavior().shouldCenterAlignWhenSelectionIsRevealed())
     334        if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsRevealed())
    335335            alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignCenterAlways : ScrollAlignment::alignCenterIfNeeded;
    336336        else
     
    587587    VisiblePosition positionAfterCurrentWord = nextWordPosition(originalPosition);
    588588
    589     if (m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight()) {
     589    if (m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight()) {
    590590        // In order to skip spaces when moving right, we advance one
    591591        // word further and then move one word back. Given the
     
    714714        // Visual word movement relies on isWordTextBreak which is not implemented in WinCE and QT.
    715715        // https://bugs.webkit.org/show_bug.cgi?id=81136.
    716         bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight();
     716        bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight();
    717717        pos = rightWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight);
    718718        break;
     
    888888    case WordGranularity: {
    889889#if USE(ICU_UNICODE)
    890         bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor()->behavior().shouldSkipSpaceWhenMovingRight();
     890        bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight();
    891891        pos = leftWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight);
    892892        break;
     
    10251025        if (!m_selection.isCaret()
    10261026            && (granularity == WordGranularity || granularity == ParagraphGranularity || granularity == LineGranularity)
    1027             && m_frame && !m_frame->editor()->behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) {
     1027            && m_frame && !m_frame->editor().behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) {
    10281028            // Don't let the selection go across the base position directly. Needed to match mac
    10291029            // behavior when, for instance, word-selecting backwards starting with the caret in
     
    10381038        // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the
    10391039        // base in place and moving the extent. Matches NSTextView.
    1040         if (!m_frame || !m_frame->editor()->behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
     1040        if (!m_frame || !m_frame->editor().behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
    10411041            setExtent(position, userTriggered);
    10421042        else {
     
    17501750inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame)
    17511751{
    1752     return frame->editor()->lastEditCommand() && frame->editor()->lastEditCommand()->shouldStopCaretBlinking();
     1752    return frame->editor().lastEditCommand() && frame->editor().lastEditCommand()->shouldStopCaretBlinking();
    17531753}
    17541754
     
    19291929bool FrameSelection::shouldDeleteSelection(const VisibleSelection& selection) const
    19301930{
    1931     return m_frame->editor()->client()->shouldDeleteRange(selection.toNormalizedRange().get());
     1931    return m_frame->editor().client()->shouldDeleteRange(selection.toNormalizedRange().get());
    19321932}
    19331933
     
    20482048bool FrameSelection::shouldChangeSelection(const VisibleSelection& newSelection) const
    20492049{
    2050     return m_frame->editor()->shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
     2050    return m_frame->editor().shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
    20512051}
    20522052
  • trunk/Source/WebCore/editing/InsertTextCommand.cpp

    r146999 r150140  
    148148        if (endingSelection().isNone())
    149149            return;
    150     } else if (document()->frame()->editor()->isOverwriteModeEnabled()) {
     150    } else if (document()->frame()->editor().isOverwriteModeEnabled()) {
    151151        if (performOverwrite(m_text, m_selectInsertedText))
    152152            return;
  • trunk/Source/WebCore/editing/SpellChecker.cpp

    r148545 r150140  
    213213    }
    214214
    215     m_frame->editor()->markAndReplaceFor(m_processingRequest, results);
     215    m_frame->editor().markAndReplaceFor(m_processingRequest, results);
    216216
    217217    if (m_lastProcessedSequence < sequence)
  • trunk/Source/WebCore/editing/SpellingCorrectionCommand.cpp

    r148545 r150140  
    6464    {
    6565        if (!m_hasBeenUndone) {
    66             document()->frame()->editor()->unappliedSpellCorrection(startingSelection(), m_corrected, m_correction);
     66            document()->frame()->editor().unappliedSpellCorrection(startingSelection(), m_corrected, m_correction);
    6767            m_hasBeenUndone = true;
    6868        }
  • trunk/Source/WebCore/editing/TypingCommand.cpp

    r148306 r150140  
    162162
    163163    if (!text.isEmpty())
    164         document->frame()->editor()->updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));
     164        document->frame()->editor().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));
    165165   
    166166    insertText(document, text, frame->selection()->selection(), options, composition);
     
    238238    ASSERT(frame);
    239239
    240     RefPtr<CompositeEditCommand> lastEditCommand = frame->editor()->lastEditCommand();
     240    RefPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand();
    241241    if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand.get())->isOpenForMoreTyping())
    242242        return 0;
     
    299299
    300300#if PLATFORM(MAC)
    301     if (!frame->editor()->isContinuousSpellCheckingEnabled()
    302      && !frame->editor()->isAutomaticQuoteSubstitutionEnabled()
    303      && !frame->editor()->isAutomaticLinkDetectionEnabled()
    304      && !frame->editor()->isAutomaticDashSubstitutionEnabled()
    305      && !frame->editor()->isAutomaticTextReplacementEnabled())
    306         return;
     301    if (!frame->editor().isContinuousSpellCheckingEnabled()
     302        && !frame->editor().isAutomaticQuoteSubstitutionEnabled()
     303        && !frame->editor().isAutomaticLinkDetectionEnabled()
     304        && !frame->editor().isAutomaticDashSubstitutionEnabled()
     305        && !frame->editor().isAutomaticTextReplacementEnabled())
     306            return;
    307307#else
    308     if (!frame->editor()->isContinuousSpellCheckingEnabled())
     308    if (!frame->editor().isContinuousSpellCheckingEnabled())
    309309        return;
    310310#endif
     
    323323            if (range && (commandType == TypingCommand::InsertText || commandType == TypingCommand::InsertLineBreak || commandType == TypingCommand::InsertParagraphSeparator || commandType == TypingCommand::InsertParagraphSeparatorInQuotedContent))
    324324                strippedPreviousWord = plainText(range.get()).stripWhiteSpace();
    325             frame->editor()->markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty());
     325            frame->editor().markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty());
    326326        } else if (commandType == TypingCommand::InsertText)
    327             frame->editor()->startAlternativeTextUITimer();
     327            frame->editor().startAlternativeTextUITimer();
    328328    }
    329329}
     
    338338
    339339#if PLATFORM(MAC)
    340     frame->editor()->appliedEditing(this);
     340    frame->editor().appliedEditing(this);
    341341    // Since the spellchecking code may also perform corrections and other replacements, it should happen after the typing changes.
    342342    if (!m_shouldPreventSpellChecking)
     
    345345    // The old spellchecking code requires that checking be done first, to prevent issues like that in 6864072, where <doesn't> is marked as misspelled.
    346346    markMisspellingsAfterTyping(commandTypeForAddedTyping);
    347     frame->editor()->appliedEditing(this);
     347    frame->editor().appliedEditing(this);
    348348#endif
    349349}
     
    428428        return;
    429429
    430     frame->editor()->updateMarkersForWordsAffectedByEditing(false);
     430    frame->editor().updateMarkersForWordsAffectedByEditing(false);
    431431
    432432    VisibleSelection selectionToDelete;
     
    515515   
    516516    if (killRing)
    517         frame->editor()->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
     517        frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
    518518    // Make undo select everything that has been deleted, unless an undo will undo more than just this deletion.
    519519    // FIXME: This behaves like TextEdit except for the case where you open with text insertion and then delete
     
    532532        return;
    533533
    534     frame->editor()->updateMarkersForWordsAffectedByEditing(false);
     534    frame->editor().updateMarkersForWordsAffectedByEditing(false);
    535535
    536536    VisibleSelection selectionToDelete;
     
    608608       
    609609    if (killRing)
    610         frame->editor()->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
     610        frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
    611611    // make undo select what was deleted
    612612    setStartingSelection(selectionAfterUndo);
  • trunk/Source/WebCore/editing/htmlediting.cpp

    r145818 r150140  
    856856PassRefPtr<HTMLElement> createDefaultParagraphElement(Document* document)
    857857{
    858     switch (document->frame()->editor()->defaultParagraphSeparator()) {
     858    switch (document->frame()->editor().defaultParagraphSeparator()) {
    859859    case EditorParagraphSeparatorIsDiv:
    860860        return HTMLDivElement::create(document);
  • trunk/Source/WebCore/editing/mac/EditorMac.mm

    r150129 r150140  
    8383    bool choosePlainText;
    8484   
    85     m_frame->editor()->client()->setInsertionPasteboard(NSGeneralPboard);
     85    m_frame->editor().client()->setInsertionPasteboard(NSGeneralPboard);
    8686#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
    8787    RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
     
    103103    }
    104104#endif
    105     m_frame->editor()->client()->setInsertionPasteboard(String());
     105    m_frame->editor().client()->setInsertionPasteboard(String());
    106106}
    107107
  • trunk/Source/WebCore/editing/markup.cpp

    r148854 r150140  
    656656    RefPtr<Range> updatedRangeRef;
    657657    if (frame) {
    658         updatedRangeRef = frame->editor()->avoidIntersectionWithDeleteButtonController(range);
     658        updatedRangeRef = frame->editor().avoidIntersectionWithDeleteButtonController(range);
    659659        updatedRange = updatedRangeRef.get();
    660660        if (!updatedRange)
     
    770770#if ENABLE(DELETION_UI)
    771771    if (Frame* frame = node->document()->frame()) {
    772         deleteButtonContainerElement = frame->editor()->deleteButtonController()->containerElement();
     772        deleteButtonContainerElement = frame->editor().deleteButtonController()->containerElement();
    773773        if (node->isDescendantOf(deleteButtonContainerElement))
    774774            return "";
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r149392 r150140  
    431431
    432432    if (Frame* frame = document()->frame())
    433         frame->editor()->textFieldDidEndEditing(this);
     433        frame->editor().textFieldDidEndEditing(this);
    434434}
    435435
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r148545 r150140  
    284284
    285285    if (Frame* frame = document()->frame())
    286         frame->editor()->textDidChangeInTextArea(this);
     286        frame->editor().textDidChangeInTextArea(this);
    287287    // When typing in a textarea, childrenChanged is not called, so we need to force the directionality check.
    288288    calculateAndAdjustDirectionality();
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r149015 r150140  
    147147        return;
    148148    Frame* frame = element()->document()->frame();
    149     if (!frame || !frame->editor()->doTextFieldCommandFromEvent(element(), event))
     149    if (!frame || !frame->editor().doTextFieldCommandFromEvent(element(), event))
    150150        return;
    151151    event->setDefaultHandled();
     
    474474    if (Frame* frame = element()->document()->frame()) {
    475475        if (state == ValueChangeStateNone)
    476             frame->editor()->textFieldDidBeginEditing(element());
    477         frame->editor()->textDidChangeInTextField(element());
     476            frame->editor().textFieldDidBeginEditing(element());
     477        frame->editor().textDidChangeInTextField(element());
    478478    }
    479479}
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r150104 r150140  
    483483    stopLoading(currentDocument && !currentDocument->inPageCache() ? UnloadEventPolicyUnloadAndPageHide : UnloadEventPolicyUnloadOnly);
    484484   
    485     m_frame->editor()->clearUndoRedoOperations();
     485    m_frame->editor().clearUndoRedoOperations();
    486486    return true;
    487487}
     
    496496
    497497    m_frame->navigationScheduler()->cancel();
    498     m_frame->editor()->clearLastEditCommand();
     498    m_frame->editor().clearLastEditCommand();
    499499
    500500    m_isComplete = false;
     
    545545void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView)
    546546{
    547     m_frame->editor()->clear();
     547    m_frame->editor().clear();
    548548
    549549    if (!m_needsClear)
  • trunk/Source/WebCore/page/ContextMenuController.cpp

    r147710 r150140  
    198198{
    199199    String text(&character, 1);
    200     if (!frame->editor()->shouldInsertText(text, frame->selection()->toNormalizedRange().get(), EditorInsertActionTyped))
     200    if (!frame->editor().shouldInsertText(text, frame->selection()->toNormalizedRange().get(), EditorInsertActionTyped))
    201201        return;
    202202
     
    233233        break;
    234234    case ContextMenuItemTagCopyLinkToClipboard:
    235         frame->editor()->copyURL(m_hitTestResult.absoluteLinkURL(), m_hitTestResult.textContent());
     235        frame->editor().copyURL(m_hitTestResult.absoluteLinkURL(), m_hitTestResult.textContent());
    236236        break;
    237237    case ContextMenuItemTagOpenImageInNewWindow:
     
    245245        // FIXME: The Pasteboard class is not written yet
    246246        // For now, call into the client. This is temporary!
    247         frame->editor()->copyImage(m_hitTestResult);
     247        frame->editor().copyImage(m_hitTestResult);
    248248        break;
    249249#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    250250    case ContextMenuItemTagCopyImageUrlToClipboard:
    251         frame->editor()->copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent());
     251        frame->editor().copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent());
    252252        break;
    253253#endif
     
    256256        break;
    257257    case ContextMenuItemTagCopyMediaLinkToClipboard:
    258         frame->editor()->copyURL(m_hitTestResult.absoluteMediaURL(), m_hitTestResult.textContent());
     258        frame->editor().copyURL(m_hitTestResult.absoluteMediaURL(), m_hitTestResult.textContent());
    259259        break;
    260260    case ContextMenuItemTagToggleMediaControls:
     
    282282    }
    283283    case ContextMenuItemTagCopy:
    284         frame->editor()->copy();
     284        frame->editor().copy();
    285285        break;
    286286    case ContextMenuItemTagGoBack:
     
    299299        break;
    300300    case ContextMenuItemTagCut:
    301         frame->editor()->command("Cut").execute();
     301        frame->editor().command("Cut").execute();
    302302        break;
    303303    case ContextMenuItemTagPaste:
    304         frame->editor()->command("Paste").execute();
     304        frame->editor().command("Paste").execute();
    305305        break;
    306306#if PLATFORM(GTK)
    307307    case ContextMenuItemTagDelete:
    308         frame->editor()->performDelete();
     308        frame->editor().performDelete();
    309309        break;
    310310    case ContextMenuItemTagUnicodeInsertLRMMark:
     
    341341#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    342342    case ContextMenuItemTagSelectAll:
    343         frame->editor()->command("SelectAll").execute();
     343        frame->editor().command("SelectAll").execute();
    344344        break;
    345345#endif
    346346    case ContextMenuItemTagSpellingGuess: {
    347347        FrameSelection* frameSelection = frame->selection();
    348         if (frame->editor()->shouldInsertText(item->title(), frameSelection->toNormalizedRange().get(), EditorInsertActionPasted)) {
     348        if (frame->editor().shouldInsertText(item->title(), frameSelection->toNormalizedRange().get(), EditorInsertActionPasted)) {
    349349            Document* document = frame->document();
    350350            ReplaceSelectionCommand::CommandOptions replaceOptions = ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting;
    351351
    352             if (frame->editor()->behavior().shouldAllowSpellingSuggestionsWithoutSelection()) {
     352            if (frame->editor().behavior().shouldAllowSpellingSuggestionsWithoutSelection()) {
    353353                ASSERT(frameSelection->isCaretOrRange());
    354354                VisibleSelection wordSelection(frameSelection->base());
     
    356356                frameSelection->setSelection(wordSelection);
    357357            } else {
    358                 ASSERT(frame->editor()->selectedText().length());
     358                ASSERT(frame->editor().selectedText().length());
    359359                replaceOptions |= ReplaceSelectionCommand::SelectReplacement;
    360360            }
     
    367367    }
    368368    case ContextMenuItemTagIgnoreSpelling:
    369         frame->editor()->ignoreSpelling();
     369        frame->editor().ignoreSpelling();
    370370        break;
    371371    case ContextMenuItemTagLearnSpelling:
    372         frame->editor()->learnSpelling();
     372        frame->editor().learnSpelling();
    373373        break;
    374374    case ContextMenuItemTagSearchWeb:
     
    389389        break;
    390390    case ContextMenuItemTagBold:
    391         frame->editor()->command("ToggleBold").execute();
     391        frame->editor().command("ToggleBold").execute();
    392392        break;
    393393    case ContextMenuItemTagItalic:
    394         frame->editor()->command("ToggleItalic").execute();
     394        frame->editor().command("ToggleItalic").execute();
    395395        break;
    396396    case ContextMenuItemTagUnderline:
    397         frame->editor()->toggleUnderline();
     397        frame->editor().toggleUnderline();
    398398        break;
    399399    case ContextMenuItemTagOutline:
     
    415415        break;
    416416    case ContextMenuItemTagDefaultDirection:
    417         frame->editor()->setBaseWritingDirection(NaturalWritingDirection);
     417        frame->editor().setBaseWritingDirection(NaturalWritingDirection);
    418418        break;
    419419    case ContextMenuItemTagLeftToRight:
    420         frame->editor()->setBaseWritingDirection(LeftToRightWritingDirection);
     420        frame->editor().setBaseWritingDirection(LeftToRightWritingDirection);
    421421        break;
    422422    case ContextMenuItemTagRightToLeft:
    423         frame->editor()->setBaseWritingDirection(RightToLeftWritingDirection);
     423        frame->editor().setBaseWritingDirection(RightToLeftWritingDirection);
    424424        break;
    425425    case ContextMenuItemTagTextDirectionDefault:
    426         frame->editor()->command("MakeTextWritingDirectionNatural").execute();
     426        frame->editor().command("MakeTextWritingDirectionNatural").execute();
    427427        break;
    428428    case ContextMenuItemTagTextDirectionLeftToRight:
    429         frame->editor()->command("MakeTextWritingDirectionLeftToRight").execute();
     429        frame->editor().command("MakeTextWritingDirectionLeftToRight").execute();
    430430        break;
    431431    case ContextMenuItemTagTextDirectionRightToLeft:
    432         frame->editor()->command("MakeTextWritingDirectionRightToLeft").execute();
     432        frame->editor().command("MakeTextWritingDirectionRightToLeft").execute();
    433433        break;
    434434#if PLATFORM(MAC)
     
    438438#endif
    439439    case ContextMenuItemTagShowSpellingPanel:
    440         frame->editor()->showSpellingGuessPanel();
     440        frame->editor().showSpellingGuessPanel();
    441441        break;
    442442    case ContextMenuItemTagCheckSpelling:
    443         frame->editor()->advanceToNextMisspelling();
     443        frame->editor().advanceToNextMisspelling();
    444444        break;
    445445    case ContextMenuItemTagCheckSpellingWhileTyping:
    446         frame->editor()->toggleContinuousSpellChecking();
     446        frame->editor().toggleContinuousSpellChecking();
    447447        break;
    448448    case ContextMenuItemTagCheckGrammarWithSpelling:
    449         frame->editor()->toggleGrammarChecking();
     449        frame->editor().toggleGrammarChecking();
    450450        break;
    451451#if PLATFORM(MAC)
    452452    case ContextMenuItemTagShowFonts:
    453         frame->editor()->showFontPanel();
     453        frame->editor().showFontPanel();
    454454        break;
    455455    case ContextMenuItemTagStyles:
    456         frame->editor()->showStylesPanel();
     456        frame->editor().showStylesPanel();
    457457        break;
    458458    case ContextMenuItemTagShowColors:
    459         frame->editor()->showColorPanel();
     459        frame->editor().showColorPanel();
    460460        break;
    461461#endif
    462462#if USE(APPKIT)
    463463    case ContextMenuItemTagMakeUpperCase:
    464         frame->editor()->uppercaseWord();
     464        frame->editor().uppercaseWord();
    465465        break;
    466466    case ContextMenuItemTagMakeLowerCase:
    467         frame->editor()->lowercaseWord();
     467        frame->editor().lowercaseWord();
    468468        break;
    469469    case ContextMenuItemTagCapitalize:
    470         frame->editor()->capitalizeWord();
     470        frame->editor().capitalizeWord();
    471471        break;
    472472#endif
    473473#if PLATFORM(MAC)
    474474    case ContextMenuItemTagChangeBack:
    475         frame->editor()->changeBackToReplacedString(m_hitTestResult.replacedString());
     475        frame->editor().changeBackToReplacedString(m_hitTestResult.replacedString());
    476476        break;
    477477#endif
    478478#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    479479    case ContextMenuItemTagShowSubstitutions:
    480         frame->editor()->showSubstitutionsPanel();
     480        frame->editor().showSubstitutionsPanel();
    481481        break;
    482482    case ContextMenuItemTagSmartCopyPaste:
    483         frame->editor()->toggleSmartInsertDelete();
     483        frame->editor().toggleSmartInsertDelete();
    484484        break;
    485485    case ContextMenuItemTagSmartQuotes:
    486         frame->editor()->toggleAutomaticQuoteSubstitution();
     486        frame->editor().toggleAutomaticQuoteSubstitution();
    487487        break;
    488488    case ContextMenuItemTagSmartDashes:
    489         frame->editor()->toggleAutomaticDashSubstitution();
     489        frame->editor().toggleAutomaticDashSubstitution();
    490490        break;
    491491    case ContextMenuItemTagSmartLinks:
    492         frame->editor()->toggleAutomaticLinkDetection();
     492        frame->editor().toggleAutomaticLinkDetection();
    493493        break;
    494494    case ContextMenuItemTagTextReplacement:
    495         frame->editor()->toggleAutomaticTextReplacement();
     495        frame->editor().toggleAutomaticTextReplacement();
    496496        break;
    497497    case ContextMenuItemTagCorrectSpellingAutomatically:
    498         frame->editor()->toggleAutomaticSpellingCorrection();
     498        frame->editor().toggleAutomaticSpellingCorrection();
    499499        break;
    500500#endif
     
    506506#endif
    507507    case ContextMenuItemTagDictationAlternative:
    508         frame->editor()->applyDictationAlternativelternative(item->title());
     508        frame->editor().applyDictationAlternativelternative(item->title());
    509509        break;
    510510    default:
     
    857857                if (selectionContainsPossibleWord(frame)) {
    858858#if PLATFORM(MAC)
    859                     String selectedString = frame->displayStringModifiedByEncoding(frame->editor()->selectedText());
     859                    String selectedString = frame->displayStringModifiedByEncoding(frame->editor().selectedText());
    860860                    ContextMenuItem LookUpInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary, contextMenuItemTagLookUpInDictionary(selectedString));
    861861
     
    924924        if (!inPasswordField) {
    925925            bool haveContextMenuItemsForMisspellingOrGrammer = false;
    926             bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabledFor(node);
     926            bool spellCheckingEnabled = frame->editor().isSpellCheckingEnabledFor(node);
    927927            if (spellCheckingEnabled) {
    928928                // Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range
     
    930930                bool misspelling;
    931931                bool badGrammar;
    932                 Vector<String> guesses = frame->editor()->guessesForMisspelledOrUngrammatical(misspelling, badGrammar);
     932                Vector<String> guesses = frame->editor().guessesForMisspelledOrUngrammatical(misspelling, badGrammar);
    933933                if (misspelling || badGrammar) {
    934934                    size_t size = guesses.size();
     
    998998        if (m_hitTestResult.isSelected() && !inPasswordField && selectionContainsPossibleWord(frame)) {
    999999#if PLATFORM(MAC)
    1000             String selectedString = frame->displayStringModifiedByEncoding(frame->editor()->selectedText());
     1000            String selectedString = frame->displayStringModifiedByEncoding(frame->editor().selectedText());
    10011001            ContextMenuItem LookUpInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary, contextMenuItemTagLookUpInDictionary(selectedString));
    10021002
     
    10491049#endif
    10501050#if PLATFORM(GTK)
    1051             bool shouldShowFontMenu = frame->editor()->canEditRichly();
     1051            bool shouldShowFontMenu = frame->editor().canEditRichly();
    10521052#else
    10531053            bool shouldShowFontMenu = true;
     
    10651065#endif
    10661066#if PLATFORM(GTK)
    1067             EditorClient* client = frame->editor()->client();
     1067            EditorClient* client = frame->editor().client();
    10681068            if (client && client->shouldShowUnicodeMenu()) {
    10691069                ContextMenuItem UnicodeMenuItem(SubmenuType, ContextMenuItemTagUnicode, contextMenuItemTagUnicode());
     
    10801080                if (Settings* settings = page->settings()) {
    10811081                    bool includeTextDirectionSubmenu = settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAlwaysIncluded
    1082                         || (settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAutomaticallyIncluded && frame->editor()->hasBidiSelection());
     1082                        || (settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAutomaticallyIncluded && frame->editor().hasBidiSelection());
    10831083                    if (includeTextDirectionSubmenu) {
    10841084                        ContextMenuItem TextDirectionMenuItem(SubmenuType, ContextMenuItemTagTextDirectionMenu,
     
    11411141    switch (item.action()) {
    11421142        case ContextMenuItemTagCheckSpelling:
    1143             shouldEnable = frame->editor()->canEdit();
     1143            shouldEnable = frame->editor().canEdit();
    11441144            break;
    11451145        case ContextMenuItemTagDefaultDirection:
     
    11501150        case ContextMenuItemTagRightToLeft: {
    11511151            String direction = item.action() == ContextMenuItemTagLeftToRight ? "ltr" : "rtl";
    1152             shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyDirection, direction) != FalseTriState;
     1152            shouldCheck = frame->editor().selectionHasStyle(CSSPropertyDirection, direction) != FalseTriState;
    11531153            shouldEnable = true;
    11541154            break;
    11551155        }
    11561156        case ContextMenuItemTagTextDirectionDefault: {
    1157             Editor::Command command = frame->editor()->command("MakeTextWritingDirectionNatural");
     1157            Editor::Command command = frame->editor().command("MakeTextWritingDirectionNatural");
    11581158            shouldCheck = command.state() == TrueTriState;
    11591159            shouldEnable = command.isEnabled();
     
    11611161        }
    11621162        case ContextMenuItemTagTextDirectionLeftToRight: {
    1163             Editor::Command command = frame->editor()->command("MakeTextWritingDirectionLeftToRight");
     1163            Editor::Command command = frame->editor().command("MakeTextWritingDirectionLeftToRight");
    11641164            shouldCheck = command.state() == TrueTriState;
    11651165            shouldEnable = command.isEnabled();
     
    11671167        }
    11681168        case ContextMenuItemTagTextDirectionRightToLeft: {
    1169             Editor::Command command = frame->editor()->command("MakeTextWritingDirectionRightToLeft");
     1169            Editor::Command command = frame->editor().command("MakeTextWritingDirectionRightToLeft");
    11701170            shouldCheck = command.state() == TrueTriState;
    11711171            shouldEnable = command.isEnabled();
     
    11731173        }
    11741174        case ContextMenuItemTagCopy:
    1175             shouldEnable = frame->editor()->canDHTMLCopy() || frame->editor()->canCopy();
     1175            shouldEnable = frame->editor().canDHTMLCopy() || frame->editor().canCopy();
    11761176            break;
    11771177        case ContextMenuItemTagCut:
    1178             shouldEnable = frame->editor()->canDHTMLCut() || frame->editor()->canCut();
     1178            shouldEnable = frame->editor().canDHTMLCut() || frame->editor().canCut();
    11791179            break;
    11801180        case ContextMenuItemTagIgnoreSpelling:
     
    11831183            break;
    11841184        case ContextMenuItemTagPaste:
    1185             shouldEnable = frame->editor()->canDHTMLPaste() || frame->editor()->canPaste();
     1185            shouldEnable = frame->editor().canDHTMLPaste() || frame->editor().canPaste();
    11861186            break;
    11871187#if PLATFORM(GTK)
    11881188        case ContextMenuItemTagDelete:
    1189             shouldEnable = frame->editor()->canDelete();
     1189            shouldEnable = frame->editor().canDelete();
    11901190            break;
    11911191        case ContextMenuItemTagInputMethods:
     
    12101210#endif
    12111211        case ContextMenuItemTagUnderline: {
    1212             shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") != FalseTriState;
    1213             shouldEnable = frame->editor()->canEditRichly();
     1212            shouldCheck = frame->editor().selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") != FalseTriState;
     1213            shouldEnable = frame->editor().canEditRichly();
    12141214            break;
    12151215        }
     
    12181218            break;
    12191219        case ContextMenuItemTagCheckGrammarWithSpelling:
    1220             if (frame->editor()->isGrammarCheckingEnabled())
     1220            if (frame->editor().isGrammarCheckingEnabled())
    12211221                shouldCheck = true;
    12221222            shouldEnable = true;
    12231223            break;
    12241224        case ContextMenuItemTagItalic: {
    1225             shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState;
    1226             shouldEnable = frame->editor()->canEditRichly();
     1225            shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState;
     1226            shouldEnable = frame->editor().canEditRichly();
    12271227            break;
    12281228        }
    12291229        case ContextMenuItemTagBold: {
    1230             shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyFontWeight, "bold") != FalseTriState;
    1231             shouldEnable = frame->editor()->canEditRichly();
     1230            shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontWeight, "bold") != FalseTriState;
     1231            shouldEnable = frame->editor().canEditRichly();
    12321232            break;
    12331233        }
     
    12361236            break;
    12371237        case ContextMenuItemTagShowSpellingPanel:
    1238             if (frame->editor()->spellingPanelIsShowing())
     1238            if (frame->editor().spellingPanelIsShowing())
    12391239                item.setTitle(contextMenuItemTagShowSpellingPanel(false));
    12401240            else
    12411241                item.setTitle(contextMenuItemTagShowSpellingPanel(true));
    1242             shouldEnable = frame->editor()->canEdit();
     1242            shouldEnable = frame->editor().canEdit();
    12431243            break;
    12441244        case ContextMenuItemTagNoGuessesFound:
     
    12461246            break;
    12471247        case ContextMenuItemTagCheckSpellingWhileTyping:
    1248             shouldCheck = frame->editor()->isContinuousSpellCheckingEnabled();
     1248            shouldCheck = frame->editor().isContinuousSpellCheckingEnabled();
    12491249            break;
    12501250#if PLATFORM(MAC)
     
    12531253            break;
    12541254        case ContextMenuItemTagShowSubstitutions:
    1255             if (frame->editor()->substitutionsPanelIsShowing())
     1255            if (frame->editor().substitutionsPanelIsShowing())
    12561256                item.setTitle(contextMenuItemTagShowSubstitutions(false));
    12571257            else
    12581258                item.setTitle(contextMenuItemTagShowSubstitutions(true));
    1259             shouldEnable = frame->editor()->canEdit();
     1259            shouldEnable = frame->editor().canEdit();
    12601260            break;
    12611261        case ContextMenuItemTagMakeUpperCase:
     
    12631263        case ContextMenuItemTagCapitalize:
    12641264        case ContextMenuItemTagChangeBack:
    1265             shouldEnable = frame->editor()->canEdit();
     1265            shouldEnable = frame->editor().canEdit();
    12661266            break;
    12671267        case ContextMenuItemTagCorrectSpellingAutomatically:
    1268             shouldCheck = frame->editor()->isAutomaticSpellingCorrectionEnabled();
     1268            shouldCheck = frame->editor().isAutomaticSpellingCorrectionEnabled();
    12691269            break;
    12701270        case ContextMenuItemTagSmartCopyPaste:
    1271             shouldCheck = frame->editor()->smartInsertDeleteEnabled();
     1271            shouldCheck = frame->editor().smartInsertDeleteEnabled();
    12721272            break;
    12731273        case ContextMenuItemTagSmartQuotes:
    1274             shouldCheck = frame->editor()->isAutomaticQuoteSubstitutionEnabled();
     1274            shouldCheck = frame->editor().isAutomaticQuoteSubstitutionEnabled();
    12751275            break;
    12761276        case ContextMenuItemTagSmartDashes:
    1277             shouldCheck = frame->editor()->isAutomaticDashSubstitutionEnabled();
     1277            shouldCheck = frame->editor().isAutomaticDashSubstitutionEnabled();
    12781278            break;
    12791279        case ContextMenuItemTagSmartLinks:
    1280             shouldCheck = frame->editor()->isAutomaticLinkDetectionEnabled();
     1280            shouldCheck = frame->editor().isAutomaticLinkDetectionEnabled();
    12811281            break;
    12821282        case ContextMenuItemTagTextReplacement:
    1283             shouldCheck = frame->editor()->isAutomaticTextReplacementEnabled();
     1283            shouldCheck = frame->editor().isAutomaticTextReplacementEnabled();
    12841284            break;
    12851285        case ContextMenuItemTagStopSpeaking:
     
    13041304            break;
    13051305        case ContextMenuItemTagFontMenu:
    1306             shouldEnable = frame->editor()->canEditRichly();
     1306            shouldEnable = frame->editor().canEditRichly();
    13071307            break;
    13081308#else
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r150045 r150140  
    11141114
    11151115    // FIXME (13016): Support wholeWord, searchInFrames and showDialog
    1116     return m_frame->editor()->findString(string, !backwards, caseSensitive, wrap, false);
     1116    return m_frame->editor().findString(string, !backwards, caseSensitive, wrap, false);
    11171117}
    11181118
  • trunk/Source/WebCore/page/DragController.cpp

    r148395 r150140  
    442442    ASSERT(m_page->dragCaretController()->hasCaret());
    443443    String text = m_page->dragCaretController()->isContentRichlyEditable() ? "" : dragData->asPlainText(innerFrame);
    444     Node* target = innerFrame->editor()->findEventTargetFrom(m_page->dragCaretController()->caretPosition());
     444    Node* target = innerFrame->editor().findEventTargetFrom(m_page->dragCaretController()->caretPosition());
    445445    return target->dispatchEvent(TextEvent::createForDrop(innerFrame->document()->domWindow(), text), IGNORE_EXCEPTION);
    446446}
     
    476476        RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
    477477        style->setProperty(CSSPropertyColor, color.serialized(), false);
    478         if (!innerFrame->editor()->shouldApplyStyle(style.get(), innerRange.get()))
     478        if (!innerFrame->editor().shouldApplyStyle(style.get(), innerRange.get()))
    479479            return false;
    480480        m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
    481         innerFrame->editor()->applyStyle(style.get(), EditActionSetColor);
     481        innerFrame->editor().applyStyle(style.get(), EditActionSetColor);
    482482        return true;
    483483    }
     
    512512        bool chosePlainText = false;
    513513        RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, innerFrame.get(), range, true, chosePlainText);
    514         if (!fragment || !innerFrame->editor()->shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
     514        if (!fragment || !innerFrame->editor().shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
    515515            return false;
    516516        }
     
    520520            // NSTextView behavior is to always smart delete on moving a selection,
    521521            // but only to smart insert if the selection granularity is word granularity.
    522             bool smartDelete = innerFrame->editor()->smartInsertDeleteEnabled();
     522            bool smartDelete = innerFrame->editor().smartInsertDeleteEnabled();
    523523            bool smartInsert = smartDelete && innerFrame->selection()->granularity() == WordGranularity && dragData->canSmartReplace();
    524524            applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartInsert, smartDelete));
     
    535535    } else {
    536536        String text = dragData->asPlainText(innerFrame.get());
    537         if (text.isEmpty() || !innerFrame->editor()->shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
     537        if (text.isEmpty() || !innerFrame->editor().shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
    538538            return false;
    539539        }
     
    790790        if (!clipboard->hasData()) {
    791791            if (enclosingTextFormControl(src->selection()->start()))
    792                 clipboard->writePlainText(src->editor()->selectedTextForClipboard());
     792                clipboard->writePlainText(src->editor().selectedTextForClipboard());
    793793            else {
    794794                RefPtr<Range> selectionRange = src->selection()->toNormalizedRange();
  • trunk/Source/WebCore/page/EventHandler.cpp

    r149382 r150140  
    504504    if (m_mouseDownMayStartSelect) {
    505505        selectClosestWordFromHitTestResult(result.hitTestResult(),
    506             (result.event().clickCount() == 2 && m_frame->editor()->isSelectTrailingWhitespaceEnabled()) ? ShouldAppendTrailingWhitespace : DontAppendTrailingWhitespace);
     506            (result.event().clickCount() == 2 && m_frame->editor().isSelectTrailingWhitespaceEnabled()) ? ShouldAppendTrailingWhitespace : DontAppendTrailingWhitespace);
    507507    }
    508508}
     
    606606        }
    607607
    608         if (!m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional() && pos.isNotNull()) {
     608        if (!m_frame->editor().behavior().shouldConsiderSelectionAsDirectional() && pos.isNotNull()) {
    609609            // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
    610610            // was created right-to-left
     
    19751975    Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame();
    19761976    // Do not paste here if the focus was moved somewhere else.
    1977     if (m_frame == focusFrame && m_frame->editor()->client()->supportsGlobalSelection())
    1978         return m_frame->editor()->command(ASCIILiteral("PasteGlobalSelection")).execute();
     1977    if (m_frame == focusFrame && m_frame->editor().client()->supportsGlobalSelection())
     1978        return m_frame->editor().command(ASCIILiteral("PasteGlobalSelection")).execute();
    19791979
    19801980    return false;
     
    29032903    MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event);
    29042904
    2905     if (m_frame->editor()->behavior().shouldSelectOnContextualMenuClick()
     2905    if (m_frame->editor().behavior().shouldSelectOnContextualMenuClick()
    29062906        && !m_frame->selection()->contains(viewportPos)
    29072907        && !mev.scrollbar()
     
    29472947    if (start.deprecatedNode() && (selection->rootEditableElement() || selection->isRange())) {
    29482948        RefPtr<Range> selectionRange = selection->toNormalizedRange();
    2949         IntRect firstRect = m_frame->editor()->firstRectForRange(selectionRange.get());
     2949        IntRect firstRect = m_frame->editor().firstRectForRange(selectionRange.get());
    29502950
    29512951        int x = rightAligned ? firstRect.maxX() : firstRect.x();
     
    32463246    // 1. preventing default handling of keydown and keypress events has no effect on IM input;
    32473247    // 2. if an input method handles the event, its keyCode is set to 229 in keydown event.
    3248     m_frame->editor()->handleInputMethodKeydown(keydown.get());
     3248    m_frame->editor().handleInputMethodKeydown(keydown.get());
    32493249   
    32503250    bool handledByInputMethod = keydown->defaultHandled();
     
    33533353{
    33543354    if (event->type() == eventNames().keydownEvent) {
    3355         m_frame->editor()->handleKeyboardEvent(event);
     3355        m_frame->editor().handleKeyboardEvent(event);
    33563356        if (event->defaultHandled())
    33573357            return;
     
    33713371    }
    33723372    if (event->type() == eventNames().keypressEvent) {
    3373         m_frame->editor()->handleKeyboardEvent(event);
     3373        m_frame->editor().handleKeyboardEvent(event);
    33743374        if (event->defaultHandled())
    33753375            return;
     
    36723672void EventHandler::defaultTextInputEventHandler(TextEvent* event)
    36733673{
    3674     if (m_frame->editor()->handleTextEvent(event))
     3674    if (m_frame->editor().handleTextEvent(event))
    36753675        event->setDefaultHandled();
    36763676}
     
    37053705        return;
    37063706
    3707     if (!m_frame->editor()->behavior().shouldNavigateBackOnBackspace())
     3707    if (!m_frame->editor().behavior().shouldNavigateBackOnBackspace())
    37083708        return;
    37093709   
  • trunk/Source/WebCore/page/FocusController.cpp

    r149549 r150140  
    538538        return false;
    539539
    540     return frame->editor()->shouldEndEditing(rangeOfContents(root).get());
     540    return frame->editor().shouldEndEditing(rangeOfContents(root).get());
    541541}
    542542
  • trunk/Source/WebCore/page/Frame.cpp

    r149780 r150140  
    745745    if (previous.isNotNull()) {
    746746        RefPtr<Range> previousCharacterRange = makeRange(previous, position);
    747         LayoutRect rect = editor()->firstRectForRange(previousCharacterRange.get());
     747        LayoutRect rect = editor().firstRectForRange(previousCharacterRange.get());
    748748        if (rect.contains(framePoint))
    749749            return previousCharacterRange.release();
     
    752752    VisiblePosition next = position.next();
    753753    if (RefPtr<Range> nextCharacterRange = makeRange(position, next)) {
    754         LayoutRect rect = editor()->firstRectForRange(nextCharacterRange.get());
     754        LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get());
    755755        if (rect.contains(framePoint))
    756756            return nextCharacterRange.release();
  • trunk/Source/WebCore/page/Frame.h

    r148921 r150140  
    114114        FrameView* view() const;
    115115
    116         Editor* editor() const;
     116        Editor& editor() const;
    117117        EventHandler* eventHandler() const;
    118118        FrameLoader* loader() const;
     
    219219
    220220        OwnPtr<ScriptController> m_script;
    221         OwnPtr<Editor> m_editor;
     221        const OwnPtr<Editor> m_editor;
    222222        OwnPtr<FrameSelection> m_selection;
    223223        OwnPtr<EventHandler> m_eventHandler;
     
    290290    }
    291291
    292     inline Editor* Frame::editor() const
    293     {
    294         return m_editor.get();
     292    inline Editor& Frame::editor() const
     293    {
     294        return *m_editor;
    295295    }
    296296
  • trunk/Source/WebCore/page/Page.cpp

    r149839 r150140  
    566566    Frame* startFrame = frame;
    567567    do {
    568         if (frame->editor()->findString(target, (options & ~WrapAround) | StartInSelection)) {
     568        if (frame->editor().findString(target, (options & ~WrapAround) | StartInSelection)) {
    569569            if (frame != startFrame)
    570570                startFrame->selection()->clear();
     
    578578    // We cheat a bit and just research with wrap on
    579579    if (shouldWrap && !startFrame->selection()->isNone()) {
    580         bool found = startFrame->editor()->findString(target, options | WrapAround | StartInSelection);
     580        bool found = startFrame->editor().findString(target, options | WrapAround | StartInSelection);
    581581        focusController()->setFocusedFrame(frame);
    582582        return found;
     
    595595    Frame* frameWithSelection = 0;
    596596    do {
    597         frame->editor()->countMatchesForText(target, 0, options, limit ? (limit - matchRanges->size()) : 0, true, matchRanges);
     597        frame->editor().countMatchesForText(target, 0, options, limit ? (limit - matchRanges->size()) : 0, true, matchRanges);
    598598        if (frame->selection()->isRange())
    599599            frameWithSelection = frame;
     
    628628    Frame* startFrame = frame;
    629629    do {
    630         if (RefPtr<Range> resultRange = frame->editor()->rangeOfString(target, frame == startFrame ? referenceRange : 0, options & ~WrapAround))
     630        if (RefPtr<Range> resultRange = frame->editor().rangeOfString(target, frame == startFrame ? referenceRange : 0, options & ~WrapAround))
    631631            return resultRange.release();
    632632
     
    637637    // We cheat a bit and just search again with wrap on.
    638638    if (shouldWrap && referenceRange) {
    639         if (RefPtr<Range> resultRange = startFrame->editor()->rangeOfString(target, referenceRange, options | WrapAround | StartInSelection))
     639        if (RefPtr<Range> resultRange = startFrame->editor().rangeOfString(target, referenceRange, options | WrapAround | StartInSelection))
    640640            return resultRange.release();
    641641    }
     
    658658    Frame* frame = mainFrame();
    659659    do {
    660         frame->editor()->setMarkedTextMatchesAreHighlighted(shouldHighlight);
    661         matches += frame->editor()->countMatchesForText(target, 0, options, limit ? (limit - matches) : 0, true, 0);
     660        frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlight);
     661        matches += frame->editor().countMatchesForText(target, 0, options, limit ? (limit - matches) : 0, true, 0);
    662662        frame = incrementFrame(frame, true, false);
    663663    } while (frame);
     
    789789
    790790    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
    791         frame->editor()->deviceScaleFactorChanged();
     791        frame->editor().deviceScaleFactorChanged();
    792792
    793793    pageCache()->markPagesForFullStyleRecalc(this);
  • trunk/Source/WebCore/page/TouchAdjustment.cpp

    r149262 r150140  
    117117    if (node->renderer()->canBeSelectionLeaf()) {
    118118        // If the context menu gesture will trigger a selection all selectable nodes are valid targets.
    119         if (node->renderer()->frame()->editor()->behavior().shouldSelectOnContextualMenuClick())
     119        if (node->renderer()->frame()->editor().behavior().shouldSelectOnContextualMenuClick())
    120120            return true;
    121121        // Only the selected part of the renderer is a valid target, but this will be corrected in
     
    158158    RenderText* textRenderer = static_cast<RenderText*>(textNode->renderer());
    159159
    160     if (textRenderer->frame()->editor()->behavior().shouldSelectOnContextualMenuClick()) {
     160    if (textRenderer->frame()->editor().behavior().shouldSelectOnContextualMenuClick()) {
    161161        // Make subtargets out of every word.
    162162        String textValue = textNode->data();
  • trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp

    r146835 r150140  
    312312    ASSERT(range);
    313313
    314     m_dataObject->setText(frame->editor()->selectedTextForClipboard());
     314    m_dataObject->setText(frame->editor().selectedTextForClipboard());
    315315    m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange, false, ResolveNonLocalURLs));
    316316
  • trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp

    r148545 r150140  
    6666    dataObject->clearAll();
    6767
    68     dataObject->setText(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText());
     68    dataObject->setText(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText());
    6969    dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs));
    7070    helper->writeClipboardContents(clipboard, canSmartCopyOrDelete ? PasteboardHelper::IncludeSmartPaste : PasteboardHelper::DoNotIncludeSmartPaste);
  • trunk/Source/WebCore/platform/mac/DragDataMac.mm

    r113659 r150140  
    163163        // Cannot drop other schemes unless <rdar://problem/10562662> and <rdar://problem/11187315> are fixed.
    164164        if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])
    165             return [frame->editor()->client()->canonicalizeURL(URLFromPasteboard) absoluteString];
     165            return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString];
    166166    }
    167167   
     
    173173        // FIXME: Should we allow only http family schemes, or anything non-local?
    174174        if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])
    175             return [frame->editor()->client()->canonicalizeURL(URLFromPasteboard) absoluteString];
     175            return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString];
    176176    }
    177177   
     
    183183            if ([[NSFileManager defaultManager] fileExistsAtPath:files[0] isDirectory:&isDirectory] && isDirectory)
    184184                return String();
    185             return [frame->editor()->client()->canonicalizeURL([NSURL fileURLWithPath:files[0]]) absoluteString];
     185            return [frame->editor().client()->canonicalizeURL([NSURL fileURLWithPath:files[0]]) absoluteString];
    186186        }
    187187    }
  • trunk/Source/WebCore/platform/mac/PasteboardMac.mm

    r150122 r150140  
    140140String Pasteboard::getStringSelection(Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard)
    141141{
    142     String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText();
     142    String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText();
    143143    text.replace(noBreakSpace, ' ');
    144144    return text;
     
    153153    }
    154154
    155     RefPtr<Range> range = frame->editor()->selectedRange();
     155    RefPtr<Range> range = frame->editor().selectedRange();
    156156    Node* commonAncestor = range->commonAncestorContainer(IGNORE_EXCEPTION);
    157157    ASSERT(commonAncestor);
     
    181181{
    182182    NSAttributedString* attributedString = nil;
    183     RetainPtr<WebHTMLConverter> converter = adoptNS([[WebHTMLConverter alloc] initWithDOMRange:kit(frame->editor()->selectedRange().get())]);
     183    RetainPtr<WebHTMLConverter> converter = adoptNS([[WebHTMLConverter alloc] initWithDOMRange:kit(frame->editor().selectedRange().get())]);
    184184    if (converter)
    185185        attributedString = [converter.get() attributedString];
     
    189189    Vector<String> clientTypes;
    190190    Vector<RefPtr<SharedBuffer> > clientData;
    191     frame->editor()->client()->getClientPasteboardDataForRange(frame->editor()->selectedRange().get(), clientTypes, clientData);
     191    frame->editor().client()->getClientPasteboardDataForRange(frame->editor().selectedRange().get(), clientTypes, clientData);
    192192    types.appendVector(clientTypes);
    193193
    194194    platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName);
    195     frame->editor()->client()->didSetSelectionTypesForPasteboard();
     195    frame->editor().client()->didSetSelectionTypesForPasteboard();
    196196
    197197    for (size_t i = 0; i < clientTypes.size(); ++i)
     
    242242   
    243243    NSURL *cocoaURL = url;
    244     NSString *userVisibleString = frame->editor()->client()->userVisibleString(cocoaURL);
     244    NSString *userVisibleString = frame->editor().client()->userVisibleString(cocoaURL);
    245245   
    246246    NSString *title = (NSString*)titleStr;
     
    381381        // calling _web_userVisibleString from WebCore involves migrating a sizable web of
    382382        // helper code that should either be done in a separate patch or figured out in another way.
    383         string = frame->editor()->client()->userVisibleString([NSURL URLWithString:string]);
     383        string = frame->editor().client()->userVisibleString([NSURL URLWithString:string]);
    384384        if ([string length] > 0)
    385385            return [string precomposedStringWithCanonicalMapping];
     
    436436
    437437    Vector<RefPtr<ArchiveResource> > resources;
    438     RefPtr<DocumentFragment> fragment = frame->editor()->client()->documentFragmentFromAttributedString(string, resources);
     438    RefPtr<DocumentFragment> fragment = frame->editor().client()->documentFragmentFromAttributedString(string, resources);
    439439
    440440    size_t size = resources.size();
     
    514514            // Non-image file types; _web_userVisibleString is appropriate here because this will
    515515            // be pasted as visible text.
    516             NSString *url = frame->editor()->client()->userVisibleString([NSURL fileURLWithPath:paths[i]]);
     516            NSString *url = frame->editor().client()->userVisibleString([NSURL fileURLWithPath:paths[i]]);
    517517            RefPtr<Node> textNode = frame->document()->createTextNode(url);
    518518            refNodesVector.append(textNode.get());
  • trunk/Source/WebCore/platform/qt/ClipboardQt.cpp

    r148545 r150140  
    314314    if (!m_writableData)
    315315        m_writableData = new QMimeData;
    316     QString text = frame->editor()->selectedTextForClipboard();
     316    QString text = frame->editor().selectedTextForClipboard();
    317317    text.replace(QChar(0xa0), QLatin1Char(' '));
    318318    m_writableData->setText(text);
  • trunk/Source/WebCore/platform/qt/PasteboardQt.cpp

    r146835 r150140  
    6363{
    6464    QMimeData* md = new QMimeData;
    65     QString text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText();
     65    QString text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText();
    6666    text.replace(QChar(0xa0), QLatin1Char(' '));
    6767    md->setText(text);
  • trunk/Source/WebCore/platform/win/ClipboardWin.cpp

    r149280 r150140  
    752752        ::GlobalFree(medium.hGlobal);
    753753
    754     String str = frame->editor()->selectedTextForClipboard();
     754    String str = frame->editor().selectedTextForClipboard();
    755755    replaceNewlinesWithWindowsStyleNewlines(str);
    756756    replaceNBSPWithSpace(str);
     
    760760
    761761    medium.hGlobal = 0;
    762     if (frame->editor()->canSmartCopyOrDelete())
     762    if (frame->editor().canSmartCopyOrDelete())
    763763        m_writableDataObject->SetData(smartPasteFormat(), &medium, TRUE);
    764764}
  • trunk/Source/WebCore/platform/win/PasteboardWin.cpp

    r148549 r150140  
    131131   
    132132    // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well
    133     String str = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText();
     133    String str = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText();
    134134    replaceNewlinesWithWindowsStyleNewlines(str);
    135135    replaceNBSPWithSpace(str);
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r148545 r150140  
    641641        return Vector<String>();
    642642
    643     return frame->editor()->dictationAlternativesForMarker(marker);
     643    return frame->editor().dictationAlternativesForMarker(marker);
    644644}
    645645
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r150065 r150140  
    549549
    550550    // Determine whether or not we have composition underlines to draw.
    551     bool containsComposition = renderer()->node() && renderer()->frame()->editor()->compositionNode() == renderer()->node();
    552     bool useCustomUnderlines = containsComposition && renderer()->frame()->editor()->compositionUsesCustomUnderlines();
     551    bool containsComposition = renderer()->node() && renderer()->frame()->editor().compositionNode() == renderer()->node();
     552    bool useCustomUnderlines = containsComposition && renderer()->frame()->editor().compositionUsesCustomUnderlines();
    553553
    554554    // Determine the text colors and selection colors.
     
    658658        if (containsComposition && !useCustomUnderlines)
    659659            paintCompositionBackground(context, boxOrigin, styleToUse, font,
    660                 renderer()->frame()->editor()->compositionStart(),
    661                 renderer()->frame()->editor()->compositionEnd());
     660                renderer()->frame()->editor().compositionStart(),
     661                renderer()->frame()->editor().compositionEnd());
    662662
    663663        paintDocumentMarkers(context, boxOrigin, styleToUse, font, true);
     
    786786
    787787        if (useCustomUnderlines) {
    788             const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor()->customCompositionUnderlines();
     788            const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor().customCompositionUnderlines();
    789789            size_t numUnderlines = underlines.size();
    790790
     
    13601360   
    13611361    // Optionally highlight the text
    1362     if (renderer()->frame()->editor()->markedTextMatchesAreHighlighted()) {
     1362    if (renderer()->frame()->editor().markedTextMatchesAreHighlighted()) {
    13631363        Color color = marker->activeMatch() ?
    13641364            renderer()->theme()->platformActiveTextSearchHighlightColor() :
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r150084 r150140  
    52875287    }
    52885288
    5289     bool moveCaretToBoundary = document()->frame()->editor()->behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom();
     5289    bool moveCaretToBoundary = document()->frame()->editor().behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom();
    52905290
    52915291    if (!moveCaretToBoundary && !closestBox && lastRootBoxWithChildren) {
  • trunk/Source/WebCore/testing/Internals.cpp

    r150041 r150140  
    237237static SpellChecker* spellchecker(Document* document)
    238238{
    239     if (!document || !document->frame() || !document->frame()->editor())
    240         return 0;
    241 
    242     return document->frame()->editor()->spellChecker();
     239    if (!document || !document->frame())
     240        return 0;
     241
     242    return document->frame()->editor().spellChecker();
    243243}
    244244
     
    285285    page->group().captionPreferences()->setTestingMode(false);
    286286#endif
    287     if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled())
    288         page->mainFrame()->editor()->toggleContinuousSpellChecking();
    289     if (page->mainFrame()->editor()->isOverwriteModeEnabled())
    290         page->mainFrame()->editor()->toggleOverwriteModeEnabled();
     287    if (!page->mainFrame()->editor().isContinuousSpellCheckingEnabled())
     288        page->mainFrame()->editor().toggleContinuousSpellChecking();
     289    if (page->mainFrame()->editor().isOverwriteModeEnabled())
     290        page->mainFrame()->editor().toggleOverwriteModeEnabled();
    291291}
    292292
     
    14271427        return 0;
    14281428
    1429     return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
     1429    return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
    14301430}
    14311431   
     
    14351435        return 0;
    14361436   
    1437     return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Autocorrected, from, length);
     1437    return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Autocorrected, from, length);
    14381438}
    14391439
     
    14431443        return;
    14441444
    1445     if (enabled != contextDocument()->frame()->editor()->isContinuousSpellCheckingEnabled())
    1446         contextDocument()->frame()->editor()->toggleContinuousSpellChecking();
     1445    if (enabled != contextDocument()->frame()->editor().isContinuousSpellCheckingEnabled())
     1446        contextDocument()->frame()->editor().toggleContinuousSpellChecking();
    14471447}
    14481448
     
    14531453
    14541454#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    1455     if (enabled != contextDocument()->frame()->editor()->isAutomaticQuoteSubstitutionEnabled())
    1456         contextDocument()->frame()->editor()->toggleAutomaticQuoteSubstitution();
     1455    if (enabled != contextDocument()->frame()->editor().isAutomaticQuoteSubstitutionEnabled())
     1456        contextDocument()->frame()->editor().toggleAutomaticQuoteSubstitution();
    14571457#else
    14581458    UNUSED_PARAM(enabled);
     
    14661466
    14671467#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    1468     if (enabled != contextDocument()->frame()->editor()->isAutomaticLinkDetectionEnabled())
    1469         contextDocument()->frame()->editor()->toggleAutomaticLinkDetection();
     1468    if (enabled != contextDocument()->frame()->editor().isAutomaticLinkDetectionEnabled())
     1469        contextDocument()->frame()->editor().toggleAutomaticLinkDetection();
    14701470#else
    14711471    UNUSED_PARAM(enabled);
     
    14791479
    14801480#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    1481     if (enabled != contextDocument()->frame()->editor()->isAutomaticDashSubstitutionEnabled())
    1482         contextDocument()->frame()->editor()->toggleAutomaticDashSubstitution();
     1481    if (enabled != contextDocument()->frame()->editor().isAutomaticDashSubstitutionEnabled())
     1482        contextDocument()->frame()->editor().toggleAutomaticDashSubstitution();
    14831483#else
    14841484    UNUSED_PARAM(enabled);
     
    14921492
    14931493#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    1494     if (enabled != contextDocument()->frame()->editor()->isAutomaticTextReplacementEnabled())
    1495         contextDocument()->frame()->editor()->toggleAutomaticTextReplacement();
     1494    if (enabled != contextDocument()->frame()->editor().isAutomaticTextReplacementEnabled())
     1495        contextDocument()->frame()->editor().toggleAutomaticTextReplacement();
    14961496#else
    14971497    UNUSED_PARAM(enabled);
     
    15051505
    15061506#if USE(AUTOMATIC_TEXT_REPLACEMENT)
    1507     if (enabled != contextDocument()->frame()->editor()->isAutomaticSpellingCorrectionEnabled())
    1508         contextDocument()->frame()->editor()->toggleAutomaticSpellingCorrection();
     1507    if (enabled != contextDocument()->frame()->editor().isAutomaticSpellingCorrectionEnabled())
     1508        contextDocument()->frame()->editor().toggleAutomaticSpellingCorrection();
    15091509#else
    15101510    UNUSED_PARAM(enabled);
     
    15171517        return 0;
    15181518
    1519     return document->frame()->editor()->isOverwriteModeEnabled();
     1519    return document->frame()->editor().isOverwriteModeEnabled();
    15201520}
    15211521
     
    15251525        return;
    15261526
    1527     document->frame()->editor()->toggleOverwriteModeEnabled();
     1527    document->frame()->editor().toggleOverwriteModeEnabled();
    15281528}
    15291529
     
    16201620        return 0;
    16211621
    1622     return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);
     1622    return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);
    16231623}
    16241624
  • trunk/Source/WebKit/blackberry/ChangeLog

    r150104 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/EditorClientBlackBerry.cpp:
     9        (WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField):
     10        (WebCore::EditorClientBlackBerry::handleKeyboardEvent):
     11        * WebKitSupport/DOMSupport.cpp:
     12        (BlackBerry::WebKit::DOMSupport::elementHasContinuousSpellCheckingEnabled):
     13        * WebKitSupport/InPageSearchManager.cpp:
     14        (BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
     15        (BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
     16        * WebKitSupport/SelectionHandler.cpp:
     17        (BlackBerry::WebKit::SelectionHandler::selectedText):
     18
    1192013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp

    r148736 r150140  
    116116
    117117    // Check if the node disables spell checking directly.
    118     return frame->editor()->isSpellCheckingEnabledInFocusedNode();
     118    return frame->editor().isSpellCheckingEnabledInFocusedNode();
    119119}
    120120
     
    470470
    471471    // Check to see we are not trying to insert text on key down.
    472     ASSERT(!(event->type() == eventNames().keydownEvent && frame->editor()->command(commandName).isTextInsertion()));
     472    ASSERT(!(event->type() == eventNames().keydownEvent && frame->editor().command(commandName).isTextInsertion()));
    473473
    474474    if (!commandName.isEmpty()) {
     
    477477            m_webPagePrivate->m_inputHandler->setProcessingChange(false);
    478478
    479         if (frame->editor()->command(commandName).execute())
     479        if (frame->editor().command(commandName).execute())
    480480            event->setDefaultHandled();
    481481        return;
    482482    }
    483483
    484     if (!frame->editor()->canEdit())
     484    if (!frame->editor().canEdit())
    485485        return;
    486486
     
    502502
    503503    if (!platformEvent->text().isEmpty()) {
    504         if (frame->editor()->insertText(platformEvent->text(), event))
     504        if (frame->editor().insertText(platformEvent->text(), event))
    505505            event->setDefaultHandled();
    506506    }
  • trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp

    r149811 r150140  
    267267bool elementHasContinuousSpellCheckingEnabled(const PassRefPtr<WebCore::Element> element)
    268268{
    269     return element && element->document()->frame() && element->document()->frame()->editor()->isContinuousSpellCheckingEnabled();
     269    return element && element->document()->frame() && element->document()->frame()->editor().isContinuousSpellCheckingEnabled();
    270270}
    271271
  • trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp

    r148762 r150140  
    181181bool InPageSearchManager::findAndMarkText(const String& text, Range* range, Frame* frame, const FindOptions& options, bool isNewSearch, bool startFromSelection)
    182182{
    183     if (RefPtr<Range> match = frame->editor()->findStringAndScrollToVisible(text, range, options)) {
     183    if (RefPtr<Range> match = frame->editor().findStringAndScrollToVisible(text, range, options)) {
    184184        // Move the highlight to the new match.
    185185        setActiveMatchAndMarker(match);
     
    191191                // No need to unmarkAllTextMatches, it is already done from the caller because of newSearch
    192192                m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true);
    193                 frame->editor()->setMarkedTextMatchesAreHighlighted(true /* highlight */);
     193                frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
    194194            }
    195195            return true;
     
    224224            m_webPage->m_page->unmarkAllTextMatches();
    225225            m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true);
    226             frame->editor()->setMarkedTextMatchesAreHighlighted(true /* highlight */);
     226            frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
    227227        }
    228228
     
    357357        } else {
    358358            if (m_highlightAllMatches)
    359                 scopingFrame->editor()->setMarkedTextMatchesAreHighlighted(true /* highlight */);
     359                scopingFrame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
    360360            m_activeMatchCount += matchCount;
    361361            m_webPage->m_client->updateFindStringResult(m_activeMatchCount, m_activeMatchIndex);
  • trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp

    r149826 r150140  
    106106BlackBerry::Platform::String SelectionHandler::selectedText() const
    107107{
    108     return m_webPage->focusedOrMainFrame()->editor()->selectedText();
     108    return m_webPage->focusedOrMainFrame()->editor().selectedText();
    109109}
    110110
  • trunk/Source/WebKit/efl/ChangeLog

    r150041 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
     9        (DumpRenderTreeSupportEfl::executeCoreCommandByName):
     10        (DumpRenderTreeSupportEfl::isCommandEnabled):
     11        * WebCoreSupport/EditorClientEfl.cpp:
     12        (WebCore::EditorClientEfl::respondToChangedSelection):
     13        (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
     14        * ewk/ewk_frame.cpp:
     15        (ewk_frame_editable_set):
     16        (ewk_frame_selection_get):
     17        (ewk_frame_text_search):
     18        (ewk_frame_text_matches_mark):
     19        (ewk_frame_text_matches_highlight_set):
     20        (ewk_frame_text_matches_highlight_get):
     21        * ewk/ewk_view.cpp:
     22        (ewk_view_selection_get):
     23        (ewk_view_editor_command_execute):
     24
    1252013-05-12  Timothy Hatcher  <timothy@apple.com>
    226
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp

    r149980 r150140  
    292292    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
    293293
    294     page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
     294    page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
    295295}
    296296
     
    329329    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
    330330
    331     return page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
     331    return page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
    332332}
    333333
     
    551551        return;
    552552
    553     WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
    554     if (!editor || (!editor->canEdit() && !editor->hasComposition()))
     553    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
     554    if (!editor.canEdit() && !editor.hasComposition())
    555555        return;
    556556
     
    558558    Vector<WebCore::CompositionUnderline> underlines;
    559559    underlines.append(WebCore::CompositionUnderline(0, compositionString.length(), WebCore::Color(0, 0, 0), false));
    560     editor->setComposition(compositionString, underlines, start, start + length);
     560    editor.setComposition(compositionString, underlines, start, start + length);
    561561}
    562562
     
    568568        return false;
    569569
    570     const WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
    571     if (!editor)
    572         return false;
    573 
    574     return editor->hasComposition();
     570    return page->focusController()->focusedOrMainFrame()->editor().hasComposition();
    575571}
    576572
     
    584580        return false;
    585581
    586     WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
    587     if (!editor || !editor->hasComposition())
     582    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
     583    if (!editor.hasComposition())
    588584        return false;
    589585
    590     *start = editor->compositionStart();
    591     *length = editor->compositionEnd() - *start;
     586    *start = editor.compositionStart();
     587    *length = editor.compositionEnd() - *start;
    592588    return true;
    593589}
     
    600596        return;
    601597
    602     WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
    603     if (!editor)
    604         return;
    605 
    606     if (!editor->hasComposition()) {
    607         editor->insertText(String::fromUTF8(text), 0);
     598    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
     599
     600    if (!editor.hasComposition()) {
     601        editor.insertText(String::fromUTF8(text), 0);
    608602        return;
    609603    }
    610604
    611605    if (text) {
    612         editor->confirmComposition(String::fromUTF8(text));
     606        editor.confirmComposition(String::fromUTF8(text));
    613607        return;
    614608    }
    615     editor->confirmComposition();
     609    editor.confirmComposition();
    616610}
    617611
     
    620614    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, WebCore::IntRect());
    621615
    622     if (!page->focusController() || !page->focusController()->focusedOrMainFrame() || !page->focusController()->focusedOrMainFrame()->editor())
     616    if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
    623617        return WebCore::IntRect();
    624618
     
    627621
    628622    WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
    629     WebCore::Editor* editor = frame->editor();
    630623
    631624    RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
     
    633626        return WebCore::IntRect();
    634627
    635     return editor->firstRectForRange(range.get());
     628    return frame->editor().firstRectForRange(range.get());
    636629}
    637630
  • trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp

    r148381 r150140  
    143143        return;
    144144
    145     if (coreFrame->editor() && coreFrame->editor()->ignoreCompositionSelectionChange())
     145    if (coreFrame->editor().ignoreCompositionSelectionChange())
    146146        return;
    147147
     
    149149    ewk_frame_editor_client_selection_changed(webFrame);
    150150
    151     coreFrame->editor()->cancelCompositionIfSelectionIsInvalid();
     151    coreFrame->editor().cancelCompositionIfSelectionIsInvalid();
    152152}
    153153
     
    325325    }
    326326
    327     Editor::Command command = frame->editor()->command(interpretKeyEvent(event));
     327    Editor::Command command = frame->editor().command(interpretKeyEvent(event));
    328328
    329329    if (keyEvent->type() == PlatformEvent::RawKeyDown) {
     
    338338
    339339    // Don't allow text insertion for nodes that cannot edit.
    340     if (!frame->editor()->canEdit())
     340    if (!frame->editor().canEdit())
    341341        return false;
    342342
     
    349349        return false;
    350350
    351     return frame->editor()->insertText(event->keyEvent()->text(), event);
     351    return frame->editor().insertText(event->keyEvent()->text(), event);
    352352}
    353353
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r148557 r150140  
    481481    smartData->editable = editable;
    482482    if (editable)
    483         smartData->frame->editor()->applyEditingStyleToBodyElement();
     483        smartData->frame->editor().applyEditingStyleToBodyElement();
    484484    return true;
    485485}
     
    489489    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0);
    490490    EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, 0);
    491     WTF::CString selectedText = smartData->frame->editor()->selectedText().utf8();
     491    WTF::CString selectedText = smartData->frame->editor().selectedText().utf8();
    492492    if (selectedText.isNull())
    493493        return 0;
     
    501501    EINA_SAFETY_ON_NULL_RETURN_VAL(text, false);
    502502
    503     return smartData->frame->editor()->findString(WTF::String::fromUTF8(text), forward, caseSensitive, wrap, true);
     503    return smartData->frame->editor().findString(WTF::String::fromUTF8(text), forward, caseSensitive, wrap, true);
    504504}
    505505
     
    510510    EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0);
    511511
    512     smartData->frame->editor()->setMarkedTextMatchesAreHighlighted(highlight);
    513     return smartData->frame->editor()->countMatchesForText(WTF::String::fromUTF8(string), 0, caseSensitive, limit, true, 0);
     512    smartData->frame->editor().setMarkedTextMatchesAreHighlighted(highlight);
     513    return smartData->frame->editor().countMatchesForText(WTF::String::fromUTF8(string), 0, caseSensitive, limit, true, 0);
    514514}
    515515
     
    527527    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false);
    528528    EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
    529     smartData->frame->editor()->setMarkedTextMatchesAreHighlighted(highlight);
     529    smartData->frame->editor().setMarkedTextMatchesAreHighlighted(highlight);
    530530    return true;
    531531}
     
    535535    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false);
    536536    EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
    537     return smartData->frame->editor()->markedTextMatchesAreHighlighted();
     537    return smartData->frame->editor().markedTextMatchesAreHighlighted();
    538538}
    539539
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r149980 r150140  
    16691669    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
    16701670    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
    1671     CString selectedString = priv->page->focusController()->focusedOrMainFrame()->editor()->selectedText().utf8();
     1671    CString selectedString = priv->page->focusController()->focusedOrMainFrame()->editor().selectedText().utf8();
    16721672    if (selectedString.isNull())
    16731673        return 0;
     
    16841684        return false;
    16851685
    1686     return priv->page->focusController()->focusedOrMainFrame()->editor()->command(commandString).execute(WTF::String::fromUTF8(value));
     1686    return priv->page->focusController()->focusedOrMainFrame()->editor().command(commandString).execute(WTF::String::fromUTF8(value));
    16871687}
    16881688
     
    41034103        return;
    41044104
    4105     WebCore::Editor* editor = focusedFrame->editor();
    4106     if (!editor->canEdit())
     4105    WebCore::Editor& editor = focusedFrame->editor();
     4106    if (!editor.canEdit())
    41074107        return;
    41084108
    4109     editor->setBaseWritingDirection(static_cast<WritingDirection>(direction));
     4109    editor.setBaseWritingDirection(static_cast<WritingDirection>(direction));
    41104110}
    41114111
  • trunk/Source/WebKit/gtk/ChangeLog

    r150074 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp:
     9        (WebKit::ChromeClient::paint):
     10        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     11        (DumpRenderTreeSupportGtk::executeCoreCommandByName):
     12        (DumpRenderTreeSupportGtk::isCommandEnabled):
     13        * WebCoreSupport/EditorClientGtk.cpp:
     14        (WebKit::EditorClient::respondToChangedSelection):
     15        (WebKit::EditorClient::executePendingEditorCommands):
     16        (WebKit::EditorClient::handleKeyboardEvent):
     17        * WebCoreSupport/WebViewInputMethodFilter.cpp:
     18        (WebKit::WebViewInputMethodFilter::canEdit):
     19        (WebKit::WebViewInputMethodFilter::confirmCompositionText):
     20        (WebKit::WebViewInputMethodFilter::confirmCurrentComposition):
     21        (WebKit::WebViewInputMethodFilter::cancelCurrentComposition):
     22        (WebKit::WebViewInputMethodFilter::setPreedit):
     23        * webkit/webkitwebframe.cpp:
     24        (webkit_web_frame_replace_selection):
     25        * webkit/webkitwebview.cpp:
     26        (getLocationForKeyboardGeneratedContextMenu):
     27        (webkit_web_view_focus_in_event):
     28        (webkit_web_view_real_select_all):
     29        (webkit_web_view_real_cut_clipboard):
     30        (webkit_web_view_real_copy_clipboard):
     31        (webkit_web_view_real_undo):
     32        (webkit_web_view_real_redo):
     33        (webkit_web_view_real_paste_clipboard):
     34        (webkit_web_view_set_highlight_text_matches):
     35        (webkit_web_view_can_cut_clipboard):
     36        (webkit_web_view_can_copy_clipboard):
     37        (webkit_web_view_can_paste_clipboard):
     38        (webkit_web_view_delete_selection):
     39        (webkit_web_view_set_editable):
     40        (webkit_web_view_can_undo):
     41        (webkit_web_view_can_redo):
     42
    1432013-05-14  Zan Dobersek  <zdobersek@igalia.com>
    244
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r149952 r150140  
    600600    // the selection changing.
    601601    Frame* focusedFrame = core(m_webView)->focusController()->focusedOrMainFrame();
    602     if (focusedFrame && focusedFrame->editor()->canEdit())
     602    if (focusedFrame && focusedFrame->editor().canEdit())
    603603        m_webView->priv->imFilter.setCursorRect(frame->selection()->absoluteCaretBounds());
    604604}
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r148696 r150140  
    277277    g_return_if_fail(value);
    278278
    279     core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
     279    core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
    280280}
    281281
     
    285285    g_return_val_if_fail(name, FALSE);
    286286
    287     return core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
     287    return core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
    288288}
    289289
     
    297297        return;
    298298
    299     Editor* editor = frame->editor();
    300     if (!editor || (!editor->canEdit() && !editor->hasComposition()))
     299    Editor& editor = frame->editor();
     300    if (!editor.canEdit() && !editor.hasComposition())
    301301        return;
    302302
     
    304304    Vector<CompositionUnderline> underlines;
    305305    underlines.append(CompositionUnderline(0, compositionString.length(), Color(0, 0, 0), false));
    306     editor->setComposition(compositionString, underlines, start, start + length);
     306    editor.setComposition(compositionString, underlines, start, start + length);
    307307}
    308308
     
    313313    if (!frame)
    314314        return false;
    315     Editor* editor = frame->editor();
    316     if (!editor)
    317         return false;
    318 
    319     return editor->hasComposition();
     315
     316    return frame->editor().hasComposition();
    320317}
    321318
     
    330327        return false;
    331328
    332     Editor* editor = frame->editor();
    333     if (!editor || !editor->hasComposition())
     329    Editor& editor = frame->editor();
     330    if (!editor.hasComposition())
    334331        return false;
    335332
    336     *start = editor->compositionStart();
    337     *length = editor->compositionEnd() - *start;
     333    *start = editor.compositionStart();
     334    *length = editor.compositionEnd() - *start;
    338335    return true;
    339336}
     
    347344        return;
    348345
    349     Editor* editor = frame->editor();
    350     if (!editor)
    351         return;
    352 
    353     if (!editor->hasComposition()) {
    354         editor->insertText(String::fromUTF8(text), 0);
     346    Editor& editor = frame->editor();
     347
     348    if (!editor.hasComposition()) {
     349        editor.insertText(String::fromUTF8(text), 0);
    355350        return;
    356351    }
    357352    if (text) {
    358         editor->confirmComposition(String::fromUTF8(text));
     353        editor.confirmComposition(String::fromUTF8(text));
    359354        return;
    360355    }
    361     editor->confirmComposition();
     356    editor.confirmComposition();
    362357}
    363358
     
    369364        return;
    370365
    371     Editor* editor = frame->editor();
    372     if (!editor)
    373         return;
     366    Editor& editor = frame->editor();
    374367
    375368    String commandString(command);
     
    384377    commandString.insert(firstChar, 0);
    385378
    386     editor->command(commandString).execute();
     379    editor.command(commandString).execute();
    387380}
    388381
     
    399392        return false;
    400393
    401     Editor* editor = frame->editor();
    402     if (!editor)
    403         return false;
     394    Editor& editor = frame->editor();
    404395
    405396    RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
     
    407398        return false;
    408399
    409     *rect = editor->firstRectForRange(range.get());
     400    *rect = editor.firstRectForRange(range.get());
    410401    return true;
    411402}
  • trunk/Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp

    r148396 r150140  
    256256#endif
    257257
    258     if (frame->editor()->cancelCompositionIfSelectionIsInvalid())
     258    if (frame->editor().cancelCompositionIfSelectionIsInvalid())
    259259        m_webView->priv->imFilter.resetContext();
    260260}
     
    395395    Vector<Editor::Command> commands;
    396396    for (size_t i = 0; i < m_pendingEditorCommands.size(); i++) {
    397         Editor::Command command = frame->editor()->command(m_pendingEditorCommands.at(i).utf8().data());
     397        Editor::Command command = frame->editor().command(m_pendingEditorCommands.at(i).utf8().data());
    398398        if (command.isTextInsertion() && !allowTextInsertion)
    399399            return false;
     
    456456
    457457        // Only allow text insertion commands if the current node is editable.
    458         if (executePendingEditorCommands(frame, frame->editor()->canEdit())) {
     458        if (executePendingEditorCommands(frame, frame->editor().canEdit())) {
    459459            event->setDefaultHandled();
    460460            return;
     
    464464
    465465    // Don't allow text insertion for nodes that cannot edit.
    466     if (!frame->editor()->canEdit())
     466    if (!frame->editor().canEdit())
    467467        return;
    468468
     
    481481        return;
    482482
    483     if (frame->editor()->insertText(platformEvent->text(), event))
     483    if (frame->editor().insertText(platformEvent->text(), event))
    484484        event->setDefaultHandled();
    485485}
  • trunk/Source/WebKit/gtk/WebCoreSupport/WebViewInputMethodFilter.cpp

    r148558 r150140  
    5252{
    5353    Frame* frame = focusedOrMainFrame();
    54     return frame && frame->editor()->canEdit();
     54    return frame && frame->editor().canEdit();
    5555}
    5656
     
    7777{
    7878    Frame* frame = focusedOrMainFrame();
    79     if (!frame || !frame->editor()->canEdit())
     79    if (!frame || !frame->editor().canEdit())
    8080        return;
    8181
     
    8484        return;
    8585    }
    86     frame->editor()->confirmComposition(m_confirmedComposition);
     86    frame->editor().confirmComposition(m_confirmedComposition);
    8787}
    8888
     
    9090{
    9191    Frame* frame = focusedOrMainFrame();
    92     if (!frame || !frame->editor()->canEdit())
     92    if (!frame || !frame->editor().canEdit())
    9393        return;
    94     frame->editor()->confirmComposition();
     94    frame->editor().confirmComposition();
    9595}
    9696
     
    9898{
    9999    Frame* frame = focusedOrMainFrame();
    100     if (!frame || !frame->editor()->canEdit())
     100    if (!frame || !frame->editor().canEdit())
    101101        return;
    102     frame->editor()->cancelComposition();
     102    frame->editor().cancelComposition();
    103103}
    104104
     
    106106{
    107107    Frame* frame = focusedOrMainFrame();
    108     if (!frame || !frame->editor()->canEdit())
     108    if (!frame || !frame->editor().canEdit())
    109109        return;
    110110
     
    112112    Vector<CompositionUnderline> underlines;
    113113    underlines.append(CompositionUnderline(0, newPreedit.length(), Color(1, 1, 1), false));
    114     frame->editor()->setComposition(newPreedit, underlines, m_cursorOffset, m_cursorOffset);
     114    frame->editor().setComposition(newPreedit, underlines, m_cursorOffset, m_cursorOffset);
    115115}
    116116
  • trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp

    r148552 r150140  
    11351135    bool selectReplacement = false;
    11361136    bool smartReplace = true;
    1137     coreFrame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
     1137    coreFrame->editor().replaceSelectionWithText(text, selectReplacement, smartReplace);
    11381138}
    11391139
  • trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp

    r149952 r150140  
    443443    // selection->selection().isNonOrphanedCaretOrRange() would have returned false
    444444    // above, so we do not have to check it.
    445     IntRect firstRect = frame->editor()->firstRectForRange(selection->selection().firstRange().get());
     445    IntRect firstRect = frame->editor().firstRectForRange(selection->selection().firstRange().get());
    446446    return IntPoint(firstRect.x(), firstRect.maxY());
    447447}
     
    939939        focusController->setFocusedFrame(core(webView)->mainFrame());
    940940
    941     if (focusController->focusedFrame()->editor()->canEdit())
     941    if (focusController->focusedFrame()->editor().canEdit())
    942942        webView->priv->imFilter.notifyFocusedIn();
    943943    return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
     
    11821182{
    11831183    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1184     frame->editor()->command("SelectAll").execute();
     1184    frame->editor().command("SelectAll").execute();
    11851185}
    11861186
     
    11881188{
    11891189    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1190     frame->editor()->command("Cut").execute();
     1190    frame->editor().command("Cut").execute();
    11911191}
    11921192
     
    11941194{
    11951195    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1196     frame->editor()->command("Copy").execute();
     1196    frame->editor().command("Copy").execute();
    11971197}
    11981198
     
    12001200{
    12011201    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1202     frame->editor()->command("Undo").execute();
     1202    frame->editor().command("Undo").execute();
    12031203}
    12041204
     
    12061206{
    12071207    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1208     frame->editor()->command("Redo").execute();
     1208    frame->editor().command("Redo").execute();
    12091209}
    12101210
     
    12651265{
    12661266    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    1267     frame->editor()->command("Paste").execute();
     1267    frame->editor().command("Paste").execute();
    12681268}
    12691269
     
    43904390    Frame *frame = core(webView)->mainFrame();
    43914391    do {
    4392         frame->editor()->setMarkedTextMatchesAreHighlighted(shouldHighlight);
     4392        frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlight);
    43934393        frame = frame->tree()->traverseNextWithWrap(false);
    43944394    } while (frame);
     
    44604460
    44614461    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    4462     return frame->editor()->canCut() || frame->editor()->canDHTMLCut();
     4462    return frame->editor().canCut() || frame->editor().canDHTMLCut();
    44634463}
    44644464
     
    44764476
    44774477    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    4478     return frame->editor()->canCopy() || frame->editor()->canDHTMLCopy();
     4478    return frame->editor().canCopy() || frame->editor().canDHTMLCopy();
    44794479}
    44804480
     
    44924492
    44934493    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    4494     return frame->editor()->canPaste() || frame->editor()->canDHTMLPaste();
     4494    return frame->editor().canPaste() || frame->editor().canDHTMLPaste();
    44954495}
    44964496
     
    45484548
    45494549    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    4550     frame->editor()->performDelete();
     4550    frame->editor().performDelete();
    45514551}
    45524552
     
    46304630
    46314631    if (flag) {
    4632         frame->editor()->applyEditingStyleToBodyElement();
     4632        frame->editor().applyEditingStyleToBodyElement();
    46334633        // TODO: If the WebKitWebView is made editable and the selection is empty, set it to something.
    46344634        //if (!webkit_web_view_get_selected_dom_range(webView))
     
    50915091
    50925092    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    5093     return frame->editor()->canUndo();
     5093    return frame->editor().canUndo();
    50945094}
    50955095
     
    51265126
    51275127    Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
    5128     return frame->editor()->canRedo();
     5128    return frame->editor().canRedo();
    51295129}
    51305130
  • trunk/Source/WebKit/mac/ChangeLog

    r150129 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebView/WebFrame.mm:
     9        (-[WebFrame _selectedString]):
     10        (-[WebFrame _firstRectForDOMRange:]):
     11        (-[WebFrame _markDOMRange]):
     12        (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
     13        (-[WebFrame _setTypingStyle:withUndoAction:]):
     14        (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
     15        * WebView/WebHTMLRepresentation.mm:
     16        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
     17        * WebView/WebHTMLView.mm:
     18        (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]):
     19        (-[WebHTMLView _shouldDeleteRange:]):
     20        (-[WebHTMLView _canEdit]):
     21        (-[WebHTMLView _canEditRichly]):
     22        (-[WebHTMLView _insertOrderedList]):
     23        (-[WebHTMLView _insertUnorderedList]):
     24        (-[WebHTMLView _canIncreaseSelectionListLevel]):
     25        (-[WebHTMLView _canDecreaseSelectionListLevel]):
     26        (-[WebHTMLView _increaseSelectionListLevel]):
     27        (-[WebHTMLView _increaseSelectionListLevelOrdered]):
     28        (-[WebHTMLView _increaseSelectionListLevelUnordered]):
     29        (-[WebHTMLView _decreaseSelectionListLevel]):
     30        (-[WebHTMLView Editor::coreCommandBySelector:]):
     31        (-[WebHTMLView Editor::coreCommandByName:]):
     32        (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
     33        (-[WebHTMLView becomeFirstResponder]):
     34        (-[WebHTMLView _selectionStartFontAttributesAsRTF]):
     35        (-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
     36        (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
     37        (-[WebHTMLView checkSpelling:]):
     38        (-[WebHTMLView showGuessPanel:]):
     39        (-[WebHTMLView toggleBaseWritingDirection:]):
     40        (-[WebHTMLView changeBaseWritingDirection:]):
     41        (-[WebHTMLView _changeBaseWritingDirectionTo:]):
     42        (-[WebHTMLView _updateFontPanel]):
     43        (-[WebHTMLView markedRange]):
     44        (-[WebHTMLView hasMarkedText]):
     45        (-[WebHTMLView unmarkText]):
     46        (-[WebHTMLView setMarkedText:selectedRange:]):
     47        (-[WebHTMLView doCommandBySelector:]):
     48        (-[WebHTMLView insertText:]):
     49        (-[WebHTMLView _updateSelectionForInputManager]):
     50        (-[WebHTMLView countMatchesForText:inDOMRange:options:limit:markMatches:]):
     51        (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]):
     52        (-[WebHTMLView markedTextMatchesAreHighlighted]):
     53        (-[WebHTMLView _findString:options:]):
     54        * WebView/WebView.mm:
     55        (-[WebView _executeCoreCommandByName:value:]):
     56        (-[WebView editableDOMRangeForPoint:]):
     57        (-[WebView setEditable:]):
     58        (-[WebView deleteSelection]):
     59        (-[WebView applyStyle:]):
     60        (-[WebView typingAttributes]):
     61        (-[WebView _simplifyMarkup:endNode:]):
     62        (-[WebView handleAcceptedAlternativeText:]):
     63
    1642013-05-15  Darin Adler  <darin@apple.com>
    265
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r149998 r150140  
    494494- (NSString *)_selectedString
    495495{
    496     return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->editor()->selectedText());
     496    return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->editor().selectedText());
    497497}
    498498
     
    603603- (NSRect)_firstRectForDOMRange:(DOMRange *)range
    604604{
    605    return _private->coreFrame->editor()->firstRectForRange(core(range));
     605   return _private->coreFrame->editor().firstRectForRange(core(range));
    606606}
    607607
     
    677677- (DOMRange *)_markDOMRange
    678678{
    679     return kit(_private->coreFrame->editor()->mark().toNormalizedRange().get());
     679    return kit(_private->coreFrame->editor().mark().toNormalizedRange().get());
    680680}
    681681
     
    747747        return;
    748748
    749     _private->coreFrame->editor()->insertParagraphSeparatorInQuotedContent();
     749    _private->coreFrame->editor().insertParagraphSeparatorInQuotedContent();
    750750}
    751751
     
    776776        return;
    777777    // FIXME: We shouldn't have to create a copy here.
    778     _private->coreFrame->editor()->computeAndSetTypingStyle(core(style)->copyProperties().get(), undoAction);
     778    _private->coreFrame->editor().computeAndSetTypingStyle(core(style)->copyProperties().get(), undoAction);
    779779}
    780780
     
    929929    if (_private->coreFrame->selection()->isNone() || !fragment)
    930930        return;
    931     _private->coreFrame->editor()->replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle);
     931    _private->coreFrame->editor().replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle);
    932932}
    933933
  • trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm

    r149454 r150140  
    221221    WebView *webView = [webFrame webView];
    222222    if ([webView mainFrame] == webFrame && [webView isEditable])
    223         core(webFrame)->editor()->applyEditingStyleToBodyElement();
     223        core(webFrame)->editor().applyEditingStyleToBodyElement();
    224224}
    225225
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r149207 r150140  
    865865    DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText];
    866866    if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted])
    867         coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
     867        coreFrame->editor().pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
    868868#else
    869869    // Mail is ignoring the frament passed to the delegate and creates a new one.
     
    873873            DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText];
    874874            if (fragment)
    875                 coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
     875                coreFrame->editor().pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
    876876        }       
    877877    } else {
    878878        DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText];
    879879        if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted])
    880             coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
     880            coreFrame->editor().pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
    881881    }
    882882#endif
     
    984984{
    985985    Frame* coreFrame = core([self _frame]);
    986     return coreFrame && coreFrame->editor()->shouldDeleteRange(core(range));
     986    return coreFrame && coreFrame->editor().shouldDeleteRange(core(range));
    987987}
    988988
     
    17591759{
    17601760    Frame* coreFrame = core([self _frame]);
    1761     return coreFrame && coreFrame->editor()->canEdit();
     1761    return coreFrame && coreFrame->editor().canEdit();
    17621762}
    17631763
     
    17651765{
    17661766    Frame* coreFrame = core([self _frame]);
    1767     return coreFrame && coreFrame->editor()->canEditRichly();
     1767    return coreFrame && coreFrame->editor().canEditRichly();
    17681768}
    17691769
     
    18251825{
    18261826    Frame* coreFrame = core([self _frame]);
    1827     return coreFrame ? kit(coreFrame->editor()->insertOrderedList().get()) : nil;
     1827    return coreFrame ? kit(coreFrame->editor().insertOrderedList().get()) : nil;
    18281828}
    18291829
     
    18311831{
    18321832    Frame* coreFrame = core([self _frame]);
    1833     return coreFrame ? kit(coreFrame->editor()->insertUnorderedList().get()) : nil;
     1833    return coreFrame ? kit(coreFrame->editor().insertUnorderedList().get()) : nil;
    18341834}
    18351835
     
    18371837{
    18381838    Frame* coreFrame = core([self _frame]);
    1839     return coreFrame && coreFrame->editor()->canIncreaseSelectionListLevel();
     1839    return coreFrame && coreFrame->editor().canIncreaseSelectionListLevel();
    18401840}
    18411841
     
    18431843{
    18441844    Frame* coreFrame = core([self _frame]);
    1845     return coreFrame && coreFrame->editor()->canDecreaseSelectionListLevel();
     1845    return coreFrame && coreFrame->editor().canDecreaseSelectionListLevel();
    18461846}
    18471847
     
    18491849{
    18501850    Frame* coreFrame = core([self _frame]);
    1851     return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevel().get()) : nil;
     1851    return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevel().get()) : nil;
    18521852}
    18531853
     
    18551855{
    18561856    Frame* coreFrame = core([self _frame]);
    1857     return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevelOrdered().get()) : nil;
     1857    return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevelOrdered().get()) : nil;
    18581858}
    18591859
     
    18611861{
    18621862    Frame* coreFrame = core([self _frame]);
    1863     return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevelUnordered().get()) : nil;
     1863    return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevelUnordered().get()) : nil;
    18641864}
    18651865
     
    18681868    Frame* coreFrame = core([self _frame]);
    18691869    if (coreFrame)
    1870         coreFrame->editor()->decreaseSelectionListLevel();
     1870        coreFrame->editor().decreaseSelectionListLevel();
    18711871}
    18721872
     
    23602360    if (!coreFrame)
    23612361        return Editor::Command();
    2362     return coreFrame->editor()->command(commandNameForSelector(selector));
     2362    return coreFrame->editor().command(commandNameForSelector(selector));
    23632363}
    23642364
     
    23682368    if (!coreFrame)
    23692369        return Editor::Command();
    2370     return coreFrame->editor()->command(name);
     2370    return coreFrame->editor().command(name);
    23712371}
    23722372
     
    25942594        if ([menuItem isKindOfClass:[NSMenuItem class]]) {
    25952595            String direction = writingDirection == NSWritingDirectionLeftToRight ? "ltr" : "rtl";
    2596             [menuItem setState:frame->editor()->selectionHasStyle(CSSPropertyDirection, direction)];
     2596            [menuItem setState:frame->editor().selectionHasStyle(CSSPropertyDirection, direction)];
    25972597        }
    25982598        return [self _canEdit];
     
    26112611            // Take control of the title of the menu item instead of just checking/unchecking it because
    26122612            // a check would be ambiguous.
    2613             [menuItem setTitle:frame->editor()->selectionHasStyle(CSSPropertyDirection, "rtl")
     2613            [menuItem setTitle:frame->editor().selectionHasStyle(CSSPropertyDirection, "rtl")
    26142614                ? UI_STRING_INTERNAL("Left to Right", "Left to Right context menu item")
    26152615                : UI_STRING_INTERNAL("Right to Left", "Right to Left context menu item")];
     
    26422642   
    26432643    if (action == @selector(paste:) || action == @selector(pasteAsPlainText:))
    2644         return frame && (frame->editor()->canDHTMLPaste() || frame->editor()->canPaste());
     2644        return frame && (frame->editor().canDHTMLPaste() || frame->editor().canPaste());
    26452645   
    26462646    if (action == @selector(pasteAsRichText:))
    2647         return frame && (frame->editor()->canDHTMLPaste()
    2648             || (frame->editor()->canPaste() && frame->selection()->isContentRichlyEditable()));
     2647        return frame && (frame->editor().canDHTMLPaste()
     2648            || (frame->editor().canPaste() && frame->selection()->isContentRichlyEditable()));
    26492649   
    26502650    if (action == @selector(performFindPanelAction:))
     
    38043804
    38053805    // FIXME: Kill ring handling is mostly in WebCore, so this call should also be moved there.
    3806     frame->editor()->setStartNewKillRingSequence(true);
     3806    frame->editor().setStartNewKillRingSequence(true);
    38073807
    38083808    Page* page = frame->page();
     
    42324232    Frame* coreFrame = core([self _frame]);
    42334233    NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x"
    4234         attributes:coreFrame ? coreFrame->editor()->fontAttributesForSelectionStart() : nil];
     4234        attributes:coreFrame ? coreFrame->editor().fontAttributesForSelectionStart() : nil];
    42354235    NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
    42364236    [string release];
     
    43604360    if (Frame* coreFrame = core([self _frame])) {
    43614361        // FIXME: We shouldn't have to make a copy here. We want callers of this function to work directly with StylePropertySet eventually.
    4362         coreFrame->editor()->applyStyleToSelection(core(style)->copyProperties().get(), undoAction);
     4362        coreFrame->editor().applyStyleToSelection(core(style)->copyProperties().get(), undoAction);
    43634363    }
    43644364}
     
    46624662        if (Frame* coreFrame = core([self _frame])) {
    46634663            // FIXME: We shouldn't have to make a copy here.
    4664             coreFrame->editor()->applyStyle(core(style)->copyProperties().get(), [self _undoActionFromColorPanelWithSelector:selector]);
     4664            coreFrame->editor().applyStyle(core(style)->copyProperties().get(), [self _undoActionFromColorPanelWithSelector:selector]);
    46654665        }
    46664666    }
     
    47494749
    47504750    if (Frame* coreFrame = core([self _frame]))
    4751         coreFrame->editor()->advanceToNextMisspelling();
     4751        coreFrame->editor().advanceToNextMisspelling();
    47524752}
    47534753
     
    47694769   
    47704770    if (Frame* coreFrame = core([self _frame]))
    4771         coreFrame->editor()->advanceToNextMisspelling(true);
     4771        coreFrame->editor().advanceToNextMisspelling(true);
    47724772    [spellingPanel orderFront:sender];
    47734773}
     
    48374837
    48384838    WritingDirection direction = RightToLeftWritingDirection;
    4839     switch (coreFrame->editor()->baseWritingDirectionForSelectionStart()) {
     4839    switch (coreFrame->editor().baseWritingDirectionForSelectionStart()) {
    48404840        case LeftToRightWritingDirection:
    48414841            break;
     
    48514851
    48524852    if (Frame* coreFrame = core([self _frame]))
    4853         coreFrame->editor()->setBaseWritingDirection(direction);
     4853        coreFrame->editor().setBaseWritingDirection(direction);
    48544854}
    48554855
     
    48684868
    48694869    if (Frame* coreFrame = core([self _frame]))
    4870         coreFrame->editor()->setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
     4870        coreFrame->editor().setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
    48714871}
    48724872
     
    48894889
    48904890    if (Frame* coreFrame = core([self _frame]))
    4891         coreFrame->editor()->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
     4891        coreFrame->editor().setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);
    48924892}
    48934893
     
    50245024    NSFont *font = nil;
    50255025    if (Frame* coreFrame = core([self _frame])) {
    5026         if (const SimpleFontData* fd = coreFrame->editor()->fontForSelection(multipleFonts))
     5026        if (const SimpleFontData* fd = coreFrame->editor().fontForSelection(multipleFonts))
    50275027            font = fd->getNSFont();
    50285028    }
     
    55645564    if (!coreFrame)
    55655565        return NSMakeRange(0, 0);
    5566     NSRange result = [webFrame _convertToNSRange:coreFrame->editor()->compositionRange().get()];
     5566    NSRange result = [webFrame _convertToNSRange:coreFrame->editor().compositionRange().get()];
    55675567
    55685568    LOG(TextInput, "markedRange -> (%u, %u)", result.location, result.length);
     
    56085608{
    56095609    Frame* coreFrame = core([self _frame]);
    5610     BOOL result = coreFrame && coreFrame->editor()->hasComposition();
     5610    BOOL result = coreFrame && coreFrame->editor().hasComposition();
    56115611
    56125612    if (result) {
    56135613        // A saved command can confirm a composition, but it cannot start a new one.
    56145614        [self _executeSavedKeypressCommands];
    5615         result = coreFrame->editor()->hasComposition();
     5615        result = coreFrame->editor().hasComposition();
    56165616    }
    56175617
     
    56355635   
    56365636    if (Frame* coreFrame = core([self _frame]))
    5637         coreFrame->editor()->confirmComposition();
     5637        coreFrame->editor().confirmComposition();
    56385638}
    56395639
     
    57035703        [[self _frame] _selectNSRange:replacementRange];
    57045704
    5705     coreFrame->editor()->setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange));
     5705    coreFrame->editor().setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange));
    57065706}
    57075707
     
    57215721    // As in insertText:, we assume that the call comes from an input method if there is marked text.
    57225722    RefPtr<Frame> coreFrame = core([self _frame]);
    5723     bool isFromInputMethod = coreFrame && coreFrame->editor()->hasComposition();
     5723    bool isFromInputMethod = coreFrame && coreFrame->editor().hasComposition();
    57245724
    57255725    if (event && shouldSaveCommand && !isFromInputMethod)
     
    57755775    NSString *text;
    57765776    NSRange replacementRange = { NSNotFound, 0 };
    5777     bool isFromInputMethod = coreFrame && coreFrame->editor()->hasComposition();
     5777    bool isFromInputMethod = coreFrame && coreFrame->editor().hasComposition();
    57785778
    57795779    Vector<DictationAlternative> dictationAlternativeLocations;
     
    58115811    }
    58125812
    5813     if (!coreFrame || !coreFrame->editor()->canEdit())
     5813    if (!coreFrame || !coreFrame->editor().canEdit())
    58145814        return;
    58155815
     
    58205820    String eventText = text;
    58215821    eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore
    5822     if (!coreFrame->editor()->hasComposition()) {
     5822    if (!coreFrame->editor().hasComposition()) {
    58235823        // An insertText: might be handled by other responders in the chain if we don't handle it.
    58245824        // One example is space bar that results in scrolling down the page.
    58255825
    58265826        if (!dictationAlternativeLocations.isEmpty())
    5827             eventHandled = coreFrame->editor()->insertDictatedText(eventText, dictationAlternativeLocations, event);
     5827            eventHandled = coreFrame->editor().insertDictatedText(eventText, dictationAlternativeLocations, event);
    58285828        else
    5829             eventHandled = coreFrame->editor()->insertText(eventText, event);
     5829            eventHandled = coreFrame->editor().insertText(eventText, event);
    58305830    } else {
    58315831        eventHandled = true;
    5832         coreFrame->editor()->confirmComposition(eventText);
     5832        coreFrame->editor().confirmComposition(eventText);
    58335833    }
    58345834   
     
    58855885    [self _updateSecureInputState];
    58865886
    5887     if (!coreFrame->editor()->hasComposition() || coreFrame->editor()->ignoreCompositionSelectionChange())
     5887    if (!coreFrame->editor().hasComposition() || coreFrame->editor().ignoreCompositionSelectionChange())
    58885888        return;
    58895889
    58905890    unsigned start;
    58915891    unsigned end;
    5892     if (coreFrame->editor()->getCompositionSelection(start, end))
     5892    if (coreFrame->editor().getCompositionSelection(start, end))
    58935893        [[NSInputManager currentInputManager] markedTextSelectionChanged:NSMakeRange(start, end - start) client:self];
    58945894    else {
    5895         coreFrame->editor()->cancelComposition();
     5895        coreFrame->editor().cancelComposition();
    58965896        [[NSInputManager currentInputManager] markedTextAbandoned:self];
    58975897    }
     
    60616061        return 0;
    60626062
    6063     return coreFrame->editor()->countMatchesForText(string, core(range), coreOptions(options), limit, markMatches, 0);
     6063    return coreFrame->editor().countMatchesForText(string, core(range), coreOptions(options), limit, markMatches, 0);
    60646064}
    60656065
     
    60696069    if (!coreFrame)
    60706070        return;
    6071     coreFrame->editor()->setMarkedTextMatchesAreHighlighted(newValue);
     6071    coreFrame->editor().setMarkedTextMatchesAreHighlighted(newValue);
    60726072}
    60736073
     
    60756075{
    60766076    Frame* coreFrame = core([self _frame]);
    6077     return coreFrame && coreFrame->editor()->markedTextMatchesAreHighlighted();
     6077    return coreFrame && coreFrame->editor().markedTextMatchesAreHighlighted();
    60786078}
    60796079
     
    61116111        return NO;
    61126112    Frame* coreFrame = core([self _frame]);
    6113     return coreFrame && coreFrame->editor()->findString(string, coreOptions(options));
     6113    return coreFrame && coreFrame->editor().findString(string, coreOptions(options));
    61146114}
    61156115
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r149922 r150140  
    24282428    if (!coreFrame)
    24292429        return;
    2430     coreFrame->editor()->command(name).execute(value);
     2430    coreFrame->editor().command(name).execute(value);
    24312431}
    24322432
     
    53835383    if (!page)
    53845384        return nil;
    5385     return kit(page->mainFrame()->editor()->rangeForPoint(IntPoint([self convertPoint:point toView:nil])).get());
     5385    return kit(page->mainFrame()->editor().rangeForPoint(IntPoint([self convertPoint:point toView:nil])).get());
    53865386}
    53875387
     
    54445444        if (mainFrame) {
    54455445            if (flag) {
    5446                 mainFrame->editor()->applyEditingStyleToBodyElement();
     5446                mainFrame->editor().applyEditingStyleToBodyElement();
    54475447                // If the WebView is made editable and the selection is empty, set it to something.
    54485448                if (![self selectedDOMRange])
     
    57315731    Frame* coreFrame = core(webFrame);
    57325732    if (coreFrame)
    5733         coreFrame->editor()->deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]);
     5733        coreFrame->editor().deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]);
    57345734}
    57355735   
     
    57425742    // FIXME: We shouldn't have to make a copy here.
    57435743    if (coreFrame)
    5744         coreFrame->editor()->applyStyle(core(style)->copyProperties().get());
     5744        coreFrame->editor().applyStyle(core(style)->copyProperties().get());
    57455745}
    57465746
     
    57895789    Frame* coreFrame = core([self _selectedOrMainFrame]);
    57905790    if (coreFrame)
    5791         return coreFrame->editor()->fontAttributesForSelectionStart();
     5791        return coreFrame->editor().fontAttributesForSelectionStart();
    57925792   
    57935793    return nil;
     
    58335833    if (coreStartNode->document() != coreFrame->document())
    58345834        return;
    5835     return coreFrame->editor()->simplifyMarkup(coreStartNode, core(endNode));   
     5835    return coreFrame->editor().simplifyMarkup(coreStartNode, core(endNode));   
    58365836}
    58375837
     
    65686568    Frame* coreFrame = core(webFrame);
    65696569    if (coreFrame)
    6570         coreFrame->editor()->handleAlternativeTextUIResult(text);
     6570        coreFrame->editor().handleAlternativeTextUIResult(text);
    65716571}
    65726572#endif
  • trunk/Source/WebKit/qt/ChangeLog

    r150120 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     9        (DumpRenderTreeSupportQt::executeCoreCommandByName):
     10        (DumpRenderTreeSupportQt::isCommandEnabled):
     11        (DumpRenderTreeSupportQt::firstRectForCharacterRange):
     12        * WebCoreSupport/EditorClientQt.cpp:
     13        (WebCore::EditorClientQt::respondToChangedSelection):
     14        (WebCore::EditorClientQt::registerUndoStep):
     15        (WebCore::EditorClientQt::handleKeyboardEvent):
     16        * WebCoreSupport/QWebPageAdapter.cpp:
     17        (QWebPageAdapter::selectedText):
     18        (QWebPageAdapter::selectedHtml):
     19        (QWebPageAdapter::setContentEditable):
     20
    1212013-05-15  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
    222
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r148696 r150140  
    330330void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPageAdapter* adapter, const QString& name, const QString& value)
    331331{
    332     adapter->page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
     332    adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value);
    333333}
    334334
    335335bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPageAdapter *adapter, const QString& name)
    336336{
    337     return adapter->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
     337    return adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled();
    338338}
    339339
     
    375375        return QVariantList();
    376376
    377     QRect resultRect = frame->editor()->firstRectForRange(range.get());
     377    QRect resultRect = frame->editor().firstRectForRange(range.get());
    378378    rect << resultRect.x() << resultRect.y() << resultRect.width() << resultRect.height();
    379379    return rect;
     
    752752        return;
    753753
    754     Editor* editor = frame->editor();
    755     if (!editor || (!editor->hasComposition() && !text))
     754    Editor& editor = frame->editor();
     755    if (!editor.hasComposition() && !text)
    756756        return;
    757757
    758     if (editor->hasComposition()) {
     758    if (editor.hasComposition()) {
    759759        if (text)
    760             editor->confirmComposition(String::fromUTF8(text));
     760            editor.confirmComposition(String::fromUTF8(text));
    761761        else
    762             editor->confirmComposition();
     762            editor.confirmComposition();
    763763    } else
    764         editor->insertText(String::fromUTF8(text), 0);
     764        editor.insertText(String::fromUTF8(text), 0);
    765765}
    766766
  • trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp

    r145849 r150140  
    207207        bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
    208208        Pasteboard::generalPasteboard()->setSelectionMode(true);
    209         Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor()->canSmartCopyOrDelete(), frame);
     209        Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
    210210        Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    211211    }
    212212
    213213    m_page->respondToChangedSelection();
    214     if (!frame->editor()->ignoreCompositionSelectionChange())
     214    if (!frame->editor().ignoreCompositionSelectionChange())
    215215        emit m_page->microFocusChanged();
    216216}
     
    249249#ifndef QT_NO_UNDOSTACK
    250250    Frame* frame = m_page->page->focusController()->focusedOrMainFrame();
    251     if (m_inUndoRedo || (frame && !frame->editor()->lastEditCommand() /* HACK!! Don't recreate undos */))
     251    if (m_inUndoRedo || (frame && !frame->editor().lastEditCommand() /* HACK!! Don't recreate undos */))
    252252        return;
    253253    m_page->registerUndoStep(step);
     
    456456            // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated
    457457            // (e.g. Tab that inserts a Tab character, or Enter).
    458             if (frame->editor()->command(cmd).isTextInsertion()
     458            if (frame->editor().command(cmd).isTextInsertion()
    459459                && kevent->type() == PlatformEvent::RawKeyDown)
    460460                return;
     
    468468            String commandName = editorCommandForKeyDownEvent(event);
    469469            if (!commandName.isEmpty()) {
    470                 if (frame->editor()->command(commandName).execute()) // Event handled.
     470                if (frame->editor().command(commandName).execute()) // Event handled.
    471471                    event->setDefaultHandled();
    472472                return;
     
    496496
    497497            if (shouldInsertText) {
    498                 frame->editor()->insertText(kevent->text(), event);
     498                frame->editor().insertText(kevent->text(), event);
    499499                event->setDefaultHandled();
    500500                return;
     
    527527                String commandName = editorCommandForKeyDownEvent(event);
    528528                ASSERT(!commandName.isEmpty());
    529                 frame->editor()->command(commandName).execute();
     529                frame->editor().command(commandName).execute();
    530530                event->setDefaultHandled();
    531531                return;
  • trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp

    r148545 r150140  
    310310    if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection)
    311311        return QString();
    312     return frame->editor()->selectedText();
     312    return frame->editor().selectedText();
    313313}
    314314
    315315QString QWebPageAdapter::selectedHtml() const
    316316{
    317     return page->focusController()->focusedOrMainFrame()->editor()->selectedRange()->toHTML();
     317    return page->focusController()->focusedOrMainFrame()->editor().selectedRange()->toHTML();
    318318}
    319319
     
    330330    Frame* frame = mainFrameAdapter()->frame;
    331331    if (editable) {
    332         frame->editor()->applyEditingStyleToBodyElement();
     332        frame->editor().applyEditingStyleToBodyElement();
    333333        // FIXME: mac port calls this if there is no selectedDOMRange
    334334        // frame->setSelectionFromNone();
     
    568568{
    569569    WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
    570     WebCore::Editor *editor = frame->editor();
    571 
    572     if (!editor->canEdit()) {
     570    WebCore::Editor &editor = frame->editor();
     571
     572    if (!editor.canEdit()) {
    573573        ev->ignore();
    574574        return;
     
    611611
    612612            if (!ev->preeditString().isEmpty())
    613                 editor->setComposition(ev->preeditString(), underlines, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)));
     613                editor.setComposition(ev->preeditString(), underlines, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)));
    614614            else {
    615615                // If we are in the middle of a composition, an empty pre-edit string and a selection of zero
    616616                // cancels the current composition
    617                 if (editor->hasComposition() && !(a.start + a.length))
    618                     editor->setComposition(QString(), underlines, 0, 0);
     617                if (editor.hasComposition() && !(a.start + a.length))
     618                    editor.setComposition(QString(), underlines, 0, 0);
    619619            }
    620620            break;
     
    631631            toHTMLTextFormControlElement(node)->setSelectionRange(start, start + ev->replacementLength());
    632632        // Commit regardless of whether commitString is empty, to get rid of selection.
    633         editor->confirmComposition(ev->commitString());
     633        editor.confirmComposition(ev->commitString());
    634634    } else if (!ev->commitString().isEmpty()) {
    635         if (editor->hasComposition())
    636             editor->confirmComposition(ev->commitString());
     635        if (editor.hasComposition())
     636            editor.confirmComposition(ev->commitString());
    637637        else
    638             editor->insertText(ev->commitString(), 0);
     638            editor.insertText(ev->commitString(), 0);
    639639    } else if (!hasSelection && !ev->preeditString().isEmpty())
    640         editor->setComposition(ev->preeditString(), underlines, 0, 0);
    641     else if (ev->preeditString().isEmpty() && editor->hasComposition())
    642         editor->confirmComposition(String());
     640        editor.setComposition(ev->preeditString(), underlines, 0, 0);
     641    else if (ev->preeditString().isEmpty() && editor.hasComposition())
     642        editor.confirmComposition(String());
    643643
    644644    ev->accept();
     
    651651        return QVariant();
    652652
    653     WebCore::Editor* editor = frame->editor();
     653    WebCore::Editor& editor = frame->editor();
    654654
    655655    RenderObject* renderer = 0;
     
    679679    }
    680680    case Qt::ImCursorPosition: {
    681         if (editor->hasComposition())
     681        if (editor.hasComposition())
    682682            return QVariant(frame->selection()->end().offsetInContainerNode());
    683683        return QVariant(frame->selection()->extent().offsetInContainerNode());
     
    686686        if (renderTextControl && renderTextControl->textFormControlElement()) {
    687687            QString text = renderTextControl->textFormControlElement()->value();
    688             RefPtr<Range> range = editor->compositionRange();
     688            RefPtr<Range> range = editor.compositionRange();
    689689            if (range)
    690690                text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get()));
     
    694694    }
    695695    case Qt::ImCurrentSelection: {
    696         if (!editor->hasComposition() && renderTextControl && renderTextControl->textFormControlElement()) {
     696        if (!editor.hasComposition() && renderTextControl && renderTextControl->textFormControlElement()) {
    697697            int start = frame->selection()->start().offsetInContainerNode();
    698698            int end = frame->selection()->end().offsetInContainerNode();
     
    704704    }
    705705    case Qt::ImAnchorPosition: {
    706         if (editor->hasComposition())
     706        if (editor.hasComposition())
    707707            return QVariant(frame->selection()->start().offsetInContainerNode());
    708708        return QVariant(frame->selection()->base().offsetInContainerNode());
     
    956956{
    957957    WebCore::FrameLoader* loader = mainFrameAdapter()->frame->loader();
    958     WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
     958    WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor();
    959959
    960960    switch (action) {
     
    974974    case QWebPageAdapter::SetTextDirectionLeftToRight:
    975975    case QWebPageAdapter::SetTextDirectionRightToLeft:
    976         *enabled = editor->canEdit();
     976        *enabled = editor.canEdit();
    977977        *checked = false;
    978978        break;
     
    981981        // if it's an editor command, let its logic determine state
    982982        if (commandName) {
    983             Editor::Command command = editor->command(commandName);
     983            Editor::Command command = editor.command(commandName);
    984984            *enabled = command.isEnabled();
    985985            if (*enabled)
     
    998998    if (!frame)
    999999        return;
    1000     Editor* editor = frame->editor();
     1000    Editor& editor = frame->editor();
    10011001
    10021002    // Convenience
     
    10291029        bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
    10301030        Pasteboard::generalPasteboard()->setSelectionMode(true);
    1031         editor->copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
     1031        editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
    10321032        Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    10331033#endif
    1034         editor->copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
     1034        editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
    10351035        break;
    10361036    }
     
    10591059
    10601060    case SetTextDirectionDefault:
    1061         editor->setBaseWritingDirection(NaturalWritingDirection);
     1061        editor.setBaseWritingDirection(NaturalWritingDirection);
    10621062        break;
    10631063    case SetTextDirectionLeftToRight:
    1064         editor->setBaseWritingDirection(LeftToRightWritingDirection);
     1064        editor.setBaseWritingDirection(LeftToRightWritingDirection);
    10651065        break;
    10661066    case SetTextDirectionRightToLeft:
    1067         editor->setBaseWritingDirection(RightToLeftWritingDirection);
     1067        editor.setBaseWritingDirection(RightToLeftWritingDirection);
    10681068        break;
    10691069#if ENABLE(INSPECTOR)
     
    10761076    default:
    10771077        if (commandName)
    1078             editor->command(commandName).execute();
     1078            editor.command(commandName).execute();
    10791079        break;
    10801080    }
     
    13151315{
    13161316    WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
    1317     WebCore::Editor* editor = frame->editor();
    1318     if (!editor->canEdit())
     1317    WebCore::Editor& editor = frame->editor();
     1318    if (!editor.canEdit())
    13191319        return false;
    13201320    if (event->modifiers() == Qt::NoModifier
  • trunk/Source/WebKit/win/ChangeLog

    r150115 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/WebContextMenuClient.cpp:
     9        (WebContextMenuClient::searchWithGoogle):
     10        * WebFrame.cpp:
     11        (WebFrame::hasSpellingMarker):
     12        (WebFrame::setTextDirection):
     13        (WebFrame::selectedString):
     14        (WebFrame::selectAll):
     15        * WebView.cpp:
     16        (WebView::execCommand):
     17        (WebView::handleEditingKeyboardEvent):
     18        (WebView::executeCoreCommandByName):
     19        (WebView::selectedText):
     20        (WebView::deleteEnabled):
     21        (WebView::editingEnabled):
     22        (WebView::replaceSelectionWithText):
     23        (WebView::copy):
     24        (WebView::cut):
     25        (WebView::paste):
     26        (WebView::copyURL):
     27        (WebView::delete_):
     28        (WebView::checkSpelling):
     29        (WebView::showGuessPanel):
     30        (WebView::clearUndoRedoOperations):
     31        (WebView::prepareCandidateWindow):
     32        (WebView::resetIME):
     33        (WebView::updateSelectionForIME):
     34        (WebView::onIMEComposition):
     35        (WebView::onIMEEndComposition):
     36        (WebView::onIMERequestCharPosition):
     37        (WebView::onIMERequest):
     38        (WebView::setCompositionForTesting):
     39        (WebView::hasCompositionForTesting):
     40        (WebView::confirmCompositionForTesting):
     41        (WebView::compositionRangeForTesting):
     42        (WebView::firstRectForCharacterRangeForTesting):
     43        (WebView::selectedRangeForTesting):
     44
    1452013-05-15  Patrick Gansterer  <paroga@webkit.org>
    246
  • trunk/Source/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp

    r148577 r150140  
    112112void WebContextMenuClient::searchWithGoogle(const Frame* frame)
    113113{
    114     String searchString = frame->editor()->selectedText();
     114    String searchString = frame->editor().selectedText();
    115115    searchString.stripWhiteSpace();
    116116    String encoded = encodeWithURLEscapeSequences(searchString);
  • trunk/Source/WebKit/win/WebFrame.cpp

    r148577 r150140  
    10061006    if (!coreFrame)
    10071007        return E_FAIL;
    1008     *result = coreFrame->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
     1008    *result = coreFrame->editor().selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
    10091009    return S_OK;
    10101010}
     
    10221022{
    10231023    Frame* coreFrame = core(this);
    1024     if (!coreFrame || !coreFrame->editor())
     1024    if (!coreFrame)
    10251025        return E_FAIL;
    10261026
    10271027    String directionString(direction, SysStringLen(direction));
    10281028    if (directionString == "auto")
    1029         coreFrame->editor()->setBaseWritingDirection(NaturalWritingDirection);
     1029        coreFrame->editor().setBaseWritingDirection(NaturalWritingDirection);
    10301030    else if (directionString == "ltr")
    1031         coreFrame->editor()->setBaseWritingDirection(LeftToRightWritingDirection);
     1031        coreFrame->editor().setBaseWritingDirection(LeftToRightWritingDirection);
    10321032    else if (directionString == "rtl")
    1033         coreFrame->editor()->setBaseWritingDirection(RightToLeftWritingDirection);
     1033        coreFrame->editor().setBaseWritingDirection(RightToLeftWritingDirection);
    10341034    return S_OK;
    10351035}
     
    10531053        return E_FAIL;
    10541054
    1055     String text = coreFrame->displayStringModifiedByEncoding(coreFrame->editor()->selectedText());
     1055    String text = coreFrame->displayStringModifiedByEncoding(coreFrame->editor().selectedText());
    10561056
    10571057    *result = BString(text).release();
     
    10651065        return E_FAIL;
    10661066
    1067     if (!coreFrame->editor()->command("SelectAll").execute())
     1067    if (!coreFrame->editor().command("SelectAll").execute())
    10681068        return E_FAIL;
    10691069
  • trunk/Source/WebKit/win/WebView.cpp

    r149716 r150140  
    18131813    switch (LOWORD(wParam)) {
    18141814        case SelectAll:
    1815             return frame->editor()->command("SelectAll").execute();
     1815            return frame->editor().command("SelectAll").execute();
    18161816        case Undo:
    1817             return frame->editor()->command("Undo").execute();
     1817            return frame->editor().command("Undo").execute();
    18181818        case Redo:
    1819             return frame->editor()->command("Redo").execute();
     1819            return frame->editor().command("Redo").execute();
    18201820    }
    18211821    return false;
     
    19641964        return false;
    19651965
    1966     Editor::Command command = frame->editor()->command(interpretKeyEvent(evt));
     1966    Editor::Command command = frame->editor().command(interpretKeyEvent(evt));
    19671967
    19681968    if (keyEvent->type() == PlatformEvent::RawKeyDown) {
     
    19801980        return false;
    19811981
    1982     return frame->editor()->insertText(evt->keyEvent()->text(), evt);
     1982    return frame->editor().insertText(evt->keyEvent()->text(), evt);
    19831983}
    19841984
     
    34303430HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR value)
    34313431{
    3432     m_page->focusController()->focusedOrMainFrame()->editor()->command(toString(name)).execute(toString(value));
     3432    m_page->focusController()->focusedOrMainFrame()->editor().command(toString(name)).execute(toString(value));
    34333433
    34343434    return S_OK;
     
    36573657        return E_FAIL;
    36583658
    3659     String frameSelectedText = focusedFrame->editor()->selectedText();
     3659    String frameSelectedText = focusedFrame->editor().selectedText();
    36603660    *text = SysAllocStringLen(frameSelectedText.characters(), frameSelectedText.length());
    36613661    if (!*text && frameSelectedText.length())
     
    42424242        /* [retval][out] */ BOOL* enabled)
    42434243{
    4244     Editor* editor = m_page->focusController()->focusedOrMainFrame()->editor();
    4245     *enabled = editor->canCut() || editor->canDHTMLCut();
     4244    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
     4245    *enabled = editor.canCut() || editor.canDHTMLCut();
    42464246    return S_OK;
    42474247}
     
    42504250        /* [retval][out] */ BOOL* enabled)
    42514251{
    4252     Editor* editor = m_page->focusController()->focusedOrMainFrame()->editor();
    4253     *enabled = editor->canCopy() || editor->canDHTMLCopy();
     4252    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
     4253    *enabled = editor.canCopy() || editor.canDHTMLCopy();
    42544254    return S_OK;
    42554255}
     
    42584258        /* [retval][out] */ BOOL* enabled)
    42594259{
    4260     Editor* editor = m_page->focusController()->focusedOrMainFrame()->editor();
    4261     *enabled = editor->canPaste() || editor->canDHTMLPaste();
     4260    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
     4261    *enabled = editor.canPaste() || editor.canDHTMLPaste();
    42624262    return S_OK;
    42634263}
     
    42664266        /* [retval][out] */ BOOL* enabled)
    42674267{
    4268     *enabled = m_page->focusController()->focusedOrMainFrame()->editor()->canDelete();
     4268    *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canDelete();
    42694269    return S_OK;
    42704270}
     
    42734273        /* [retval][out] */ BOOL* enabled)
    42744274{
    4275     *enabled = m_page->focusController()->focusedOrMainFrame()->editor()->canEdit();
     4275    *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canEdit();
    42764276    return S_OK;
    42774277}
     
    43254325{
    43264326    Position start = m_page->mainFrame()->selection()->selection().start();
    4327     m_page->focusController()->focusedOrMainFrame()->editor()->insertText(toString(text), 0);
     4327    m_page->focusController()->focusedOrMainFrame()->editor().insertText(toString(text), 0);
    43284328    m_page->mainFrame()->selection()->setBase(start);
    43294329    return S_OK;
     
    43464346HRESULT STDMETHODCALLTYPE WebView::deleteSelection( void)
    43474347{
    4348     Editor* editor = m_page->focusController()->focusedOrMainFrame()->editor();
    4349     editor->deleteSelectionWithSmartDelete(editor->canSmartCopyOrDelete());
     4348    Editor& editor = m_page->focusController()->focusedOrMainFrame()->editor();
     4349    editor.deleteSelectionWithSmartDelete(editor.canSmartCopyOrDelete());
    43504350    return S_OK;
    43514351}
     
    43694369        /* [in] */ IUnknown* /*sender*/)
    43704370{
    4371     m_page->focusController()->focusedOrMainFrame()->editor()->command("Copy").execute();
     4371    m_page->focusController()->focusedOrMainFrame()->editor().command("Copy").execute();
    43724372    return S_OK;
    43734373}
     
    43764376        /* [in] */ IUnknown* /*sender*/)
    43774377{
    4378     m_page->focusController()->focusedOrMainFrame()->editor()->command("Cut").execute();
     4378    m_page->focusController()->focusedOrMainFrame()->editor().command("Cut").execute();
    43794379    return S_OK;
    43804380}
     
    43834383        /* [in] */ IUnknown* /*sender*/)
    43844384{
    4385     m_page->focusController()->focusedOrMainFrame()->editor()->command("Paste").execute();
     4385    m_page->focusController()->focusedOrMainFrame()->editor().command("Paste").execute();
    43864386    return S_OK;
    43874387}
     
    43904390        /* [in] */ BSTR url)
    43914391{
    4392     m_page->focusController()->focusedOrMainFrame()->editor()->copyURL(MarshallingHelpers::BSTRToKURL(url), "");
     4392    m_page->focusController()->focusedOrMainFrame()->editor().copyURL(MarshallingHelpers::BSTRToKURL(url), "");
    43934393    return S_OK;
    43944394}
     
    44124412        /* [in] */ IUnknown* /*sender*/)
    44134413{
    4414     m_page->focusController()->focusedOrMainFrame()->editor()->command("Delete").execute();
     4414    m_page->focusController()->focusedOrMainFrame()->editor().command("Delete").execute();
    44154415    return S_OK;
    44164416}
     
    44944494    }
    44954495   
    4496     core(m_mainFrame)->editor()->advanceToNextMisspelling();
     4496    core(m_mainFrame)->editor().advanceToNextMisspelling();
    44974497    return S_OK;
    44984498}
     
    45134513    }
    45144514   
    4515     core(m_mainFrame)->editor()->advanceToNextMisspelling(true);
     4515    core(m_mainFrame)->editor().advanceToNextMisspelling(true);
    45164516    m_editingDelegate->showSpellingUI(TRUE);
    45174517    return S_OK;
     
    53405340{
    53415341    if (Frame* frame = m_page->focusController()->focusedOrMainFrame())
    5342         frame->editor()->clearUndoRedoOperations();
     5342        frame->editor().clearUndoRedoOperations();
    53435343    return S_OK;
    53445344}
     
    54555455        ExceptionCode ec = 0;
    54565456        RefPtr<Range> tempRange = range->cloneRange(ec);
    5457         caret = targetFrame->editor()->firstRectForRange(tempRange.get());
     5457        caret = targetFrame->editor().firstRectForRange(tempRange.get());
    54585458    }
    54595459    caret = targetFrame->view()->contentsToWindow(caret);
     
    54735473{
    54745474    if (targetFrame)
    5475         targetFrame->editor()->cancelComposition();
     5475        targetFrame->editor().cancelComposition();
    54765476
    54775477    if (HIMC hInputContext = getIMMContext()) {
     
    54885488        return;
    54895489
    5490     if (!targetFrame->editor()->cancelCompositionIfSelectionIsInvalid())
     5490    if (!targetFrame->editor().cancelCompositionIfSelectionIsInvalid())
    54915491        resetIME(targetFrame);
    54925492}
     
    56445644
    56455645    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
    5646     if (!targetFrame || !targetFrame->editor()->canEdit())
     5646    if (!targetFrame || !targetFrame->editor().canEdit())
    56475647        return true;
    56485648
     
    56545654            return true;
    56555655       
    5656         targetFrame->editor()->confirmComposition(compositionString);
     5656        targetFrame->editor().confirmComposition(compositionString);
    56575657    } else {
    56585658        String compositionString;
     
    56755675        int cursorPosition = LOWORD(IMMDict::dict().getCompositionString(hInputContext, GCS_CURSORPOS, 0, 0));
    56765676
    5677         targetFrame->editor()->setComposition(compositionString, underlines, cursorPosition, 0);
     5677        targetFrame->editor().setComposition(compositionString, underlines, cursorPosition, 0);
    56785678    }
    56795679
     
    56875687    // This happens after deleting the last character from inline input hole.
    56885688    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
    5689     if (targetFrame && targetFrame->editor()->hasComposition())
    5690         targetFrame->editor()->confirmComposition(String());
     5689    if (targetFrame && targetFrame->editor().hasComposition())
     5690        targetFrame->editor().confirmComposition(String());
    56915691
    56925692    if (m_inIMEComposition)
     
    57135713LRESULT WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* charPos)
    57145714{
    5715     if (charPos->dwCharPos && !targetFrame->editor()->hasComposition())
     5715    if (charPos->dwCharPos && !targetFrame->editor().hasComposition())
    57165716        return 0;
    57175717    IntRect caret;
    5718     if (RefPtr<Range> range = targetFrame->editor()->hasComposition() ? targetFrame->editor()->compositionRange() : targetFrame->selection()->selection().toNormalizedRange()) {
     5718    if (RefPtr<Range> range = targetFrame->editor().hasComposition() ? targetFrame->editor().compositionRange() : targetFrame->selection()->selection().toNormalizedRange()) {
    57195719        ExceptionCode ec = 0;
    57205720        RefPtr<Range> tempRange = range->cloneRange(ec);
    57215721        tempRange->setStart(tempRange->startContainer(ec), tempRange->startOffset(ec) + charPos->dwCharPos, ec);
    5722         caret = targetFrame->editor()->firstRectForRange(tempRange.get());
     5722        caret = targetFrame->editor().firstRectForRange(tempRange.get());
    57235723    }
    57245724    caret = targetFrame->view()->contentsToWindow(caret);
     
    57535753    LOG(TextInput, "onIMERequest %s", imeRequestName(request).latin1().data());
    57545754    Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
    5755     if (!targetFrame || !targetFrame->editor()->canEdit())
     5755    if (!targetFrame || !targetFrame->editor().canEdit())
    57565756        return 0;
    57575757
     
    68846884
    68856885    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    6886     if (!frame || !frame->editor()->canEdit())
     6886    if (!frame || !frame->editor().canEdit())
    68876887        return E_FAIL;
    68886888
     
    68916891    Vector<CompositionUnderline> underlines;
    68926892    underlines.append(CompositionUnderline(0, compositionStr.length(), Color(Color::black), false));
    6893     frame->editor()->setComposition(compositionStr, underlines, from, from + length);
     6893    frame->editor().setComposition(compositionStr, underlines, from, from + length);
    68946894
    68956895    return S_OK;
     
    69056905        return E_FAIL;
    69066906
    6907     *result = frame && frame->editor()->hasComposition();
     6907    *result = frame && frame->editor().hasComposition();
    69086908
    69096909    return S_OK;
     
    69166916
    69176917    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    6918     if (!frame || !frame->editor()->canEdit())
     6918    if (!frame || !frame->editor().canEdit())
    69196919        return E_FAIL;
    69206920
     
    69226922
    69236923    if (compositionStr.isNull())
    6924         frame->editor()->confirmComposition();
    6925 
    6926     frame->editor()->confirmComposition(compositionStr);
     6924        frame->editor().confirmComposition();
     6925
     6926    frame->editor().confirmComposition(compositionStr);
    69276927
    69286928    return S_OK;
     
    69356935
    69366936    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    6937     if (!frame || !frame->editor()->canEdit())
    6938         return E_FAIL;
    6939 
    6940     RefPtr<Range> range = frame->editor()->compositionRange();
     6937    if (!frame || !frame->editor().canEdit())
     6938        return E_FAIL;
     6939
     6940    RefPtr<Range> range = frame->editor().compositionRange();
    69416941
    69426942    if (!range)
     
    69796979    ASSERT(range->endContainer());
    69806980     
    6981     IntRect rect = frame->editor()->firstRectForRange(range.get());
     6981    IntRect rect = frame->editor().firstRectForRange(range.get());
    69826982    resultIntRect = frame->view()->contentsToWindow(rect);
    69836983
     
    69996999        return E_FAIL;
    70007000
    7001     RefPtr<Range> range = frame->editor()->selectedRange();
     7001    RefPtr<Range> range = frame->editor().selectedRange();
    70027002
    70037003    size_t locationSize;
  • trunk/Source/WebKit/wince/ChangeLog

    r149275 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/EditorClientWinCE.cpp:
     9        (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
     10
    1112013-04-29  Patrick Gansterer  <paroga@webkit.org>
    212
  • trunk/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp

    r148702 r150140  
    396396    }
    397397
    398     Editor::Command command = frame->editor()->command(interpretKeyEvent(event));
     398    Editor::Command command = frame->editor().command(interpretKeyEvent(event));
    399399
    400400    if (keyEvent->type() == PlatformEvent::RawKeyDown) {
     
    416416        return false;
    417417
    418     return frame->editor()->insertText(event->keyEvent()->text(), event);
     418    return frame->editor().insertText(event->keyEvent()->text(), event);
    419419}
    420420
  • trunk/Source/WebKit2/ChangeLog

    r150133 r150140  
     12013-05-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Frame::editor() should return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=116037
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
     9        (WebKit::WebContextMenuClient::searchWithGoogle):
     10        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     11        (WebKit::WebEditorClient::updateGlobalSelection):
     12        * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
     13        (WebKit::WebEditorClient::handleInputMethodKeydown):
     14        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
     15        (WebKit::WebEditorClient::executePendingEditorCommands):
     16        (WebKit::WebEditorClient::handleKeyboardEvent):
     17        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
     18        (WebKit::WebContextMenuClient::searchWithGoogle):
     19        (WebKit::WebContextMenuClient::searchWithSpotlight):
     20        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
     21        (WebKit::changeWordCase):
     22        * WebProcess/WebPage/WebFrame.cpp:
     23        (WebKit::WebFrame::selectionAsString):
     24        (WebKit::WebFrame::setTextDirection):
     25        * WebProcess/WebPage/WebPage.cpp:
     26        (WebKit::WebPage::editorState):
     27        (WebKit::WebPage::executeEditingCommand):
     28        (WebKit::WebPage::isEditingCommandEnabled):
     29        (WebKit::WebPage::validateCommand):
     30        (WebKit::WebPage::handleEditingKeyboardEvent):
     31        (WebKit::WebPage::advanceToNextMisspelling):
     32        (WebKit::WebPage::uppercaseWord):
     33        (WebKit::WebPage::lowercaseWord):
     34        (WebKit::WebPage::capitalizeWord):
     35        (WebKit::WebPage::replaceSelectionWithText):
     36        (WebKit::WebPage::handleAlternativeTextUIResult):
     37        (WebKit::WebPage::setCompositionForTesting):
     38        (WebKit::WebPage::hasCompositionForTesting):
     39        (WebKit::WebPage::confirmCompositionForTesting):
     40        (WebKit::WebPage::setComposition):
     41        (WebKit::WebPage::cancelComposition):
     42        * WebProcess/WebPage/efl/WebPageEfl.cpp:
     43        (WebKit::WebPage::confirmComposition):
     44        (WebKit::WebPage::setComposition):
     45        (WebKit::WebPage::cancelComposition):
     46        * WebProcess/WebPage/mac/WebPageMac.mm:
     47        (WebKit::WebPage::executeKeypressCommandsInternal):
     48        (WebKit::WebPage::handleEditingKeyboardEvent):
     49        (WebKit::WebPage::setComposition):
     50        (WebKit::WebPage::confirmComposition):
     51        (WebKit::WebPage::cancelComposition):
     52        (WebKit::WebPage::insertText):
     53        (WebKit::WebPage::insertDictatedText):
     54        (WebKit::WebPage::getMarkedRange):
     55        (WebKit::WebPage::firstRectForCharacterRange):
     56        (WebKit::WebPage::readSelectionFromPasteboard):
     57        (WebKit::WebPage::getStringSelectionForPasteboard):
     58        (WebKit::WebPage::getDataSelectionForPasteboard):
     59
    1602013-05-15  Anders Carlsson  <andersca@apple.com>
    261
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp

    r145453 r150140  
    7878void WebContextMenuClient::searchWithGoogle(const Frame* frame)
    7979{
    80     String searchString = frame->editor()->selectedText();
     80    String searchString = frame->editor().selectedText();
    8181    searchString.stripWhiteSpace();
    8282    String encoded = encodeWithURLEscapeSequences(searchString);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r149848 r150140  
    211211        bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
    212212        Pasteboard::generalPasteboard()->setSelectionMode(true);
    213         Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor()->canSmartCopyOrDelete(), frame);
     213        Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
    214214        Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    215215    }
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp

    r149022 r150140  
    5151{
    5252    Frame* frame = m_page->corePage()->focusController()->focusedOrMainFrame();
    53     if (!frame || !frame->editor()->canEdit())
     53    if (!frame || !frame->editor().canEdit())
    5454        return;
    5555
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp

    r138544 r150140  
    5151    Vector<Editor::Command> commands;
    5252    for (size_t i = 0; i < pendingEditorCommands.size(); i++) {
    53         Editor::Command command = frame->editor()->command(pendingEditorCommands.at(i).utf8().data());
     53        Editor::Command command = frame->editor().command(pendingEditorCommands.at(i).utf8().data());
    5454        if (command.isTextInsertion() && !allowTextInsertion)
    5555            return false;
     
    9696
    9797        // Only allow text insertion commands if the current node is editable.
    98         if (executePendingEditorCommands(frame, pendingEditorCommands, frame->editor()->canEdit())) {
     98        if (executePendingEditorCommands(frame, pendingEditorCommands, frame->editor().canEdit())) {
    9999            event->setDefaultHandled();
    100100            return;
     
    103103
    104104    // Don't allow text insertion for nodes that cannot edit.
    105     if (!frame->editor()->canEdit())
     105    if (!frame->editor().canEdit())
    106106        return;
    107107
     
    120120        return;
    121121
    122     if (frame->editor()->insertText(platformEvent->text(), event))
     122    if (frame->editor().insertText(platformEvent->text(), event))
    123123        event->setDefaultHandled();
    124124}
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm

    r150064 r150140  
    6464void WebContextMenuClient::searchWithGoogle(const Frame* frame)
    6565{
    66     String searchString = frame->editor()->selectedText();
     66    String searchString = frame->editor().selectedText();
    6767    searchString.stripWhiteSpace();
    6868   
     
    8686        selectionFrame = mainFrame;
    8787
    88     String selectedString = selectionFrame->displayStringModifiedByEncoding(selectionFrame->editor()->selectedText());
     88    String selectedString = selectionFrame->displayStringModifiedByEncoding(selectionFrame->editor().selectedText());
    8989   
    9090    if (selectedString.isEmpty())
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm

    r149848 r150140  
    137137{
    138138    Frame* frame = page->corePage()->focusController()->focusedOrMainFrame();
    139     if (!frame->editor()->canEdit())
     139    if (!frame->editor().canEdit())
    140140        return;
    141141
    142     frame->editor()->command("selectWord").execute();
    143 
    144     NSString *selectedString = frame->displayStringModifiedByEncoding(frame->editor()->selectedText());
     142    frame->editor().command("selectWord").execute();
     143
     144    NSString *selectedString = frame->displayStringModifiedByEncoding(frame->editor().selectedText());
    145145    page->replaceSelectionWithText(frame, [selectedString performSelector:selector]);
    146146}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r149848 r150140  
    325325        return String();
    326326
    327     return m_coreFrame->displayStringModifiedByEncoding(m_coreFrame->editor()->selectedText());
     327    return m_coreFrame->displayStringModifiedByEncoding(m_coreFrame->editor().selectedText());
    328328}
    329329
     
    701701void WebFrame::setTextDirection(const String& direction)
    702702{
    703     if (!m_coreFrame || !m_coreFrame->editor())
     703    if (!m_coreFrame)
    704704        return;
    705705
    706706    if (direction == "auto")
    707         m_coreFrame->editor()->setBaseWritingDirection(NaturalWritingDirection);
     707        m_coreFrame->editor().setBaseWritingDirection(NaturalWritingDirection);
    708708    else if (direction == "ltr")
    709         m_coreFrame->editor()->setBaseWritingDirection(LeftToRightWritingDirection);
     709        m_coreFrame->editor().setBaseWritingDirection(LeftToRightWritingDirection);
    710710    else if (direction == "rtl")
    711         m_coreFrame->editor()->setBaseWritingDirection(RightToLeftWritingDirection);
     711        m_coreFrame->editor().setBaseWritingDirection(RightToLeftWritingDirection);
    712712}
    713713
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r150046 r150140  
    602602    result.isContentRichlyEditable = frame->selection()->isContentRichlyEditable();
    603603    result.isInPasswordField = frame->selection()->isInPasswordField();
    604     result.hasComposition = frame->editor()->hasComposition();
    605     result.shouldIgnoreCompositionSelectionChange = frame->editor()->ignoreCompositionSelectionChange();
     604    result.hasComposition = frame->editor().hasComposition();
     605    result.shouldIgnoreCompositionSelectionChange = frame->editor().ignoreCompositionSelectionChange();
    606606
    607607#if PLATFORM(QT)
     
    642642
    643643    RefPtr<Range> range;
    644     if (result.hasComposition && (range = frame->editor()->compositionRange())) {
    645         frame->editor()->getCompositionSelection(result.anchorPosition, result.cursorPosition);
     644    if (result.hasComposition && (range = frame->editor().compositionRange())) {
     645        frame->editor().getCompositionSelection(result.anchorPosition, result.cursorPosition);
    646646
    647647        result.compositionRect = frame->view()->contentsToWindow(range->boundingBox());
     
    658658
    659659    if (range)
    660         result.cursorRect = frame->view()->contentsToWindow(frame->editor()->firstRectForRange(range.get()));
     660        result.cursorRect = frame->view()->contentsToWindow(frame->editor().firstRectForRange(range.get()));
    661661
    662662    // FIXME: We should only transfer innerText when it changes and do this on the UI side.
     
    769769    }
    770770   
    771     frame->editor()->command(commandName).execute(argument);
     771    frame->editor().command(commandName).execute(argument);
    772772}
    773773
     
    781781        return pluginView->isEditingCommandEnabled(commandName);
    782782   
    783     Editor::Command command = frame->editor()->command(commandName);
     783    Editor::Command command = frame->editor().command(commandName);
    784784    return command.isSupported() && command.isEnabled();
    785785}
     
    17791779            isEnabled = pluginView->isEditingCommandEnabled(commandName);
    17801780        else {
    1781             Editor::Command command = frame->editor()->command(commandName);
     1781            Editor::Command command = frame->editor().command(commandName);
    17821782            state = command.state();
    17831783            isEnabled = command.isSupported() && command.isEnabled();
     
    25612561        return false;
    25622562
    2563     Editor::Command command = frame->editor()->command(interpretKeyEvent(evt));
     2563    Editor::Command command = frame->editor().command(interpretKeyEvent(evt));
    25642564
    25652565    if (keyEvent->type() == PlatformEvent::RawKeyDown) {
     
    25742574
    25752575    // Don't allow text insertion for nodes that cannot edit.
    2576     if (!frame->editor()->canEdit())
     2576    if (!frame->editor().canEdit())
    25772577        return false;
    25782578
     
    25812581        return false;
    25822582
    2583     return frame->editor()->insertText(evt->keyEvent()->text(), evt);
     2583    return frame->editor().insertText(evt->keyEvent()->text(), evt);
    25842584}
    25852585#endif
     
    28602860{
    28612861    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    2862     frame->editor()->advanceToNextMisspelling(startBeforeSelection);
     2862    frame->editor().advanceToNextMisspelling(startBeforeSelection);
    28632863}
    28642864
     
    28872887void WebPage::uppercaseWord()
    28882888{
    2889     m_page->focusController()->focusedOrMainFrame()->editor()->uppercaseWord();
     2889    m_page->focusController()->focusedOrMainFrame()->editor().uppercaseWord();
    28902890}
    28912891
    28922892void WebPage::lowercaseWord()
    28932893{
    2894     m_page->focusController()->focusedOrMainFrame()->editor()->lowercaseWord();
     2894    m_page->focusController()->focusedOrMainFrame()->editor().lowercaseWord();
    28952895}
    28962896
    28972897void WebPage::capitalizeWord()
    28982898{
    2899     m_page->focusController()->focusedOrMainFrame()->editor()->capitalizeWord();
     2899    m_page->focusController()->focusedOrMainFrame()->editor().capitalizeWord();
    29002900}
    29012901#endif
     
    29342934    bool selectReplacement = true;
    29352935    bool smartReplace = false;
    2936     return frame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
     2936    return frame->editor().replaceSelectionWithText(text, selectReplacement, smartReplace);
    29372937}
    29382938
     
    35973597    if (!frame)
    35983598        return;
    3599     frame->editor()->handleAlternativeTextUIResult(result);
     3599    frame->editor().handleAlternativeTextUIResult(result);
    36003600}
    36013601#endif
     
    36193619{
    36203620    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    3621     if (!frame || !frame->editor()->canEdit())
     3621    if (!frame || !frame->editor().canEdit())
    36223622        return;
    36233623
    36243624    Vector<CompositionUnderline> underlines;
    36253625    underlines.append(CompositionUnderline(0, compositionString.length(), Color(Color::black), false));
    3626     frame->editor()->setComposition(compositionString, underlines, from, from + length);
     3626    frame->editor().setComposition(compositionString, underlines, from, from + length);
    36273627}
    36283628
     
    36303630{
    36313631    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    3632     return frame && frame->editor()->hasComposition();
     3632    return frame && frame->editor().hasComposition();
    36333633}
    36343634
     
    36363636{
    36373637    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    3638     if (!frame || !frame->editor()->canEdit())
     3638    if (!frame || !frame->editor().canEdit())
    36393639        return;
    36403640
    36413641    if (compositionString.isNull())
    3642         frame->editor()->confirmComposition();
    3643     frame->editor()->confirmComposition(compositionString);
     3642        frame->editor().confirmComposition();
     3643    frame->editor().confirmComposition(compositionString);
    36443644}
    36453645
     
    37973797    Frame* targetFrame = page->corePage()->focusController()->focusedOrMainFrame();
    37983798
    3799     if (!targetFrame || !targetFrame->editor())
     3799    if (!targetFrame)
    38003800        return 0;
    38013801
    3802     Editor* editor = targetFrame->editor();
    3803     if (!editor->canEdit())
     3802    Editor& editor = targetFrame->editor();
     3803    if (!editor.canEdit())
    38043804        return 0;
    38053805
    3806     if (editor->hasComposition()) {
     3806    if (editor.hasComposition()) {
    38073807        // We should verify the parent node of this IME composition node are
    38083808        // editable because JavaScript may delete a parent node of the composition
    38093809        // node. In this case, WebKit crashes while deleting texts from the parent
    38103810        // node, which doesn't exist any longer.
    3811         if (PassRefPtr<Range> range = editor->compositionRange()) {
     3811        if (PassRefPtr<Range> range = editor.compositionRange()) {
    38123812            Node* node = range->startContainer();
    38133813            if (!node || !node->isContentEditable())
     
    38263826    }
    38273827
    3828     Editor* editor = targetFrame->editor();
    3829     editor->confirmComposition(compositionString);
     3828    targetFrame->editor().confirmComposition(compositionString);
    38303829
    38313830    if (selectionStart == -1) {
     
    38593858        Element* scope = targetFrame->selection()->rootEditableElement();
    38603859        RefPtr<Range> replacementRange = TextIterator::rangeFromLocationAndLength(scope, replacementStart, replacementLength);
    3861         targetFrame->editor()->setIgnoreCompositionSelectionChange(true);
     3860        targetFrame->editor().setIgnoreCompositionSelectionChange(true);
    38623861        targetFrame->selection()->setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY));
    3863         targetFrame->editor()->setIgnoreCompositionSelectionChange(false);
    3864     }
    3865 
    3866     targetFrame->editor()->setComposition(text, underlines, selectionStart, selectionEnd);
     3862        targetFrame->editor().setIgnoreCompositionSelectionChange(false);
     3863    }
     3864
     3865    targetFrame->editor().setComposition(text, underlines, selectionStart, selectionEnd);
    38673866    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
    38683867}
     
    38713870{
    38723871    if (Frame* targetFrame = targetFrameForEditing(this))
    3873         targetFrame->editor()->cancelComposition();
     3872        targetFrame->editor().cancelComposition();
    38743873    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
    38753874}
  • trunk/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

    r148553 r150140  
    179179        return 0;
    180180
    181     Editor* editor = frame->editor();
    182     if (!editor->canEdit())
     181    Editor& editor = frame->editor();
     182    if (!editor.canEdit())
    183183        return 0;
    184184
    185     if (editor->hasComposition()) {
     185    if (editor.hasComposition()) {
    186186        // We should verify the parent node of this IME composition node are
    187187        // editable because JavaScript may delete a parent node of the composition
    188188        // node. In this case, WebKit crashes while deleting texts from the parent
    189189        // node, which doesn't exist any longer.
    190         if (PassRefPtr<Range> range = editor->compositionRange()) {
     190        if (PassRefPtr<Range> range = editor.compositionRange()) {
    191191            Node* node = range->startContainer();
    192192            if (!node || !node->isContentEditable())
     
    204204        return;
    205205
    206     targetFrame->editor()->confirmComposition(compositionString);
     206    targetFrame->editor().confirmComposition(compositionString);
    207207}
    208208
     
    213213        return;
    214214
    215     targetFrame->editor()->setComposition(compositionString, underlines, cursorPosition, 0);
     215    targetFrame->editor().setComposition(compositionString, underlines, cursorPosition, 0);
    216216}
    217217
     
    222222        return;
    223223
    224     frame->editor()->cancelComposition();
     224    frame->editor().cancelComposition();
    225225}
    226226
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r150064 r150140  
    169169    for (size_t i = 0; i < commands.size(); ++i) {
    170170        if (commands[i].commandName == "insertText:") {
    171             ASSERT(!frame->editor()->hasComposition());
    172 
    173             if (!frame->editor()->canEdit())
     171            ASSERT(!frame->editor().hasComposition());
     172
     173            if (!frame->editor().canEdit())
    174174                continue;
    175175
    176176            // An insertText: might be handled by other responders in the chain if we don't handle it.
    177177            // One example is space bar that results in scrolling down the page.
    178             eventWasHandled |= frame->editor()->insertText(commands[i].text, event);
     178            eventWasHandled |= frame->editor().insertText(commands[i].text, event);
    179179        } else {
    180             Editor::Command command = frame->editor()->command(commandNameForSelectorName(commands[i].commandName));
     180            Editor::Command command = frame->editor().command(commandNameForSelectorName(commands[i].commandName));
    181181            if (command.isSupported()) {
    182182                bool commandExecutedByEditor = command.execute(event);
     
    234234        bool haveTextInsertionCommands = false;
    235235        for (size_t i = 0; i < commands.size(); ++i) {
    236             if (frame->editor()->command(commandNameForSelectorName(commands[i].commandName)).isTextInsertion())
     236            if (frame->editor().command(commandNameForSelectorName(commands[i].commandName)).isTextInsertion())
    237237                haveTextInsertionCommands = true;
    238238        }
     
    266266        }
    267267
    268         frame->editor()->setComposition(text, underlines, selectionStart, selectionEnd);
     268        frame->editor().setComposition(text, underlines, selectionStart, selectionEnd);
    269269    }
    270270
     
    276276    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    277277
    278     frame->editor()->confirmComposition();
     278    frame->editor().confirmComposition();
    279279
    280280    newState = editorState();
     
    285285    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    286286
    287     frame->editor()->cancelComposition();
     287    frame->editor().cancelComposition();
    288288
    289289    newState = editorState();
     
    300300    }
    301301
    302     if (!frame->editor()->hasComposition()) {
     302    if (!frame->editor().hasComposition()) {
    303303        // An insertText: might be handled by other responders in the chain if we don't handle it.
    304304        // One example is space bar that results in scrolling down the page.
    305         handled = frame->editor()->insertText(text, m_keyboardEventBeingInterpreted);
     305        handled = frame->editor().insertText(text, m_keyboardEventBeingInterpreted);
    306306    } else {
    307307        handled = true;
    308         frame->editor()->confirmComposition(text);
     308        frame->editor().confirmComposition(text);
    309309    }
    310310
     
    322322    }
    323323
    324     ASSERT(!frame->editor()->hasComposition());
    325     handled = frame->editor()->insertDictatedText(text, dictationAlternativeLocations, m_keyboardEventBeingInterpreted);
     324    ASSERT(!frame->editor().hasComposition());
     325    handled = frame->editor().insertDictatedText(text, dictationAlternativeLocations, m_keyboardEventBeingInterpreted);
    326326    newState = editorState();
    327327}
     
    335335        return;
    336336
    337     RefPtr<Range> range = frame->editor()->compositionRange();
     337    RefPtr<Range> range = frame->editor().compositionRange();
    338338    size_t locationSize;
    339339    size_t lengthSize;
     
    438438    ASSERT(range->endContainer());
    439439     
    440     IntRect rect = frame->editor()->firstRectForRange(range.get());
     440    IntRect rect = frame->editor().firstRectForRange(range.get());
    441441    resultRect = frame->view()->contentsToWindow(rect);
    442442}
     
    655655        return;
    656656    }
    657     frame->editor()->readSelectionFromPasteboard(pasteboardName);
     657    frame->editor().readSelectionFromPasteboard(pasteboardName);
    658658    result = true;
    659659}
     
    677677        return;
    678678
    679     stringValue = frame->editor()->stringSelectionForPasteboard();
     679    stringValue = frame->editor().stringSelectionForPasteboard();
    680680}
    681681
     
    686686        return;
    687687
    688     RefPtr<SharedBuffer> buffer = frame->editor()->dataSelectionForPasteboard(pasteboardType);
     688    RefPtr<SharedBuffer> buffer = frame->editor().dataSelectionForPasteboard(pasteboardType);
    689689    if (!buffer) {
    690690        size = 0;
Note: See TracChangeset for help on using the changeset viewer.