Changeset 150140 in webkit
- Timestamp:
- May 15, 2013 12:47:47 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 93 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150138 r150140 1 2013-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 1 214 2013-05-15 Darin Adler <darin@apple.com> 2 215 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r149583 r150140 321 321 return false; 322 322 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(); 328 326 if (!textChecker) 329 327 return false; -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
r148545 r150140 80 80 coreObject->setFocused(true); 81 81 // 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)) 83 83 *position += length; 84 84 } … … 107 107 coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(startPos, endPos - startPos))); 108 108 coreObject->setFocused(true); 109 document->frame()->editor() ->performDelete();109 document->frame()->editor().performDelete(); 110 110 } 111 111 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r149581 r150140 725 725 if (unifiedTextCheckerEnabled(node->document()->frame())) { 726 726 // 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(); 728 728 729 729 // checkTextOfParagraph is the only spelling/grammar checker implemented in WK1 and WK2 … … 743 743 while (charLength > 0) { 744 744 const UChar* charData = chars + currentPosition; 745 TextCheckerClient* checker = node->document()->frame()->editor() ->textChecker();745 TextCheckerClient* checker = node->document()->frame()->editor().textChecker(); 746 746 747 747 int misspellingLocation = -1; -
trunk/Source/WebCore/dom/Clipboard.cpp
r150100 r150140 346 346 // The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument. 347 347 // 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); 349 349 } 350 350 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r150104 r150140 834 834 HTMLElement* deleteButtonContainerElement = 0; 835 835 if (Frame* frame = document()->frame()) 836 deleteButtonContainerElement = frame->editor() ->deleteButtonController()->containerElement();836 deleteButtonContainerElement = frame->editor().deleteButtonController()->containerElement(); 837 837 cloneChildNodesAvoidingDeleteButton(this, clone, deleteButtonContainerElement); 838 838 #else -
trunk/Source/WebCore/dom/Document.cpp
r150013 r150140 371 371 return false; 372 372 373 return frame->editor() ->shouldBeginEditing(rangeOfContents(root).get());373 return frame->editor().shouldBeginEditing(rangeOfContents(root).get()); 374 374 } 375 375 … … 3362 3362 3363 3363 if (oldFocusedNode->isRootEditableElement()) 3364 frame()->editor() ->didEndEditing();3364 frame()->editor().didEndEditing(); 3365 3365 3366 3366 if (view()) { … … 3411 3411 3412 3412 if (m_focusedNode->isRootEditableElement()) 3413 frame()->editor() ->didBeginEditing();3413 frame()->editor().didBeginEditing(); 3414 3414 3415 3415 // eww, I suck. set the qt focus correctly … … 4192 4192 document->updateStyleIfNeeded(); 4193 4193 4194 return frame->editor() ->command(commandName,4194 return frame->editor().command(commandName, 4195 4195 userInterface ? CommandFromDOMWithUserInterface : CommandFromDOM); 4196 4196 } -
trunk/Source/WebCore/editing/AlternativeTextController.cpp
r149465 r150140 340 340 VisiblePosition p = startOfWord(start, LeftWordIfOnBoundary); 341 341 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); 343 343 } 344 344 break; … … 743 743 { 744 744 #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)) 748 748 return; 749 749 DocumentMarkerController* markers = selection->startContainer()->document()->markers(); -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r148908 r150140 116 116 } 117 117 118 frame->editor() ->unappliedEditing(this);118 frame->editor().unappliedEditing(this); 119 119 } 120 120 … … 139 139 } 140 140 141 frame->editor() ->reappliedEditing(this);141 frame->editor().reappliedEditing(this); 142 142 } 143 143 … … 220 220 // and TypingCommands do it on their own (see TypingCommand::typingAddedToOpenCommand). 221 221 if (!callsAppliedEditingInDoApply()) 222 frame->editor() ->appliedEditing(this);222 frame->editor().appliedEditing(this); 223 223 setShouldRetainAutocorrectionIndicator(false); 224 224 } … … 1223 1223 1224 1224 setEndingSelection(VisibleSelection(start, end, DOWNSTREAM)); 1225 document()->frame()->editor() ->clearMisspellingsAndBadGrammar(endingSelection());1225 document()->frame()->editor().clearMisspellingsAndBadGrammar(endingSelection()); 1226 1226 deleteSelection(false, false, false, false); 1227 1227 … … 1256 1256 applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, options)); 1257 1257 1258 document()->frame()->editor() ->markMisspellingsAndBadGrammar(endingSelection());1258 document()->frame()->editor().markMisspellingsAndBadGrammar(endingSelection()); 1259 1259 1260 1260 // 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 54 54 { 55 55 if (event->type() == eventNames().clickEvent) { 56 document()->frame()->editor() ->deleteButtonController()->deleteTarget();56 document()->frame()->editor().deleteButtonController()->deleteTarget(); 57 57 event->setDefaultHandled(); 58 58 return; -
trunk/Source/WebCore/editing/DeleteButtonController.cpp
r142576 r150140 284 284 return; 285 285 286 EditorClient* client = m_frame->editor() ->client();286 EditorClient* client = m_frame->editor().client(); 287 287 if (!client || !client->shouldShowDeleteInterface(element)) 288 288 return; -
trunk/Source/WebCore/editing/DeleteButtonController.h
r148545 r150140 84 84 { 85 85 if (frame) 86 frame->editor() ->deleteButtonController()->disable();86 frame->editor().deleteButtonController()->disable(); 87 87 } 88 88 … … 90 90 { 91 91 if (m_frame) 92 m_frame->editor() ->deleteButtonController()->enable();92 m_frame->editor().deleteButtonController()->enable(); 93 93 } 94 94 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r144911 r150140 649 649 RefPtr<Range> range = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), endOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent()); 650 650 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())) 652 652 return; 653 653 … … 795 795 Element* textControl = enclosingTextFormControl(m_selectionToDelete.start()); 796 796 if (textControl && textControl->focused()) 797 document()->frame()->editor() ->textWillBeDeletedInTextField(textControl);797 document()->frame()->editor().textWillBeDeletedInTextField(textControl); 798 798 } 799 799 … … 855 855 if (!originalString.isEmpty()) { 856 856 if (Frame* frame = document()->frame()) 857 frame->editor() ->deletedAutocorrectionAtPosition(m_endingPosition, originalString);857 frame->editor().deletedAutocorrectionAtPosition(m_endingPosition, originalString); 858 858 } 859 859 -
trunk/Source/WebCore/editing/EditCommand.cpp
r142705 r150140 46 46 ASSERT(m_document); 47 47 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())); 49 49 setEndingSelection(m_startingSelection); 50 50 } -
trunk/Source/WebCore/editing/EditingStyle.cpp
r149532 r150140 1345 1345 1346 1346 reconcileTextDecorationProperties(mutableStyle.get()); 1347 if (!document->frame()->editor() ->shouldStyleWithCSS())1347 if (!document->frame()->editor().shouldStyleWithCSS()) 1348 1348 extractTextStyles(document, mutableStyle.get(), computedStyle->useFixedFontDefaultSize()); 1349 1349 -
trunk/Source/WebCore/editing/Editor.cpp
r150122 r150140 2013 2013 } 2014 2014 2015 if (!frame()->editor() ->shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))2015 if (!frame()->editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped)) 2016 2016 return; 2017 frame()->editor() ->replaceSelectionWithText(autocorrectedString, false, false);2017 frame()->editor().replaceSelectionWithText(autocorrectedString, false, false); 2018 2018 2019 2019 // Reset the charet one character further. -
trunk/Source/WebCore/editing/EditorCommand.cpp
r148395 r150140 106 106 switch (source) { 107 107 case CommandFromMenuOrKeyBinding: 108 frame->editor() ->applyStyleToSelection(style, action);108 frame->editor().applyStyleToSelection(style, action); 109 109 return true; 110 110 case CommandFromDOM: 111 111 case CommandFromDOMWithUserInterface: 112 frame->editor() ->applyStyle(style);112 frame->editor().applyStyle(style); 113 113 return true; 114 114 } … … 165 165 166 166 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); 169 169 else 170 styleIsPresent = frame->editor() ->selectionHasStyle(propertyID, onValue) == TrueTriState;170 styleIsPresent = frame->editor().selectionHasStyle(propertyID, onValue) == TrueTriState; 171 171 172 172 RefPtr<EditingStyle> style = EditingStyle::create(propertyID, styleIsPresent ? offValue : onValue); … … 181 181 switch (source) { 182 182 case CommandFromMenuOrKeyBinding: 183 frame->editor() ->applyParagraphStyleToSelection(style.get(), action);183 frame->editor().applyParagraphStyleToSelection(style.get(), action); 184 184 return true; 185 185 case CommandFromDOM: 186 186 case CommandFromDOMWithUserInterface: 187 frame->editor() ->applyParagraphStyle(style.get());187 frame->editor().applyParagraphStyle(style.get()); 188 188 return true; 189 189 } … … 219 219 RefPtr<Range> oldRange = frame->selection()->selection().toNormalizedRange(); 220 220 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)) 222 222 return false; 223 223 frame->selection()->setSelectedRange(newRange.get(), affinity, true); … … 227 227 static TriState stateStyle(Frame* frame, CSSPropertyID propertyID, const char* desiredValue) 228 228 { 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); 232 232 } 233 233 … … 236 236 // FIXME: Rather than retrieving the style at the start of the current selection, 237 237 // 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); 239 239 } 240 240 … … 282 282 static bool executeCopy(Frame* frame, Event*, EditorCommandSource, const String&) 283 283 { 284 frame->editor() ->copy();284 frame->editor().copy(); 285 285 return true; 286 286 } … … 299 299 if (source == CommandFromMenuOrKeyBinding) { 300 300 UserTypingGestureIndicator typingGestureIndicator(frame); 301 frame->editor() ->cut();301 frame->editor().cut(); 302 302 } else 303 frame->editor() ->cut();303 frame->editor().cut(); 304 304 return true; 305 305 } … … 308 308 { 309 309 if (equalIgnoringCase(value, "div")) 310 frame->editor() ->setDefaultParagraphSeparator(EditorParagraphSeparatorIsDiv);310 frame->editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsDiv); 311 311 else if (equalIgnoringCase(value, "p")) 312 frame->editor() ->setDefaultParagraphSeparator(EditorParagraphSeparatorIsP);312 frame->editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsP); 313 313 314 314 return true; … … 321 321 // Doesn't modify the text if the current selection isn't a range. 322 322 UserTypingGestureIndicator typingGestureIndicator(frame); 323 frame->editor() ->performDelete();323 frame->editor().performDelete(); 324 324 return true; 325 325 } … … 337 337 static bool executeDeleteBackward(Frame* frame, Event*, EditorCommandSource, const String&) 338 338 { 339 frame->editor() ->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);339 frame->editor().deleteWithDirection(DirectionBackward, CharacterGranularity, false, true); 340 340 return true; 341 341 } … … 344 344 { 345 345 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); 347 347 return true; 348 348 } … … 350 350 static bool executeDeleteForward(Frame* frame, Event*, EditorCommandSource, const String&) 351 351 { 352 frame->editor() ->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);352 frame->editor().deleteWithDirection(DirectionForward, CharacterGranularity, false, true); 353 353 return true; 354 354 } … … 356 356 static bool executeDeleteToBeginningOfLine(Frame* frame, Event*, EditorCommandSource, const String&) 357 357 { 358 frame->editor() ->deleteWithDirection(DirectionBackward, LineBoundary, true, false);358 frame->editor().deleteWithDirection(DirectionBackward, LineBoundary, true, false); 359 359 return true; 360 360 } … … 362 362 static bool executeDeleteToBeginningOfParagraph(Frame* frame, Event*, EditorCommandSource, const String&) 363 363 { 364 frame->editor() ->deleteWithDirection(DirectionBackward, ParagraphBoundary, true, false);364 frame->editor().deleteWithDirection(DirectionBackward, ParagraphBoundary, true, false); 365 365 return true; 366 366 } … … 370 370 // Despite its name, this command should delete the newline at the end of 371 371 // 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); 373 373 return true; 374 374 } … … 378 378 // Despite its name, this command should delete the newline at the end of 379 379 // 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); 381 381 return true; 382 382 } … … 384 384 static bool executeDeleteToMark(Frame* frame, Event*, EditorCommandSource, const String&) 385 385 { 386 RefPtr<Range> mark = frame->editor() ->mark().toNormalizedRange();386 RefPtr<Range> mark = frame->editor().mark().toNormalizedRange(); 387 387 if (mark) { 388 388 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); 390 390 ASSERT(selected); 391 391 if (!selected) 392 392 return false; 393 393 } 394 frame->editor() ->performDelete();395 frame->editor() ->setMark(frame->selection()->selection());394 frame->editor().performDelete(); 395 frame->editor().setMark(frame->selection()->selection()); 396 396 return true; 397 397 } … … 399 399 static bool executeDeleteWordBackward(Frame* frame, Event*, EditorCommandSource, const String&) 400 400 { 401 frame->editor() ->deleteWithDirection(DirectionBackward, WordGranularity, true, false);401 frame->editor().deleteWithDirection(DirectionBackward, WordGranularity, true, false); 402 402 return true; 403 403 } … … 405 405 static bool executeDeleteWordForward(Frame* frame, Event*, EditorCommandSource, const String&) 406 406 { 407 frame->editor() ->deleteWithDirection(DirectionForward, WordGranularity, true, false);407 frame->editor().deleteWithDirection(DirectionForward, WordGranularity, true, false); 408 408 return true; 409 409 } … … 411 411 static bool executeFindString(Frame* frame, Event*, EditorCommandSource, const String& value) 412 412 { 413 return frame->editor() ->findString(value, true, false, true, false);413 return frame->editor().findString(value, true, false, true, false); 414 414 } 415 415 … … 457 457 switch (source) { 458 458 case CommandFromMenuOrKeyBinding: 459 frame->editor() ->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);459 frame->editor().deleteWithDirection(DirectionForward, CharacterGranularity, false, true); 460 460 return true; 461 461 case CommandFromDOM: … … 473 473 static bool executeIgnoreSpelling(Frame* frame, Event*, EditorCommandSource, const String&) 474 474 { 475 frame->editor() ->ignoreSpelling();475 frame->editor().ignoreSpelling(); 476 476 return true; 477 477 } … … 529 529 { 530 530 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); 532 532 } 533 533 … … 592 592 style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); 593 593 style->setProperty(CSSPropertyDirection, CSSValueLtr); 594 frame->editor() ->applyStyle(style.get(), EditActionSetWritingDirection);594 frame->editor().applyStyle(style.get(), EditActionSetWritingDirection); 595 595 return true; 596 596 } … … 600 600 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); 601 601 style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal); 602 frame->editor() ->applyStyle(style.get(), EditActionSetWritingDirection);602 frame->editor().applyStyle(style.get(), EditActionSetWritingDirection); 603 603 return true; 604 604 } … … 609 609 style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); 610 610 style->setProperty(CSSPropertyDirection, CSSValueRtl); 611 frame->editor() ->applyStyle(style.get(), EditActionSetWritingDirection);611 frame->editor().applyStyle(style.get(), EditActionSetWritingDirection); 612 612 return true; 613 613 } … … 905 905 static bool executeToggleOverwrite(Frame* frame, Event*, EditorCommandSource, const String&) 906 906 { 907 frame->editor() ->toggleOverwriteModeEnabled();907 frame->editor().toggleOverwriteModeEnabled(); 908 908 return true; 909 909 } … … 913 913 if (source == CommandFromMenuOrKeyBinding) { 914 914 UserTypingGestureIndicator typingGestureIndicator(frame); 915 frame->editor() ->paste();915 frame->editor().paste(); 916 916 } else 917 frame->editor() ->paste();917 frame->editor().paste(); 918 918 return true; 919 919 } … … 921 921 static bool executePasteGlobalSelection(Frame* frame, Event*, EditorCommandSource source, const String&) 922 922 { 923 if (!frame->editor() ->client()->supportsGlobalSelection())923 if (!frame->editor().client()->supportsGlobalSelection()) 924 924 return false; 925 925 ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding); … … 928 928 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 929 929 Pasteboard::generalPasteboard()->setSelectionMode(true); 930 frame->editor() ->paste();930 frame->editor().paste(); 931 931 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 932 932 return true; … … 937 937 if (source == CommandFromMenuOrKeyBinding) { 938 938 UserTypingGestureIndicator typingGestureIndicator(frame); 939 frame->editor() ->pasteAsPlainText();939 frame->editor().pasteAsPlainText(); 940 940 } else 941 frame->editor() ->pasteAsPlainText();941 frame->editor().pasteAsPlainText(); 942 942 return true; 943 943 } … … 947 947 if (source == CommandFromMenuOrKeyBinding) { 948 948 UserTypingGestureIndicator typingGestureIndicator(frame); 949 frame->editor() ->pasteAsPlainText();949 frame->editor().pasteAsPlainText(); 950 950 } else 951 frame->editor() ->pasteAsPlainText();951 frame->editor().pasteAsPlainText(); 952 952 return true; 953 953 } … … 964 964 static bool executeRedo(Frame* frame, Event*, EditorCommandSource, const String&) 965 965 { 966 frame->editor() ->redo();966 frame->editor().redo(); 967 967 return true; 968 968 } … … 970 970 static bool executeRemoveFormat(Frame* frame, Event*, EditorCommandSource, const String&) 971 971 { 972 frame->editor() ->removeFormattingAndStyle();972 frame->editor().removeFormattingAndStyle(); 973 973 return true; 974 974 } … … 1027 1027 static bool executeSelectToMark(Frame* frame, Event*, EditorCommandSource, const String&) 1028 1028 { 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(); 1031 1031 if (!mark || !selection) { 1032 1032 systemBeep(); … … 1044 1044 static bool executeSetMark(Frame* frame, Event*, EditorCommandSource, const String&) 1045 1045 { 1046 frame->editor() ->setMark(frame->selection()->selection());1046 frame->editor().setMark(frame->selection()->selection()); 1047 1047 return true; 1048 1048 } … … 1056 1056 static bool executeStyleWithCSS(Frame* frame, Event*, EditorCommandSource, const String& value) 1057 1057 { 1058 frame->editor() ->setShouldStyleWithCSS(!equalIgnoringCase(value, "false"));1058 frame->editor().setShouldStyleWithCSS(!equalIgnoringCase(value, "false")); 1059 1059 return true; 1060 1060 } … … 1062 1062 static bool executeUseCSS(Frame* frame, Event*, EditorCommandSource, const String& value) 1063 1063 { 1064 frame->editor() ->setShouldStyleWithCSS(equalIgnoringCase(value, "false"));1064 frame->editor().setShouldStyleWithCSS(equalIgnoringCase(value, "false")); 1065 1065 return true; 1066 1066 } … … 1078 1078 static bool executeSwapWithMark(Frame* frame, Event*, EditorCommandSource, const String&) 1079 1079 { 1080 const VisibleSelection& mark = frame->editor() ->mark();1080 const VisibleSelection& mark = frame->editor().mark(); 1081 1081 const VisibleSelection& selection = frame->selection()->selection(); 1082 1082 if (mark.isNone() || selection.isNone()) { … … 1085 1085 } 1086 1086 frame->selection()->setSelection(mark); 1087 frame->editor() ->setMark(selection);1087 frame->editor().setMark(selection); 1088 1088 return true; 1089 1089 } … … 1092 1092 static bool executeTakeFindStringFromSelection(Frame* frame, Event*, EditorCommandSource, const String&) 1093 1093 { 1094 frame->editor() ->takeFindStringFromSelection();1094 frame->editor().takeFindStringFromSelection(); 1095 1095 return true; 1096 1096 } … … 1109 1109 static bool executeTranspose(Frame* frame, Event*, EditorCommandSource, const String&) 1110 1110 { 1111 frame->editor() ->transpose();1111 frame->editor().transpose(); 1112 1112 return true; 1113 1113 } … … 1121 1121 static bool executeUndo(Frame* frame, Event*, EditorCommandSource, const String&) 1122 1122 { 1123 frame->editor() ->undo();1123 frame->editor().undo(); 1124 1124 return true; 1125 1125 } … … 1144 1144 static bool executeYank(Frame* frame, Event*, EditorCommandSource, const String&) 1145 1145 { 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(); 1148 1148 return true; 1149 1149 } … … 1151 1151 static bool executeYankAndSelect(Frame* frame, Event*, EditorCommandSource, const String&) 1152 1152 { 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(); 1155 1155 return true; 1156 1156 } … … 1176 1176 bool defaultValue = settings && settings->javaScriptCanAccessClipboard(); 1177 1177 1178 EditorClient* client = frame->editor() ->client();1178 EditorClient* client = frame->editor().client(); 1179 1179 return client ? client->canCopyCut(frame, defaultValue) : defaultValue; 1180 1180 } … … 1188 1188 bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed(); 1189 1189 1190 EditorClient* client = frame->editor() ->client();1190 EditorClient* client = frame->editor().client(); 1191 1191 return client ? client->canPaste(frame, defaultValue) : defaultValue; 1192 1192 } … … 1202 1202 { 1203 1203 // 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); 1205 1205 return (selection.isCaret() && selection.isContentEditable()) || selection.isRange(); 1206 1206 } … … 1221 1221 static bool enabledVisibleSelectionAndMark(Frame* frame, Event* event, EditorCommandSource) 1222 1222 { 1223 const VisibleSelection& selection = frame->editor() ->selectionForCommand(event);1223 const VisibleSelection& selection = frame->editor().selectionForCommand(event); 1224 1224 return ((selection.isCaret() && selection.isContentEditable()) || selection.isRange()) 1225 && frame->editor() ->mark().isCaretOrRange();1225 && frame->editor().mark().isCaretOrRange(); 1226 1226 } 1227 1227 1228 1228 static bool enableCaretInEditableText(Frame* frame, Event* event, EditorCommandSource) 1229 1229 { 1230 const VisibleSelection& selection = frame->editor() ->selectionForCommand(event);1230 const VisibleSelection& selection = frame->editor().selectionForCommand(event); 1231 1231 return selection.isCaret() && selection.isContentEditable(); 1232 1232 } … … 1234 1234 static bool enabledCopy(Frame* frame, Event*, EditorCommandSource) 1235 1235 { 1236 return frame->editor() ->canDHTMLCopy() || frame->editor()->canCopy();1236 return frame->editor().canDHTMLCopy() || frame->editor().canCopy(); 1237 1237 } 1238 1238 1239 1239 static bool enabledCut(Frame* frame, Event*, EditorCommandSource) 1240 1240 { 1241 return frame->editor() ->canDHTMLCut() || frame->editor()->canCut();1241 return frame->editor().canDHTMLCut() || frame->editor().canCut(); 1242 1242 } 1243 1243 1244 1244 static bool enabledInEditableText(Frame* frame, Event* event, EditorCommandSource) 1245 1245 { 1246 return frame->editor() ->selectionForCommand(event).rootEditableElement();1246 return frame->editor().selectionForCommand(event).rootEditableElement(); 1247 1247 } 1248 1248 … … 1251 1251 switch (source) { 1252 1252 case CommandFromMenuOrKeyBinding: 1253 return frame->editor() ->canDelete();1253 return frame->editor().canDelete(); 1254 1254 case CommandFromDOM: 1255 1255 case CommandFromDOMWithUserInterface: … … 1275 1275 static bool enabledPaste(Frame* frame, Event*, EditorCommandSource) 1276 1276 { 1277 return frame->editor() ->canPaste();1277 return frame->editor().canPaste(); 1278 1278 } 1279 1279 … … 1290 1290 static bool enabledRedo(Frame* frame, Event*, EditorCommandSource) 1291 1291 { 1292 return frame->editor() ->canRedo();1292 return frame->editor().canRedo(); 1293 1293 } 1294 1294 … … 1296 1296 static bool enabledTakeFindStringFromSelection(Frame* frame, Event*, EditorCommandSource) 1297 1297 { 1298 return frame->editor() ->canCopyExcludingStandaloneImages();1298 return frame->editor().canCopyExcludingStandaloneImages(); 1299 1299 } 1300 1300 #endif … … 1302 1302 static bool enabledUndo(Frame* frame, Event*, EditorCommandSource) 1303 1303 { 1304 return frame->editor() ->canUndo();1304 return frame->editor().canUndo(); 1305 1305 } 1306 1306 … … 1324 1324 static TriState stateOrderedList(Frame* frame, Event*) 1325 1325 { 1326 return frame->editor() ->selectionOrderedListState();1326 return frame->editor().selectionOrderedListState(); 1327 1327 } 1328 1328 … … 1334 1334 static TriState stateStyleWithCSS(Frame* frame, Event*) 1335 1335 { 1336 return frame->editor() ->shouldStyleWithCSS() ? TrueTriState : FalseTriState;1336 return frame->editor().shouldStyleWithCSS() ? TrueTriState : FalseTriState; 1337 1337 } 1338 1338 … … 1369 1369 static TriState stateUnorderedList(Frame* frame, Event*) 1370 1370 { 1371 return frame->editor() ->selectionUnorderedListState();1371 return frame->editor().selectionUnorderedListState(); 1372 1372 } 1373 1373 … … 1406 1406 static String valueDefaultParagraphSeparator(Frame* frame, Event*) 1407 1407 { 1408 switch (frame->editor() ->defaultParagraphSeparator()) {1408 switch (frame->editor().defaultParagraphSeparator()) { 1409 1409 case EditorParagraphSeparatorIsDiv: 1410 1410 return divTag.localName(); -
trunk/Source/WebCore/editing/FrameSelection.cpp
r149432 r150140 103 103 static inline bool shouldAlwaysUseDirectionalSelection(Frame* frame) 104 104 { 105 return !frame || frame->editor() ->behavior().shouldConsiderSelectionAsDirectional();105 return !frame || frame->editor().behavior().shouldConsiderSelectionAsDirectional(); 106 106 } 107 107 … … 328 328 selectFrameElementInParentIfFullySelected(); 329 329 notifyRendererOfSelectionChange(userTriggered); 330 m_frame->editor() ->respondToChangedSelection(oldSelection, options);330 m_frame->editor().respondToChangedSelection(oldSelection, options); 331 331 if (userTriggered == UserTriggered) { 332 332 ScrollAlignment alignment; 333 333 334 if (m_frame->editor() ->behavior().shouldCenterAlignWhenSelectionIsRevealed())334 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsRevealed()) 335 335 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; 336 336 else … … 587 587 VisiblePosition positionAfterCurrentWord = nextWordPosition(originalPosition); 588 588 589 if (m_frame && m_frame->editor() ->behavior().shouldSkipSpaceWhenMovingRight()) {589 if (m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight()) { 590 590 // In order to skip spaces when moving right, we advance one 591 591 // word further and then move one word back. Given the … … 714 714 // Visual word movement relies on isWordTextBreak which is not implemented in WinCE and QT. 715 715 // 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(); 717 717 pos = rightWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight); 718 718 break; … … 888 888 case WordGranularity: { 889 889 #if USE(ICU_UNICODE) 890 bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor() ->behavior().shouldSkipSpaceWhenMovingRight();890 bool skipsSpaceWhenMovingRight = m_frame && m_frame->editor().behavior().shouldSkipSpaceWhenMovingRight(); 891 891 pos = leftWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()), skipsSpaceWhenMovingRight); 892 892 break; … … 1025 1025 if (!m_selection.isCaret() 1026 1026 && (granularity == WordGranularity || granularity == ParagraphGranularity || granularity == LineGranularity) 1027 && m_frame && !m_frame->editor() ->behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) {1027 && m_frame && !m_frame->editor().behavior().shouldExtendSelectionByWordOrLineAcrossCaret()) { 1028 1028 // Don't let the selection go across the base position directly. Needed to match mac 1029 1029 // behavior when, for instance, word-selecting backwards starting with the caret in … … 1038 1038 // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the 1039 1039 // 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)) 1041 1041 setExtent(position, userTriggered); 1042 1042 else { … … 1750 1750 inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame) 1751 1751 { 1752 return frame->editor() ->lastEditCommand() && frame->editor()->lastEditCommand()->shouldStopCaretBlinking();1752 return frame->editor().lastEditCommand() && frame->editor().lastEditCommand()->shouldStopCaretBlinking(); 1753 1753 } 1754 1754 … … 1929 1929 bool FrameSelection::shouldDeleteSelection(const VisibleSelection& selection) const 1930 1930 { 1931 return m_frame->editor() ->client()->shouldDeleteRange(selection.toNormalizedRange().get());1931 return m_frame->editor().client()->shouldDeleteRange(selection.toNormalizedRange().get()); 1932 1932 } 1933 1933 … … 2048 2048 bool FrameSelection::shouldChangeSelection(const VisibleSelection& newSelection) const 2049 2049 { 2050 return m_frame->editor() ->shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);2050 return m_frame->editor().shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false); 2051 2051 } 2052 2052 -
trunk/Source/WebCore/editing/InsertTextCommand.cpp
r146999 r150140 148 148 if (endingSelection().isNone()) 149 149 return; 150 } else if (document()->frame()->editor() ->isOverwriteModeEnabled()) {150 } else if (document()->frame()->editor().isOverwriteModeEnabled()) { 151 151 if (performOverwrite(m_text, m_selectInsertedText)) 152 152 return; -
trunk/Source/WebCore/editing/SpellChecker.cpp
r148545 r150140 213 213 } 214 214 215 m_frame->editor() ->markAndReplaceFor(m_processingRequest, results);215 m_frame->editor().markAndReplaceFor(m_processingRequest, results); 216 216 217 217 if (m_lastProcessedSequence < sequence) -
trunk/Source/WebCore/editing/SpellingCorrectionCommand.cpp
r148545 r150140 64 64 { 65 65 if (!m_hasBeenUndone) { 66 document()->frame()->editor() ->unappliedSpellCorrection(startingSelection(), m_corrected, m_correction);66 document()->frame()->editor().unappliedSpellCorrection(startingSelection(), m_corrected, m_correction); 67 67 m_hasBeenUndone = true; 68 68 } -
trunk/Source/WebCore/editing/TypingCommand.cpp
r148306 r150140 162 162 163 163 if (!text.isEmpty()) 164 document->frame()->editor() ->updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0]));164 document->frame()->editor().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text.characters()[0])); 165 165 166 166 insertText(document, text, frame->selection()->selection(), options, composition); … … 238 238 ASSERT(frame); 239 239 240 RefPtr<CompositeEditCommand> lastEditCommand = frame->editor() ->lastEditCommand();240 RefPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand(); 241 241 if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand.get())->isOpenForMoreTyping()) 242 242 return 0; … … 299 299 300 300 #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; 307 307 #else 308 if (!frame->editor() ->isContinuousSpellCheckingEnabled())308 if (!frame->editor().isContinuousSpellCheckingEnabled()) 309 309 return; 310 310 #endif … … 323 323 if (range && (commandType == TypingCommand::InsertText || commandType == TypingCommand::InsertLineBreak || commandType == TypingCommand::InsertParagraphSeparator || commandType == TypingCommand::InsertParagraphSeparatorInQuotedContent)) 324 324 strippedPreviousWord = plainText(range.get()).stripWhiteSpace(); 325 frame->editor() ->markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty());325 frame->editor().markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty()); 326 326 } else if (commandType == TypingCommand::InsertText) 327 frame->editor() ->startAlternativeTextUITimer();327 frame->editor().startAlternativeTextUITimer(); 328 328 } 329 329 } … … 338 338 339 339 #if PLATFORM(MAC) 340 frame->editor() ->appliedEditing(this);340 frame->editor().appliedEditing(this); 341 341 // Since the spellchecking code may also perform corrections and other replacements, it should happen after the typing changes. 342 342 if (!m_shouldPreventSpellChecking) … … 345 345 // The old spellchecking code requires that checking be done first, to prevent issues like that in 6864072, where <doesn't> is marked as misspelled. 346 346 markMisspellingsAfterTyping(commandTypeForAddedTyping); 347 frame->editor() ->appliedEditing(this);347 frame->editor().appliedEditing(this); 348 348 #endif 349 349 } … … 428 428 return; 429 429 430 frame->editor() ->updateMarkersForWordsAffectedByEditing(false);430 frame->editor().updateMarkersForWordsAffectedByEditing(false); 431 431 432 432 VisibleSelection selectionToDelete; … … 515 515 516 516 if (killRing) 517 frame->editor() ->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);517 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(), false); 518 518 // Make undo select everything that has been deleted, unless an undo will undo more than just this deletion. 519 519 // FIXME: This behaves like TextEdit except for the case where you open with text insertion and then delete … … 532 532 return; 533 533 534 frame->editor() ->updateMarkersForWordsAffectedByEditing(false);534 frame->editor().updateMarkersForWordsAffectedByEditing(false); 535 535 536 536 VisibleSelection selectionToDelete; … … 608 608 609 609 if (killRing) 610 frame->editor() ->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);610 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(), false); 611 611 // make undo select what was deleted 612 612 setStartingSelection(selectionAfterUndo); -
trunk/Source/WebCore/editing/htmlediting.cpp
r145818 r150140 856 856 PassRefPtr<HTMLElement> createDefaultParagraphElement(Document* document) 857 857 { 858 switch (document->frame()->editor() ->defaultParagraphSeparator()) {858 switch (document->frame()->editor().defaultParagraphSeparator()) { 859 859 case EditorParagraphSeparatorIsDiv: 860 860 return HTMLDivElement::create(document); -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r150129 r150140 83 83 bool choosePlainText; 84 84 85 m_frame->editor() ->client()->setInsertionPasteboard(NSGeneralPboard);85 m_frame->editor().client()->setInsertionPasteboard(NSGeneralPboard); 86 86 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 87 87 RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText); … … 103 103 } 104 104 #endif 105 m_frame->editor() ->client()->setInsertionPasteboard(String());105 m_frame->editor().client()->setInsertionPasteboard(String()); 106 106 } 107 107 -
trunk/Source/WebCore/editing/markup.cpp
r148854 r150140 656 656 RefPtr<Range> updatedRangeRef; 657 657 if (frame) { 658 updatedRangeRef = frame->editor() ->avoidIntersectionWithDeleteButtonController(range);658 updatedRangeRef = frame->editor().avoidIntersectionWithDeleteButtonController(range); 659 659 updatedRange = updatedRangeRef.get(); 660 660 if (!updatedRange) … … 770 770 #if ENABLE(DELETION_UI) 771 771 if (Frame* frame = node->document()->frame()) { 772 deleteButtonContainerElement = frame->editor() ->deleteButtonController()->containerElement();772 deleteButtonContainerElement = frame->editor().deleteButtonController()->containerElement(); 773 773 if (node->isDescendantOf(deleteButtonContainerElement)) 774 774 return ""; -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r149392 r150140 431 431 432 432 if (Frame* frame = document()->frame()) 433 frame->editor() ->textFieldDidEndEditing(this);433 frame->editor().textFieldDidEndEditing(this); 434 434 } 435 435 -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r148545 r150140 284 284 285 285 if (Frame* frame = document()->frame()) 286 frame->editor() ->textDidChangeInTextArea(this);286 frame->editor().textDidChangeInTextArea(this); 287 287 // When typing in a textarea, childrenChanged is not called, so we need to force the directionality check. 288 288 calculateAndAdjustDirectionality(); -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r149015 r150140 147 147 return; 148 148 Frame* frame = element()->document()->frame(); 149 if (!frame || !frame->editor() ->doTextFieldCommandFromEvent(element(), event))149 if (!frame || !frame->editor().doTextFieldCommandFromEvent(element(), event)) 150 150 return; 151 151 event->setDefaultHandled(); … … 474 474 if (Frame* frame = element()->document()->frame()) { 475 475 if (state == ValueChangeStateNone) 476 frame->editor() ->textFieldDidBeginEditing(element());477 frame->editor() ->textDidChangeInTextField(element());476 frame->editor().textFieldDidBeginEditing(element()); 477 frame->editor().textDidChangeInTextField(element()); 478 478 } 479 479 } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r150104 r150140 483 483 stopLoading(currentDocument && !currentDocument->inPageCache() ? UnloadEventPolicyUnloadAndPageHide : UnloadEventPolicyUnloadOnly); 484 484 485 m_frame->editor() ->clearUndoRedoOperations();485 m_frame->editor().clearUndoRedoOperations(); 486 486 return true; 487 487 } … … 496 496 497 497 m_frame->navigationScheduler()->cancel(); 498 m_frame->editor() ->clearLastEditCommand();498 m_frame->editor().clearLastEditCommand(); 499 499 500 500 m_isComplete = false; … … 545 545 void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView) 546 546 { 547 m_frame->editor() ->clear();547 m_frame->editor().clear(); 548 548 549 549 if (!m_needsClear) -
trunk/Source/WebCore/page/ContextMenuController.cpp
r147710 r150140 198 198 { 199 199 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)) 201 201 return; 202 202 … … 233 233 break; 234 234 case ContextMenuItemTagCopyLinkToClipboard: 235 frame->editor() ->copyURL(m_hitTestResult.absoluteLinkURL(), m_hitTestResult.textContent());235 frame->editor().copyURL(m_hitTestResult.absoluteLinkURL(), m_hitTestResult.textContent()); 236 236 break; 237 237 case ContextMenuItemTagOpenImageInNewWindow: … … 245 245 // FIXME: The Pasteboard class is not written yet 246 246 // For now, call into the client. This is temporary! 247 frame->editor() ->copyImage(m_hitTestResult);247 frame->editor().copyImage(m_hitTestResult); 248 248 break; 249 249 #if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) 250 250 case ContextMenuItemTagCopyImageUrlToClipboard: 251 frame->editor() ->copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent());251 frame->editor().copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent()); 252 252 break; 253 253 #endif … … 256 256 break; 257 257 case ContextMenuItemTagCopyMediaLinkToClipboard: 258 frame->editor() ->copyURL(m_hitTestResult.absoluteMediaURL(), m_hitTestResult.textContent());258 frame->editor().copyURL(m_hitTestResult.absoluteMediaURL(), m_hitTestResult.textContent()); 259 259 break; 260 260 case ContextMenuItemTagToggleMediaControls: … … 282 282 } 283 283 case ContextMenuItemTagCopy: 284 frame->editor() ->copy();284 frame->editor().copy(); 285 285 break; 286 286 case ContextMenuItemTagGoBack: … … 299 299 break; 300 300 case ContextMenuItemTagCut: 301 frame->editor() ->command("Cut").execute();301 frame->editor().command("Cut").execute(); 302 302 break; 303 303 case ContextMenuItemTagPaste: 304 frame->editor() ->command("Paste").execute();304 frame->editor().command("Paste").execute(); 305 305 break; 306 306 #if PLATFORM(GTK) 307 307 case ContextMenuItemTagDelete: 308 frame->editor() ->performDelete();308 frame->editor().performDelete(); 309 309 break; 310 310 case ContextMenuItemTagUnicodeInsertLRMMark: … … 341 341 #if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) 342 342 case ContextMenuItemTagSelectAll: 343 frame->editor() ->command("SelectAll").execute();343 frame->editor().command("SelectAll").execute(); 344 344 break; 345 345 #endif 346 346 case ContextMenuItemTagSpellingGuess: { 347 347 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)) { 349 349 Document* document = frame->document(); 350 350 ReplaceSelectionCommand::CommandOptions replaceOptions = ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting; 351 351 352 if (frame->editor() ->behavior().shouldAllowSpellingSuggestionsWithoutSelection()) {352 if (frame->editor().behavior().shouldAllowSpellingSuggestionsWithoutSelection()) { 353 353 ASSERT(frameSelection->isCaretOrRange()); 354 354 VisibleSelection wordSelection(frameSelection->base()); … … 356 356 frameSelection->setSelection(wordSelection); 357 357 } else { 358 ASSERT(frame->editor() ->selectedText().length());358 ASSERT(frame->editor().selectedText().length()); 359 359 replaceOptions |= ReplaceSelectionCommand::SelectReplacement; 360 360 } … … 367 367 } 368 368 case ContextMenuItemTagIgnoreSpelling: 369 frame->editor() ->ignoreSpelling();369 frame->editor().ignoreSpelling(); 370 370 break; 371 371 case ContextMenuItemTagLearnSpelling: 372 frame->editor() ->learnSpelling();372 frame->editor().learnSpelling(); 373 373 break; 374 374 case ContextMenuItemTagSearchWeb: … … 389 389 break; 390 390 case ContextMenuItemTagBold: 391 frame->editor() ->command("ToggleBold").execute();391 frame->editor().command("ToggleBold").execute(); 392 392 break; 393 393 case ContextMenuItemTagItalic: 394 frame->editor() ->command("ToggleItalic").execute();394 frame->editor().command("ToggleItalic").execute(); 395 395 break; 396 396 case ContextMenuItemTagUnderline: 397 frame->editor() ->toggleUnderline();397 frame->editor().toggleUnderline(); 398 398 break; 399 399 case ContextMenuItemTagOutline: … … 415 415 break; 416 416 case ContextMenuItemTagDefaultDirection: 417 frame->editor() ->setBaseWritingDirection(NaturalWritingDirection);417 frame->editor().setBaseWritingDirection(NaturalWritingDirection); 418 418 break; 419 419 case ContextMenuItemTagLeftToRight: 420 frame->editor() ->setBaseWritingDirection(LeftToRightWritingDirection);420 frame->editor().setBaseWritingDirection(LeftToRightWritingDirection); 421 421 break; 422 422 case ContextMenuItemTagRightToLeft: 423 frame->editor() ->setBaseWritingDirection(RightToLeftWritingDirection);423 frame->editor().setBaseWritingDirection(RightToLeftWritingDirection); 424 424 break; 425 425 case ContextMenuItemTagTextDirectionDefault: 426 frame->editor() ->command("MakeTextWritingDirectionNatural").execute();426 frame->editor().command("MakeTextWritingDirectionNatural").execute(); 427 427 break; 428 428 case ContextMenuItemTagTextDirectionLeftToRight: 429 frame->editor() ->command("MakeTextWritingDirectionLeftToRight").execute();429 frame->editor().command("MakeTextWritingDirectionLeftToRight").execute(); 430 430 break; 431 431 case ContextMenuItemTagTextDirectionRightToLeft: 432 frame->editor() ->command("MakeTextWritingDirectionRightToLeft").execute();432 frame->editor().command("MakeTextWritingDirectionRightToLeft").execute(); 433 433 break; 434 434 #if PLATFORM(MAC) … … 438 438 #endif 439 439 case ContextMenuItemTagShowSpellingPanel: 440 frame->editor() ->showSpellingGuessPanel();440 frame->editor().showSpellingGuessPanel(); 441 441 break; 442 442 case ContextMenuItemTagCheckSpelling: 443 frame->editor() ->advanceToNextMisspelling();443 frame->editor().advanceToNextMisspelling(); 444 444 break; 445 445 case ContextMenuItemTagCheckSpellingWhileTyping: 446 frame->editor() ->toggleContinuousSpellChecking();446 frame->editor().toggleContinuousSpellChecking(); 447 447 break; 448 448 case ContextMenuItemTagCheckGrammarWithSpelling: 449 frame->editor() ->toggleGrammarChecking();449 frame->editor().toggleGrammarChecking(); 450 450 break; 451 451 #if PLATFORM(MAC) 452 452 case ContextMenuItemTagShowFonts: 453 frame->editor() ->showFontPanel();453 frame->editor().showFontPanel(); 454 454 break; 455 455 case ContextMenuItemTagStyles: 456 frame->editor() ->showStylesPanel();456 frame->editor().showStylesPanel(); 457 457 break; 458 458 case ContextMenuItemTagShowColors: 459 frame->editor() ->showColorPanel();459 frame->editor().showColorPanel(); 460 460 break; 461 461 #endif 462 462 #if USE(APPKIT) 463 463 case ContextMenuItemTagMakeUpperCase: 464 frame->editor() ->uppercaseWord();464 frame->editor().uppercaseWord(); 465 465 break; 466 466 case ContextMenuItemTagMakeLowerCase: 467 frame->editor() ->lowercaseWord();467 frame->editor().lowercaseWord(); 468 468 break; 469 469 case ContextMenuItemTagCapitalize: 470 frame->editor() ->capitalizeWord();470 frame->editor().capitalizeWord(); 471 471 break; 472 472 #endif 473 473 #if PLATFORM(MAC) 474 474 case ContextMenuItemTagChangeBack: 475 frame->editor() ->changeBackToReplacedString(m_hitTestResult.replacedString());475 frame->editor().changeBackToReplacedString(m_hitTestResult.replacedString()); 476 476 break; 477 477 #endif 478 478 #if USE(AUTOMATIC_TEXT_REPLACEMENT) 479 479 case ContextMenuItemTagShowSubstitutions: 480 frame->editor() ->showSubstitutionsPanel();480 frame->editor().showSubstitutionsPanel(); 481 481 break; 482 482 case ContextMenuItemTagSmartCopyPaste: 483 frame->editor() ->toggleSmartInsertDelete();483 frame->editor().toggleSmartInsertDelete(); 484 484 break; 485 485 case ContextMenuItemTagSmartQuotes: 486 frame->editor() ->toggleAutomaticQuoteSubstitution();486 frame->editor().toggleAutomaticQuoteSubstitution(); 487 487 break; 488 488 case ContextMenuItemTagSmartDashes: 489 frame->editor() ->toggleAutomaticDashSubstitution();489 frame->editor().toggleAutomaticDashSubstitution(); 490 490 break; 491 491 case ContextMenuItemTagSmartLinks: 492 frame->editor() ->toggleAutomaticLinkDetection();492 frame->editor().toggleAutomaticLinkDetection(); 493 493 break; 494 494 case ContextMenuItemTagTextReplacement: 495 frame->editor() ->toggleAutomaticTextReplacement();495 frame->editor().toggleAutomaticTextReplacement(); 496 496 break; 497 497 case ContextMenuItemTagCorrectSpellingAutomatically: 498 frame->editor() ->toggleAutomaticSpellingCorrection();498 frame->editor().toggleAutomaticSpellingCorrection(); 499 499 break; 500 500 #endif … … 506 506 #endif 507 507 case ContextMenuItemTagDictationAlternative: 508 frame->editor() ->applyDictationAlternativelternative(item->title());508 frame->editor().applyDictationAlternativelternative(item->title()); 509 509 break; 510 510 default: … … 857 857 if (selectionContainsPossibleWord(frame)) { 858 858 #if PLATFORM(MAC) 859 String selectedString = frame->displayStringModifiedByEncoding(frame->editor() ->selectedText());859 String selectedString = frame->displayStringModifiedByEncoding(frame->editor().selectedText()); 860 860 ContextMenuItem LookUpInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary, contextMenuItemTagLookUpInDictionary(selectedString)); 861 861 … … 924 924 if (!inPasswordField) { 925 925 bool haveContextMenuItemsForMisspellingOrGrammer = false; 926 bool spellCheckingEnabled = frame->editor() ->isSpellCheckingEnabledFor(node);926 bool spellCheckingEnabled = frame->editor().isSpellCheckingEnabledFor(node); 927 927 if (spellCheckingEnabled) { 928 928 // Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range … … 930 930 bool misspelling; 931 931 bool badGrammar; 932 Vector<String> guesses = frame->editor() ->guessesForMisspelledOrUngrammatical(misspelling, badGrammar);932 Vector<String> guesses = frame->editor().guessesForMisspelledOrUngrammatical(misspelling, badGrammar); 933 933 if (misspelling || badGrammar) { 934 934 size_t size = guesses.size(); … … 998 998 if (m_hitTestResult.isSelected() && !inPasswordField && selectionContainsPossibleWord(frame)) { 999 999 #if PLATFORM(MAC) 1000 String selectedString = frame->displayStringModifiedByEncoding(frame->editor() ->selectedText());1000 String selectedString = frame->displayStringModifiedByEncoding(frame->editor().selectedText()); 1001 1001 ContextMenuItem LookUpInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary, contextMenuItemTagLookUpInDictionary(selectedString)); 1002 1002 … … 1049 1049 #endif 1050 1050 #if PLATFORM(GTK) 1051 bool shouldShowFontMenu = frame->editor() ->canEditRichly();1051 bool shouldShowFontMenu = frame->editor().canEditRichly(); 1052 1052 #else 1053 1053 bool shouldShowFontMenu = true; … … 1065 1065 #endif 1066 1066 #if PLATFORM(GTK) 1067 EditorClient* client = frame->editor() ->client();1067 EditorClient* client = frame->editor().client(); 1068 1068 if (client && client->shouldShowUnicodeMenu()) { 1069 1069 ContextMenuItem UnicodeMenuItem(SubmenuType, ContextMenuItemTagUnicode, contextMenuItemTagUnicode()); … … 1080 1080 if (Settings* settings = page->settings()) { 1081 1081 bool includeTextDirectionSubmenu = settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAlwaysIncluded 1082 || (settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAutomaticallyIncluded && frame->editor() ->hasBidiSelection());1082 || (settings->textDirectionSubmenuInclusionBehavior() == TextDirectionSubmenuAutomaticallyIncluded && frame->editor().hasBidiSelection()); 1083 1083 if (includeTextDirectionSubmenu) { 1084 1084 ContextMenuItem TextDirectionMenuItem(SubmenuType, ContextMenuItemTagTextDirectionMenu, … … 1141 1141 switch (item.action()) { 1142 1142 case ContextMenuItemTagCheckSpelling: 1143 shouldEnable = frame->editor() ->canEdit();1143 shouldEnable = frame->editor().canEdit(); 1144 1144 break; 1145 1145 case ContextMenuItemTagDefaultDirection: … … 1150 1150 case ContextMenuItemTagRightToLeft: { 1151 1151 String direction = item.action() == ContextMenuItemTagLeftToRight ? "ltr" : "rtl"; 1152 shouldCheck = frame->editor() ->selectionHasStyle(CSSPropertyDirection, direction) != FalseTriState;1152 shouldCheck = frame->editor().selectionHasStyle(CSSPropertyDirection, direction) != FalseTriState; 1153 1153 shouldEnable = true; 1154 1154 break; 1155 1155 } 1156 1156 case ContextMenuItemTagTextDirectionDefault: { 1157 Editor::Command command = frame->editor() ->command("MakeTextWritingDirectionNatural");1157 Editor::Command command = frame->editor().command("MakeTextWritingDirectionNatural"); 1158 1158 shouldCheck = command.state() == TrueTriState; 1159 1159 shouldEnable = command.isEnabled(); … … 1161 1161 } 1162 1162 case ContextMenuItemTagTextDirectionLeftToRight: { 1163 Editor::Command command = frame->editor() ->command("MakeTextWritingDirectionLeftToRight");1163 Editor::Command command = frame->editor().command("MakeTextWritingDirectionLeftToRight"); 1164 1164 shouldCheck = command.state() == TrueTriState; 1165 1165 shouldEnable = command.isEnabled(); … … 1167 1167 } 1168 1168 case ContextMenuItemTagTextDirectionRightToLeft: { 1169 Editor::Command command = frame->editor() ->command("MakeTextWritingDirectionRightToLeft");1169 Editor::Command command = frame->editor().command("MakeTextWritingDirectionRightToLeft"); 1170 1170 shouldCheck = command.state() == TrueTriState; 1171 1171 shouldEnable = command.isEnabled(); … … 1173 1173 } 1174 1174 case ContextMenuItemTagCopy: 1175 shouldEnable = frame->editor() ->canDHTMLCopy() || frame->editor()->canCopy();1175 shouldEnable = frame->editor().canDHTMLCopy() || frame->editor().canCopy(); 1176 1176 break; 1177 1177 case ContextMenuItemTagCut: 1178 shouldEnable = frame->editor() ->canDHTMLCut() || frame->editor()->canCut();1178 shouldEnable = frame->editor().canDHTMLCut() || frame->editor().canCut(); 1179 1179 break; 1180 1180 case ContextMenuItemTagIgnoreSpelling: … … 1183 1183 break; 1184 1184 case ContextMenuItemTagPaste: 1185 shouldEnable = frame->editor() ->canDHTMLPaste() || frame->editor()->canPaste();1185 shouldEnable = frame->editor().canDHTMLPaste() || frame->editor().canPaste(); 1186 1186 break; 1187 1187 #if PLATFORM(GTK) 1188 1188 case ContextMenuItemTagDelete: 1189 shouldEnable = frame->editor() ->canDelete();1189 shouldEnable = frame->editor().canDelete(); 1190 1190 break; 1191 1191 case ContextMenuItemTagInputMethods: … … 1210 1210 #endif 1211 1211 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(); 1214 1214 break; 1215 1215 } … … 1218 1218 break; 1219 1219 case ContextMenuItemTagCheckGrammarWithSpelling: 1220 if (frame->editor() ->isGrammarCheckingEnabled())1220 if (frame->editor().isGrammarCheckingEnabled()) 1221 1221 shouldCheck = true; 1222 1222 shouldEnable = true; 1223 1223 break; 1224 1224 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(); 1227 1227 break; 1228 1228 } 1229 1229 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(); 1232 1232 break; 1233 1233 } … … 1236 1236 break; 1237 1237 case ContextMenuItemTagShowSpellingPanel: 1238 if (frame->editor() ->spellingPanelIsShowing())1238 if (frame->editor().spellingPanelIsShowing()) 1239 1239 item.setTitle(contextMenuItemTagShowSpellingPanel(false)); 1240 1240 else 1241 1241 item.setTitle(contextMenuItemTagShowSpellingPanel(true)); 1242 shouldEnable = frame->editor() ->canEdit();1242 shouldEnable = frame->editor().canEdit(); 1243 1243 break; 1244 1244 case ContextMenuItemTagNoGuessesFound: … … 1246 1246 break; 1247 1247 case ContextMenuItemTagCheckSpellingWhileTyping: 1248 shouldCheck = frame->editor() ->isContinuousSpellCheckingEnabled();1248 shouldCheck = frame->editor().isContinuousSpellCheckingEnabled(); 1249 1249 break; 1250 1250 #if PLATFORM(MAC) … … 1253 1253 break; 1254 1254 case ContextMenuItemTagShowSubstitutions: 1255 if (frame->editor() ->substitutionsPanelIsShowing())1255 if (frame->editor().substitutionsPanelIsShowing()) 1256 1256 item.setTitle(contextMenuItemTagShowSubstitutions(false)); 1257 1257 else 1258 1258 item.setTitle(contextMenuItemTagShowSubstitutions(true)); 1259 shouldEnable = frame->editor() ->canEdit();1259 shouldEnable = frame->editor().canEdit(); 1260 1260 break; 1261 1261 case ContextMenuItemTagMakeUpperCase: … … 1263 1263 case ContextMenuItemTagCapitalize: 1264 1264 case ContextMenuItemTagChangeBack: 1265 shouldEnable = frame->editor() ->canEdit();1265 shouldEnable = frame->editor().canEdit(); 1266 1266 break; 1267 1267 case ContextMenuItemTagCorrectSpellingAutomatically: 1268 shouldCheck = frame->editor() ->isAutomaticSpellingCorrectionEnabled();1268 shouldCheck = frame->editor().isAutomaticSpellingCorrectionEnabled(); 1269 1269 break; 1270 1270 case ContextMenuItemTagSmartCopyPaste: 1271 shouldCheck = frame->editor() ->smartInsertDeleteEnabled();1271 shouldCheck = frame->editor().smartInsertDeleteEnabled(); 1272 1272 break; 1273 1273 case ContextMenuItemTagSmartQuotes: 1274 shouldCheck = frame->editor() ->isAutomaticQuoteSubstitutionEnabled();1274 shouldCheck = frame->editor().isAutomaticQuoteSubstitutionEnabled(); 1275 1275 break; 1276 1276 case ContextMenuItemTagSmartDashes: 1277 shouldCheck = frame->editor() ->isAutomaticDashSubstitutionEnabled();1277 shouldCheck = frame->editor().isAutomaticDashSubstitutionEnabled(); 1278 1278 break; 1279 1279 case ContextMenuItemTagSmartLinks: 1280 shouldCheck = frame->editor() ->isAutomaticLinkDetectionEnabled();1280 shouldCheck = frame->editor().isAutomaticLinkDetectionEnabled(); 1281 1281 break; 1282 1282 case ContextMenuItemTagTextReplacement: 1283 shouldCheck = frame->editor() ->isAutomaticTextReplacementEnabled();1283 shouldCheck = frame->editor().isAutomaticTextReplacementEnabled(); 1284 1284 break; 1285 1285 case ContextMenuItemTagStopSpeaking: … … 1304 1304 break; 1305 1305 case ContextMenuItemTagFontMenu: 1306 shouldEnable = frame->editor() ->canEditRichly();1306 shouldEnable = frame->editor().canEditRichly(); 1307 1307 break; 1308 1308 #else -
trunk/Source/WebCore/page/DOMWindow.cpp
r150045 r150140 1114 1114 1115 1115 // 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); 1117 1117 } 1118 1118 -
trunk/Source/WebCore/page/DragController.cpp
r148395 r150140 442 442 ASSERT(m_page->dragCaretController()->hasCaret()); 443 443 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()); 445 445 return target->dispatchEvent(TextEvent::createForDrop(innerFrame->document()->domWindow(), text), IGNORE_EXCEPTION); 446 446 } … … 476 476 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); 477 477 style->setProperty(CSSPropertyColor, color.serialized(), false); 478 if (!innerFrame->editor() ->shouldApplyStyle(style.get(), innerRange.get()))478 if (!innerFrame->editor().shouldApplyStyle(style.get(), innerRange.get())) 479 479 return false; 480 480 m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData); 481 innerFrame->editor() ->applyStyle(style.get(), EditActionSetColor);481 innerFrame->editor().applyStyle(style.get(), EditActionSetColor); 482 482 return true; 483 483 } … … 512 512 bool chosePlainText = false; 513 513 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)) { 515 515 return false; 516 516 } … … 520 520 // NSTextView behavior is to always smart delete on moving a selection, 521 521 // but only to smart insert if the selection granularity is word granularity. 522 bool smartDelete = innerFrame->editor() ->smartInsertDeleteEnabled();522 bool smartDelete = innerFrame->editor().smartInsertDeleteEnabled(); 523 523 bool smartInsert = smartDelete && innerFrame->selection()->granularity() == WordGranularity && dragData->canSmartReplace(); 524 524 applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartInsert, smartDelete)); … … 535 535 } else { 536 536 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)) { 538 538 return false; 539 539 } … … 790 790 if (!clipboard->hasData()) { 791 791 if (enclosingTextFormControl(src->selection()->start())) 792 clipboard->writePlainText(src->editor() ->selectedTextForClipboard());792 clipboard->writePlainText(src->editor().selectedTextForClipboard()); 793 793 else { 794 794 RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); -
trunk/Source/WebCore/page/EventHandler.cpp
r149382 r150140 504 504 if (m_mouseDownMayStartSelect) { 505 505 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); 507 507 } 508 508 } … … 606 606 } 607 607 608 if (!m_frame->editor() ->behavior().shouldConsiderSelectionAsDirectional() && pos.isNotNull()) {608 if (!m_frame->editor().behavior().shouldConsiderSelectionAsDirectional() && pos.isNotNull()) { 609 609 // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection 610 610 // was created right-to-left … … 1975 1975 Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame(); 1976 1976 // 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(); 1979 1979 1980 1980 return false; … … 2903 2903 MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event); 2904 2904 2905 if (m_frame->editor() ->behavior().shouldSelectOnContextualMenuClick()2905 if (m_frame->editor().behavior().shouldSelectOnContextualMenuClick() 2906 2906 && !m_frame->selection()->contains(viewportPos) 2907 2907 && !mev.scrollbar() … … 2947 2947 if (start.deprecatedNode() && (selection->rootEditableElement() || selection->isRange())) { 2948 2948 RefPtr<Range> selectionRange = selection->toNormalizedRange(); 2949 IntRect firstRect = m_frame->editor() ->firstRectForRange(selectionRange.get());2949 IntRect firstRect = m_frame->editor().firstRectForRange(selectionRange.get()); 2950 2950 2951 2951 int x = rightAligned ? firstRect.maxX() : firstRect.x(); … … 3246 3246 // 1. preventing default handling of keydown and keypress events has no effect on IM input; 3247 3247 // 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()); 3249 3249 3250 3250 bool handledByInputMethod = keydown->defaultHandled(); … … 3353 3353 { 3354 3354 if (event->type() == eventNames().keydownEvent) { 3355 m_frame->editor() ->handleKeyboardEvent(event);3355 m_frame->editor().handleKeyboardEvent(event); 3356 3356 if (event->defaultHandled()) 3357 3357 return; … … 3371 3371 } 3372 3372 if (event->type() == eventNames().keypressEvent) { 3373 m_frame->editor() ->handleKeyboardEvent(event);3373 m_frame->editor().handleKeyboardEvent(event); 3374 3374 if (event->defaultHandled()) 3375 3375 return; … … 3672 3672 void EventHandler::defaultTextInputEventHandler(TextEvent* event) 3673 3673 { 3674 if (m_frame->editor() ->handleTextEvent(event))3674 if (m_frame->editor().handleTextEvent(event)) 3675 3675 event->setDefaultHandled(); 3676 3676 } … … 3705 3705 return; 3706 3706 3707 if (!m_frame->editor() ->behavior().shouldNavigateBackOnBackspace())3707 if (!m_frame->editor().behavior().shouldNavigateBackOnBackspace()) 3708 3708 return; 3709 3709 -
trunk/Source/WebCore/page/FocusController.cpp
r149549 r150140 538 538 return false; 539 539 540 return frame->editor() ->shouldEndEditing(rangeOfContents(root).get());540 return frame->editor().shouldEndEditing(rangeOfContents(root).get()); 541 541 } 542 542 -
trunk/Source/WebCore/page/Frame.cpp
r149780 r150140 745 745 if (previous.isNotNull()) { 746 746 RefPtr<Range> previousCharacterRange = makeRange(previous, position); 747 LayoutRect rect = editor() ->firstRectForRange(previousCharacterRange.get());747 LayoutRect rect = editor().firstRectForRange(previousCharacterRange.get()); 748 748 if (rect.contains(framePoint)) 749 749 return previousCharacterRange.release(); … … 752 752 VisiblePosition next = position.next(); 753 753 if (RefPtr<Range> nextCharacterRange = makeRange(position, next)) { 754 LayoutRect rect = editor() ->firstRectForRange(nextCharacterRange.get());754 LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get()); 755 755 if (rect.contains(framePoint)) 756 756 return nextCharacterRange.release(); -
trunk/Source/WebCore/page/Frame.h
r148921 r150140 114 114 FrameView* view() const; 115 115 116 Editor *editor() const;116 Editor& editor() const; 117 117 EventHandler* eventHandler() const; 118 118 FrameLoader* loader() const; … … 219 219 220 220 OwnPtr<ScriptController> m_script; 221 OwnPtr<Editor> m_editor;221 const OwnPtr<Editor> m_editor; 222 222 OwnPtr<FrameSelection> m_selection; 223 223 OwnPtr<EventHandler> m_eventHandler; … … 290 290 } 291 291 292 inline Editor *Frame::editor() const293 { 294 return m_editor.get();292 inline Editor& Frame::editor() const 293 { 294 return *m_editor; 295 295 } 296 296 -
trunk/Source/WebCore/page/Page.cpp
r149839 r150140 566 566 Frame* startFrame = frame; 567 567 do { 568 if (frame->editor() ->findString(target, (options & ~WrapAround) | StartInSelection)) {568 if (frame->editor().findString(target, (options & ~WrapAround) | StartInSelection)) { 569 569 if (frame != startFrame) 570 570 startFrame->selection()->clear(); … … 578 578 // We cheat a bit and just research with wrap on 579 579 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); 581 581 focusController()->setFocusedFrame(frame); 582 582 return found; … … 595 595 Frame* frameWithSelection = 0; 596 596 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); 598 598 if (frame->selection()->isRange()) 599 599 frameWithSelection = frame; … … 628 628 Frame* startFrame = frame; 629 629 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)) 631 631 return resultRange.release(); 632 632 … … 637 637 // We cheat a bit and just search again with wrap on. 638 638 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)) 640 640 return resultRange.release(); 641 641 } … … 658 658 Frame* frame = mainFrame(); 659 659 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); 662 662 frame = incrementFrame(frame, true, false); 663 663 } while (frame); … … 789 789 790 790 for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) 791 frame->editor() ->deviceScaleFactorChanged();791 frame->editor().deviceScaleFactorChanged(); 792 792 793 793 pageCache()->markPagesForFullStyleRecalc(this); -
trunk/Source/WebCore/page/TouchAdjustment.cpp
r149262 r150140 117 117 if (node->renderer()->canBeSelectionLeaf()) { 118 118 // 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()) 120 120 return true; 121 121 // Only the selected part of the renderer is a valid target, but this will be corrected in … … 158 158 RenderText* textRenderer = static_cast<RenderText*>(textNode->renderer()); 159 159 160 if (textRenderer->frame()->editor() ->behavior().shouldSelectOnContextualMenuClick()) {160 if (textRenderer->frame()->editor().behavior().shouldSelectOnContextualMenuClick()) { 161 161 // Make subtargets out of every word. 162 162 String textValue = textNode->data(); -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp
r146835 r150140 312 312 ASSERT(range); 313 313 314 m_dataObject->setText(frame->editor() ->selectedTextForClipboard());314 m_dataObject->setText(frame->editor().selectedTextForClipboard()); 315 315 m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange, false, ResolveNonLocalURLs)); 316 316 -
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
r148545 r150140 66 66 dataObject->clearAll(); 67 67 68 dataObject->setText(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor() ->selectedTextForClipboard() : frame->editor()->selectedText());68 dataObject->setText(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText()); 69 69 dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs)); 70 70 helper->writeClipboardContents(clipboard, canSmartCopyOrDelete ? PasteboardHelper::IncludeSmartPaste : PasteboardHelper::DoNotIncludeSmartPaste); -
trunk/Source/WebCore/platform/mac/DragDataMac.mm
r113659 r150140 163 163 // Cannot drop other schemes unless <rdar://problem/10562662> and <rdar://problem/11187315> are fixed. 164 164 if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) 165 return [frame->editor() ->client()->canonicalizeURL(URLFromPasteboard) absoluteString];165 return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString]; 166 166 } 167 167 … … 173 173 // FIXME: Should we allow only http family schemes, or anything non-local? 174 174 if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) 175 return [frame->editor() ->client()->canonicalizeURL(URLFromPasteboard) absoluteString];175 return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString]; 176 176 } 177 177 … … 183 183 if ([[NSFileManager defaultManager] fileExistsAtPath:files[0] isDirectory:&isDirectory] && isDirectory) 184 184 return String(); 185 return [frame->editor() ->client()->canonicalizeURL([NSURL fileURLWithPath:files[0]]) absoluteString];185 return [frame->editor().client()->canonicalizeURL([NSURL fileURLWithPath:files[0]]) absoluteString]; 186 186 } 187 187 } -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r150122 r150140 140 140 String Pasteboard::getStringSelection(Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 141 141 { 142 String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor() ->selectedTextForClipboard() : frame->editor()->selectedText();142 String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText(); 143 143 text.replace(noBreakSpace, ' '); 144 144 return text; … … 153 153 } 154 154 155 RefPtr<Range> range = frame->editor() ->selectedRange();155 RefPtr<Range> range = frame->editor().selectedRange(); 156 156 Node* commonAncestor = range->commonAncestorContainer(IGNORE_EXCEPTION); 157 157 ASSERT(commonAncestor); … … 181 181 { 182 182 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())]); 184 184 if (converter) 185 185 attributedString = [converter.get() attributedString]; … … 189 189 Vector<String> clientTypes; 190 190 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); 192 192 types.appendVector(clientTypes); 193 193 194 194 platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName); 195 frame->editor() ->client()->didSetSelectionTypesForPasteboard();195 frame->editor().client()->didSetSelectionTypesForPasteboard(); 196 196 197 197 for (size_t i = 0; i < clientTypes.size(); ++i) … … 242 242 243 243 NSURL *cocoaURL = url; 244 NSString *userVisibleString = frame->editor() ->client()->userVisibleString(cocoaURL);244 NSString *userVisibleString = frame->editor().client()->userVisibleString(cocoaURL); 245 245 246 246 NSString *title = (NSString*)titleStr; … … 381 381 // calling _web_userVisibleString from WebCore involves migrating a sizable web of 382 382 // 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]); 384 384 if ([string length] > 0) 385 385 return [string precomposedStringWithCanonicalMapping]; … … 436 436 437 437 Vector<RefPtr<ArchiveResource> > resources; 438 RefPtr<DocumentFragment> fragment = frame->editor() ->client()->documentFragmentFromAttributedString(string, resources);438 RefPtr<DocumentFragment> fragment = frame->editor().client()->documentFragmentFromAttributedString(string, resources); 439 439 440 440 size_t size = resources.size(); … … 514 514 // Non-image file types; _web_userVisibleString is appropriate here because this will 515 515 // 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]]); 517 517 RefPtr<Node> textNode = frame->document()->createTextNode(url); 518 518 refNodesVector.append(textNode.get()); -
trunk/Source/WebCore/platform/qt/ClipboardQt.cpp
r148545 r150140 314 314 if (!m_writableData) 315 315 m_writableData = new QMimeData; 316 QString text = frame->editor() ->selectedTextForClipboard();316 QString text = frame->editor().selectedTextForClipboard(); 317 317 text.replace(QChar(0xa0), QLatin1Char(' ')); 318 318 m_writableData->setText(text); -
trunk/Source/WebCore/platform/qt/PasteboardQt.cpp
r146835 r150140 63 63 { 64 64 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(); 66 66 text.replace(QChar(0xa0), QLatin1Char(' ')); 67 67 md->setText(text); -
trunk/Source/WebCore/platform/win/ClipboardWin.cpp
r149280 r150140 752 752 ::GlobalFree(medium.hGlobal); 753 753 754 String str = frame->editor() ->selectedTextForClipboard();754 String str = frame->editor().selectedTextForClipboard(); 755 755 replaceNewlinesWithWindowsStyleNewlines(str); 756 756 replaceNBSPWithSpace(str); … … 760 760 761 761 medium.hGlobal = 0; 762 if (frame->editor() ->canSmartCopyOrDelete())762 if (frame->editor().canSmartCopyOrDelete()) 763 763 m_writableDataObject->SetData(smartPasteFormat(), &medium, TRUE); 764 764 } -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r148549 r150140 131 131 132 132 // 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(); 134 134 replaceNewlinesWithWindowsStyleNewlines(str); 135 135 replaceNBSPWithSpace(str); -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r148545 r150140 641 641 return Vector<String>(); 642 642 643 return frame->editor() ->dictationAlternativesForMarker(marker);643 return frame->editor().dictationAlternativesForMarker(marker); 644 644 } 645 645 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r150065 r150140 549 549 550 550 // 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(); 553 553 554 554 // Determine the text colors and selection colors. … … 658 658 if (containsComposition && !useCustomUnderlines) 659 659 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()); 662 662 663 663 paintDocumentMarkers(context, boxOrigin, styleToUse, font, true); … … 786 786 787 787 if (useCustomUnderlines) { 788 const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor() ->customCompositionUnderlines();788 const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor().customCompositionUnderlines(); 789 789 size_t numUnderlines = underlines.size(); 790 790 … … 1360 1360 1361 1361 // Optionally highlight the text 1362 if (renderer()->frame()->editor() ->markedTextMatchesAreHighlighted()) {1362 if (renderer()->frame()->editor().markedTextMatchesAreHighlighted()) { 1363 1363 Color color = marker->activeMatch() ? 1364 1364 renderer()->theme()->platformActiveTextSearchHighlightColor() : -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r150084 r150140 5287 5287 } 5288 5288 5289 bool moveCaretToBoundary = document()->frame()->editor() ->behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom();5289 bool moveCaretToBoundary = document()->frame()->editor().behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom(); 5290 5290 5291 5291 if (!moveCaretToBoundary && !closestBox && lastRootBoxWithChildren) { -
trunk/Source/WebCore/testing/Internals.cpp
r150041 r150140 237 237 static SpellChecker* spellchecker(Document* document) 238 238 { 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(); 243 243 } 244 244 … … 285 285 page->group().captionPreferences()->setTestingMode(false); 286 286 #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(); 291 291 } 292 292 … … 1427 1427 return 0; 1428 1428 1429 return document->frame()->editor() ->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);1429 return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); 1430 1430 } 1431 1431 … … 1435 1435 return 0; 1436 1436 1437 return document->frame()->editor() ->selectionStartHasMarkerFor(DocumentMarker::Autocorrected, from, length);1437 return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Autocorrected, from, length); 1438 1438 } 1439 1439 … … 1443 1443 return; 1444 1444 1445 if (enabled != contextDocument()->frame()->editor() ->isContinuousSpellCheckingEnabled())1446 contextDocument()->frame()->editor() ->toggleContinuousSpellChecking();1445 if (enabled != contextDocument()->frame()->editor().isContinuousSpellCheckingEnabled()) 1446 contextDocument()->frame()->editor().toggleContinuousSpellChecking(); 1447 1447 } 1448 1448 … … 1453 1453 1454 1454 #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(); 1457 1457 #else 1458 1458 UNUSED_PARAM(enabled); … … 1466 1466 1467 1467 #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(); 1470 1470 #else 1471 1471 UNUSED_PARAM(enabled); … … 1479 1479 1480 1480 #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(); 1483 1483 #else 1484 1484 UNUSED_PARAM(enabled); … … 1492 1492 1493 1493 #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(); 1496 1496 #else 1497 1497 UNUSED_PARAM(enabled); … … 1505 1505 1506 1506 #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(); 1509 1509 #else 1510 1510 UNUSED_PARAM(enabled); … … 1517 1517 return 0; 1518 1518 1519 return document->frame()->editor() ->isOverwriteModeEnabled();1519 return document->frame()->editor().isOverwriteModeEnabled(); 1520 1520 } 1521 1521 … … 1525 1525 return; 1526 1526 1527 document->frame()->editor() ->toggleOverwriteModeEnabled();1527 document->frame()->editor().toggleOverwriteModeEnabled(); 1528 1528 } 1529 1529 … … 1620 1620 return 0; 1621 1621 1622 return document->frame()->editor() ->selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);1622 return document->frame()->editor().selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length); 1623 1623 } 1624 1624 -
trunk/Source/WebKit/blackberry/ChangeLog
r150104 r150140 1 2013-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 1 19 2013-05-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 20 -
trunk/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
r148736 r150140 116 116 117 117 // Check if the node disables spell checking directly. 118 return frame->editor() ->isSpellCheckingEnabledInFocusedNode();118 return frame->editor().isSpellCheckingEnabledInFocusedNode(); 119 119 } 120 120 … … 470 470 471 471 // 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())); 473 473 474 474 if (!commandName.isEmpty()) { … … 477 477 m_webPagePrivate->m_inputHandler->setProcessingChange(false); 478 478 479 if (frame->editor() ->command(commandName).execute())479 if (frame->editor().command(commandName).execute()) 480 480 event->setDefaultHandled(); 481 481 return; 482 482 } 483 483 484 if (!frame->editor() ->canEdit())484 if (!frame->editor().canEdit()) 485 485 return; 486 486 … … 502 502 503 503 if (!platformEvent->text().isEmpty()) { 504 if (frame->editor() ->insertText(platformEvent->text(), event))504 if (frame->editor().insertText(platformEvent->text(), event)) 505 505 event->setDefaultHandled(); 506 506 } -
trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
r149811 r150140 267 267 bool elementHasContinuousSpellCheckingEnabled(const PassRefPtr<WebCore::Element> element) 268 268 { 269 return element && element->document()->frame() && element->document()->frame()->editor() ->isContinuousSpellCheckingEnabled();269 return element && element->document()->frame() && element->document()->frame()->editor().isContinuousSpellCheckingEnabled(); 270 270 } 271 271 -
trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp
r148762 r150140 181 181 bool InPageSearchManager::findAndMarkText(const String& text, Range* range, Frame* frame, const FindOptions& options, bool isNewSearch, bool startFromSelection) 182 182 { 183 if (RefPtr<Range> match = frame->editor() ->findStringAndScrollToVisible(text, range, options)) {183 if (RefPtr<Range> match = frame->editor().findStringAndScrollToVisible(text, range, options)) { 184 184 // Move the highlight to the new match. 185 185 setActiveMatchAndMarker(match); … … 191 191 // No need to unmarkAllTextMatches, it is already done from the caller because of newSearch 192 192 m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true); 193 frame->editor() ->setMarkedTextMatchesAreHighlighted(true /* highlight */);193 frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */); 194 194 } 195 195 return true; … … 224 224 m_webPage->m_page->unmarkAllTextMatches(); 225 225 m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true); 226 frame->editor() ->setMarkedTextMatchesAreHighlighted(true /* highlight */);226 frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */); 227 227 } 228 228 … … 357 357 } else { 358 358 if (m_highlightAllMatches) 359 scopingFrame->editor() ->setMarkedTextMatchesAreHighlighted(true /* highlight */);359 scopingFrame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */); 360 360 m_activeMatchCount += matchCount; 361 361 m_webPage->m_client->updateFindStringResult(m_activeMatchCount, m_activeMatchIndex); -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r149826 r150140 106 106 BlackBerry::Platform::String SelectionHandler::selectedText() const 107 107 { 108 return m_webPage->focusedOrMainFrame()->editor() ->selectedText();108 return m_webPage->focusedOrMainFrame()->editor().selectedText(); 109 109 } 110 110 -
trunk/Source/WebKit/efl/ChangeLog
r150041 r150140 1 2013-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 1 25 2013-05-12 Timothy Hatcher <timothy@apple.com> 2 26 -
trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
r149980 r150140 292 292 DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page); 293 293 294 page->focusController()->focusedOrMainFrame()->editor() ->command(name).execute(value);294 page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value); 295 295 } 296 296 … … 329 329 DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false); 330 330 331 return page->focusController()->focusedOrMainFrame()->editor() ->command(name).isEnabled();331 return page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled(); 332 332 } 333 333 … … 551 551 return; 552 552 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()) 555 555 return; 556 556 … … 558 558 Vector<WebCore::CompositionUnderline> underlines; 559 559 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); 561 561 } 562 562 … … 568 568 return false; 569 569 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(); 575 571 } 576 572 … … 584 580 return false; 585 581 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()) 588 584 return false; 589 585 590 *start = editor ->compositionStart();591 *length = editor ->compositionEnd() - *start;586 *start = editor.compositionStart(); 587 *length = editor.compositionEnd() - *start; 592 588 return true; 593 589 } … … 600 596 return; 601 597 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); 608 602 return; 609 603 } 610 604 611 605 if (text) { 612 editor ->confirmComposition(String::fromUTF8(text));606 editor.confirmComposition(String::fromUTF8(text)); 613 607 return; 614 608 } 615 editor ->confirmComposition();609 editor.confirmComposition(); 616 610 } 617 611 … … 620 614 DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, WebCore::IntRect()); 621 615 622 if (!page->focusController() || !page->focusController()->focusedOrMainFrame() || !page->focusController()->focusedOrMainFrame()->editor())616 if (!page->focusController() || !page->focusController()->focusedOrMainFrame()) 623 617 return WebCore::IntRect(); 624 618 … … 627 621 628 622 WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); 629 WebCore::Editor* editor = frame->editor();630 623 631 624 RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length); … … 633 626 return WebCore::IntRect(); 634 627 635 return editor->firstRectForRange(range.get());628 return frame->editor().firstRectForRange(range.get()); 636 629 } 637 630 -
trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
r148381 r150140 143 143 return; 144 144 145 if (coreFrame->editor() && coreFrame->editor()->ignoreCompositionSelectionChange())145 if (coreFrame->editor().ignoreCompositionSelectionChange()) 146 146 return; 147 147 … … 149 149 ewk_frame_editor_client_selection_changed(webFrame); 150 150 151 coreFrame->editor() ->cancelCompositionIfSelectionIsInvalid();151 coreFrame->editor().cancelCompositionIfSelectionIsInvalid(); 152 152 } 153 153 … … 325 325 } 326 326 327 Editor::Command command = frame->editor() ->command(interpretKeyEvent(event));327 Editor::Command command = frame->editor().command(interpretKeyEvent(event)); 328 328 329 329 if (keyEvent->type() == PlatformEvent::RawKeyDown) { … … 338 338 339 339 // Don't allow text insertion for nodes that cannot edit. 340 if (!frame->editor() ->canEdit())340 if (!frame->editor().canEdit()) 341 341 return false; 342 342 … … 349 349 return false; 350 350 351 return frame->editor() ->insertText(event->keyEvent()->text(), event);351 return frame->editor().insertText(event->keyEvent()->text(), event); 352 352 } 353 353 -
trunk/Source/WebKit/efl/ewk/ewk_frame.cpp
r148557 r150140 481 481 smartData->editable = editable; 482 482 if (editable) 483 smartData->frame->editor() ->applyEditingStyleToBodyElement();483 smartData->frame->editor().applyEditingStyleToBodyElement(); 484 484 return true; 485 485 } … … 489 489 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0); 490 490 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(); 492 492 if (selectedText.isNull()) 493 493 return 0; … … 501 501 EINA_SAFETY_ON_NULL_RETURN_VAL(text, false); 502 502 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); 504 504 } 505 505 … … 510 510 EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); 511 511 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); 514 514 } 515 515 … … 527 527 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); 528 528 EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); 529 smartData->frame->editor() ->setMarkedTextMatchesAreHighlighted(highlight);529 smartData->frame->editor().setMarkedTextMatchesAreHighlighted(highlight); 530 530 return true; 531 531 } … … 535 535 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); 536 536 EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); 537 return smartData->frame->editor() ->markedTextMatchesAreHighlighted();537 return smartData->frame->editor().markedTextMatchesAreHighlighted(); 538 538 } 539 539 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r149980 r150140 1669 1669 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); 1670 1670 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(); 1672 1672 if (selectedString.isNull()) 1673 1673 return 0; … … 1684 1684 return false; 1685 1685 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)); 1687 1687 } 1688 1688 … … 4103 4103 return; 4104 4104 4105 WebCore::Editor *editor = focusedFrame->editor();4106 if (!editor ->canEdit())4105 WebCore::Editor& editor = focusedFrame->editor(); 4106 if (!editor.canEdit()) 4107 4107 return; 4108 4108 4109 editor ->setBaseWritingDirection(static_cast<WritingDirection>(direction));4109 editor.setBaseWritingDirection(static_cast<WritingDirection>(direction)); 4110 4110 } 4111 4111 -
trunk/Source/WebKit/gtk/ChangeLog
r150074 r150140 1 2013-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 1 43 2013-05-14 Zan Dobersek <zdobersek@igalia.com> 2 44 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r149952 r150140 600 600 // the selection changing. 601 601 Frame* focusedFrame = core(m_webView)->focusController()->focusedOrMainFrame(); 602 if (focusedFrame && focusedFrame->editor() ->canEdit())602 if (focusedFrame && focusedFrame->editor().canEdit()) 603 603 m_webView->priv->imFilter.setCursorRect(frame->selection()->absoluteCaretBounds()); 604 604 } -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r148696 r150140 277 277 g_return_if_fail(value); 278 278 279 core(webView)->focusController()->focusedOrMainFrame()->editor() ->command(name).execute(value);279 core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).execute(value); 280 280 } 281 281 … … 285 285 g_return_val_if_fail(name, FALSE); 286 286 287 return core(webView)->focusController()->focusedOrMainFrame()->editor() ->command(name).isEnabled();287 return core(webView)->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled(); 288 288 } 289 289 … … 297 297 return; 298 298 299 Editor *editor = frame->editor();300 if (!editor || (!editor->canEdit() && !editor->hasComposition()))299 Editor& editor = frame->editor(); 300 if (!editor.canEdit() && !editor.hasComposition()) 301 301 return; 302 302 … … 304 304 Vector<CompositionUnderline> underlines; 305 305 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); 307 307 } 308 308 … … 313 313 if (!frame) 314 314 return false; 315 Editor* editor = frame->editor(); 316 if (!editor) 317 return false; 318 319 return editor->hasComposition(); 315 316 return frame->editor().hasComposition(); 320 317 } 321 318 … … 330 327 return false; 331 328 332 Editor *editor = frame->editor();333 if (!editor || !editor->hasComposition())329 Editor& editor = frame->editor(); 330 if (!editor.hasComposition()) 334 331 return false; 335 332 336 *start = editor ->compositionStart();337 *length = editor ->compositionEnd() - *start;333 *start = editor.compositionStart(); 334 *length = editor.compositionEnd() - *start; 338 335 return true; 339 336 } … … 347 344 return; 348 345 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); 355 350 return; 356 351 } 357 352 if (text) { 358 editor ->confirmComposition(String::fromUTF8(text));353 editor.confirmComposition(String::fromUTF8(text)); 359 354 return; 360 355 } 361 editor ->confirmComposition();356 editor.confirmComposition(); 362 357 } 363 358 … … 369 364 return; 370 365 371 Editor* editor = frame->editor(); 372 if (!editor) 373 return; 366 Editor& editor = frame->editor(); 374 367 375 368 String commandString(command); … … 384 377 commandString.insert(firstChar, 0); 385 378 386 editor ->command(commandString).execute();379 editor.command(commandString).execute(); 387 380 } 388 381 … … 399 392 return false; 400 393 401 Editor* editor = frame->editor(); 402 if (!editor) 403 return false; 394 Editor& editor = frame->editor(); 404 395 405 396 RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length); … … 407 398 return false; 408 399 409 *rect = editor ->firstRectForRange(range.get());400 *rect = editor.firstRectForRange(range.get()); 410 401 return true; 411 402 } -
trunk/Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
r148396 r150140 256 256 #endif 257 257 258 if (frame->editor() ->cancelCompositionIfSelectionIsInvalid())258 if (frame->editor().cancelCompositionIfSelectionIsInvalid()) 259 259 m_webView->priv->imFilter.resetContext(); 260 260 } … … 395 395 Vector<Editor::Command> commands; 396 396 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()); 398 398 if (command.isTextInsertion() && !allowTextInsertion) 399 399 return false; … … 456 456 457 457 // 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())) { 459 459 event->setDefaultHandled(); 460 460 return; … … 464 464 465 465 // Don't allow text insertion for nodes that cannot edit. 466 if (!frame->editor() ->canEdit())466 if (!frame->editor().canEdit()) 467 467 return; 468 468 … … 481 481 return; 482 482 483 if (frame->editor() ->insertText(platformEvent->text(), event))483 if (frame->editor().insertText(platformEvent->text(), event)) 484 484 event->setDefaultHandled(); 485 485 } -
trunk/Source/WebKit/gtk/WebCoreSupport/WebViewInputMethodFilter.cpp
r148558 r150140 52 52 { 53 53 Frame* frame = focusedOrMainFrame(); 54 return frame && frame->editor() ->canEdit();54 return frame && frame->editor().canEdit(); 55 55 } 56 56 … … 77 77 { 78 78 Frame* frame = focusedOrMainFrame(); 79 if (!frame || !frame->editor() ->canEdit())79 if (!frame || !frame->editor().canEdit()) 80 80 return; 81 81 … … 84 84 return; 85 85 } 86 frame->editor() ->confirmComposition(m_confirmedComposition);86 frame->editor().confirmComposition(m_confirmedComposition); 87 87 } 88 88 … … 90 90 { 91 91 Frame* frame = focusedOrMainFrame(); 92 if (!frame || !frame->editor() ->canEdit())92 if (!frame || !frame->editor().canEdit()) 93 93 return; 94 frame->editor() ->confirmComposition();94 frame->editor().confirmComposition(); 95 95 } 96 96 … … 98 98 { 99 99 Frame* frame = focusedOrMainFrame(); 100 if (!frame || !frame->editor() ->canEdit())100 if (!frame || !frame->editor().canEdit()) 101 101 return; 102 frame->editor() ->cancelComposition();102 frame->editor().cancelComposition(); 103 103 } 104 104 … … 106 106 { 107 107 Frame* frame = focusedOrMainFrame(); 108 if (!frame || !frame->editor() ->canEdit())108 if (!frame || !frame->editor().canEdit()) 109 109 return; 110 110 … … 112 112 Vector<CompositionUnderline> underlines; 113 113 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); 115 115 } 116 116 -
trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp
r148552 r150140 1135 1135 bool selectReplacement = false; 1136 1136 bool smartReplace = true; 1137 coreFrame->editor() ->replaceSelectionWithText(text, selectReplacement, smartReplace);1137 coreFrame->editor().replaceSelectionWithText(text, selectReplacement, smartReplace); 1138 1138 } 1139 1139 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r149952 r150140 443 443 // selection->selection().isNonOrphanedCaretOrRange() would have returned false 444 444 // 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()); 446 446 return IntPoint(firstRect.x(), firstRect.maxY()); 447 447 } … … 939 939 focusController->setFocusedFrame(core(webView)->mainFrame()); 940 940 941 if (focusController->focusedFrame()->editor() ->canEdit())941 if (focusController->focusedFrame()->editor().canEdit()) 942 942 webView->priv->imFilter.notifyFocusedIn(); 943 943 return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event); … … 1182 1182 { 1183 1183 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1184 frame->editor() ->command("SelectAll").execute();1184 frame->editor().command("SelectAll").execute(); 1185 1185 } 1186 1186 … … 1188 1188 { 1189 1189 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1190 frame->editor() ->command("Cut").execute();1190 frame->editor().command("Cut").execute(); 1191 1191 } 1192 1192 … … 1194 1194 { 1195 1195 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1196 frame->editor() ->command("Copy").execute();1196 frame->editor().command("Copy").execute(); 1197 1197 } 1198 1198 … … 1200 1200 { 1201 1201 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1202 frame->editor() ->command("Undo").execute();1202 frame->editor().command("Undo").execute(); 1203 1203 } 1204 1204 … … 1206 1206 { 1207 1207 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1208 frame->editor() ->command("Redo").execute();1208 frame->editor().command("Redo").execute(); 1209 1209 } 1210 1210 … … 1265 1265 { 1266 1266 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 1267 frame->editor() ->command("Paste").execute();1267 frame->editor().command("Paste").execute(); 1268 1268 } 1269 1269 … … 4390 4390 Frame *frame = core(webView)->mainFrame(); 4391 4391 do { 4392 frame->editor() ->setMarkedTextMatchesAreHighlighted(shouldHighlight);4392 frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlight); 4393 4393 frame = frame->tree()->traverseNextWithWrap(false); 4394 4394 } while (frame); … … 4460 4460 4461 4461 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 4462 return frame->editor() ->canCut() || frame->editor()->canDHTMLCut();4462 return frame->editor().canCut() || frame->editor().canDHTMLCut(); 4463 4463 } 4464 4464 … … 4476 4476 4477 4477 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 4478 return frame->editor() ->canCopy() || frame->editor()->canDHTMLCopy();4478 return frame->editor().canCopy() || frame->editor().canDHTMLCopy(); 4479 4479 } 4480 4480 … … 4492 4492 4493 4493 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 4494 return frame->editor() ->canPaste() || frame->editor()->canDHTMLPaste();4494 return frame->editor().canPaste() || frame->editor().canDHTMLPaste(); 4495 4495 } 4496 4496 … … 4548 4548 4549 4549 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 4550 frame->editor() ->performDelete();4550 frame->editor().performDelete(); 4551 4551 } 4552 4552 … … 4630 4630 4631 4631 if (flag) { 4632 frame->editor() ->applyEditingStyleToBodyElement();4632 frame->editor().applyEditingStyleToBodyElement(); 4633 4633 // TODO: If the WebKitWebView is made editable and the selection is empty, set it to something. 4634 4634 //if (!webkit_web_view_get_selected_dom_range(webView)) … … 5091 5091 5092 5092 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 5093 return frame->editor() ->canUndo();5093 return frame->editor().canUndo(); 5094 5094 } 5095 5095 … … 5126 5126 5127 5127 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 5128 return frame->editor() ->canRedo();5128 return frame->editor().canRedo(); 5129 5129 } 5130 5130 -
trunk/Source/WebKit/mac/ChangeLog
r150129 r150140 1 2013-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 1 64 2013-05-15 Darin Adler <darin@apple.com> 2 65 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r149998 r150140 494 494 - (NSString *)_selectedString 495 495 { 496 return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->editor() ->selectedText());496 return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->editor().selectedText()); 497 497 } 498 498 … … 603 603 - (NSRect)_firstRectForDOMRange:(DOMRange *)range 604 604 { 605 return _private->coreFrame->editor() ->firstRectForRange(core(range));605 return _private->coreFrame->editor().firstRectForRange(core(range)); 606 606 } 607 607 … … 677 677 - (DOMRange *)_markDOMRange 678 678 { 679 return kit(_private->coreFrame->editor() ->mark().toNormalizedRange().get());679 return kit(_private->coreFrame->editor().mark().toNormalizedRange().get()); 680 680 } 681 681 … … 747 747 return; 748 748 749 _private->coreFrame->editor() ->insertParagraphSeparatorInQuotedContent();749 _private->coreFrame->editor().insertParagraphSeparatorInQuotedContent(); 750 750 } 751 751 … … 776 776 return; 777 777 // 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); 779 779 } 780 780 … … 929 929 if (_private->coreFrame->selection()->isNone() || !fragment) 930 930 return; 931 _private->coreFrame->editor() ->replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle);931 _private->coreFrame->editor().replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle); 932 932 } 933 933 -
trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
r149454 r150140 221 221 WebView *webView = [webFrame webView]; 222 222 if ([webView mainFrame] == webFrame && [webView isEditable]) 223 core(webFrame)->editor() ->applyEditingStyleToBodyElement();223 core(webFrame)->editor().applyEditingStyleToBodyElement(); 224 224 } 225 225 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r149207 r150140 865 865 DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; 866 866 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); 868 868 #else 869 869 // Mail is ignoring the frament passed to the delegate and creates a new one. … … 873 873 DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; 874 874 if (fragment) 875 coreFrame->editor() ->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);875 coreFrame->editor().pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); 876 876 } 877 877 } else { 878 878 DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; 879 879 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); 881 881 } 882 882 #endif … … 984 984 { 985 985 Frame* coreFrame = core([self _frame]); 986 return coreFrame && coreFrame->editor() ->shouldDeleteRange(core(range));986 return coreFrame && coreFrame->editor().shouldDeleteRange(core(range)); 987 987 } 988 988 … … 1759 1759 { 1760 1760 Frame* coreFrame = core([self _frame]); 1761 return coreFrame && coreFrame->editor() ->canEdit();1761 return coreFrame && coreFrame->editor().canEdit(); 1762 1762 } 1763 1763 … … 1765 1765 { 1766 1766 Frame* coreFrame = core([self _frame]); 1767 return coreFrame && coreFrame->editor() ->canEditRichly();1767 return coreFrame && coreFrame->editor().canEditRichly(); 1768 1768 } 1769 1769 … … 1825 1825 { 1826 1826 Frame* coreFrame = core([self _frame]); 1827 return coreFrame ? kit(coreFrame->editor() ->insertOrderedList().get()) : nil;1827 return coreFrame ? kit(coreFrame->editor().insertOrderedList().get()) : nil; 1828 1828 } 1829 1829 … … 1831 1831 { 1832 1832 Frame* coreFrame = core([self _frame]); 1833 return coreFrame ? kit(coreFrame->editor() ->insertUnorderedList().get()) : nil;1833 return coreFrame ? kit(coreFrame->editor().insertUnorderedList().get()) : nil; 1834 1834 } 1835 1835 … … 1837 1837 { 1838 1838 Frame* coreFrame = core([self _frame]); 1839 return coreFrame && coreFrame->editor() ->canIncreaseSelectionListLevel();1839 return coreFrame && coreFrame->editor().canIncreaseSelectionListLevel(); 1840 1840 } 1841 1841 … … 1843 1843 { 1844 1844 Frame* coreFrame = core([self _frame]); 1845 return coreFrame && coreFrame->editor() ->canDecreaseSelectionListLevel();1845 return coreFrame && coreFrame->editor().canDecreaseSelectionListLevel(); 1846 1846 } 1847 1847 … … 1849 1849 { 1850 1850 Frame* coreFrame = core([self _frame]); 1851 return coreFrame ? kit(coreFrame->editor() ->increaseSelectionListLevel().get()) : nil;1851 return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevel().get()) : nil; 1852 1852 } 1853 1853 … … 1855 1855 { 1856 1856 Frame* coreFrame = core([self _frame]); 1857 return coreFrame ? kit(coreFrame->editor() ->increaseSelectionListLevelOrdered().get()) : nil;1857 return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevelOrdered().get()) : nil; 1858 1858 } 1859 1859 … … 1861 1861 { 1862 1862 Frame* coreFrame = core([self _frame]); 1863 return coreFrame ? kit(coreFrame->editor() ->increaseSelectionListLevelUnordered().get()) : nil;1863 return coreFrame ? kit(coreFrame->editor().increaseSelectionListLevelUnordered().get()) : nil; 1864 1864 } 1865 1865 … … 1868 1868 Frame* coreFrame = core([self _frame]); 1869 1869 if (coreFrame) 1870 coreFrame->editor() ->decreaseSelectionListLevel();1870 coreFrame->editor().decreaseSelectionListLevel(); 1871 1871 } 1872 1872 … … 2360 2360 if (!coreFrame) 2361 2361 return Editor::Command(); 2362 return coreFrame->editor() ->command(commandNameForSelector(selector));2362 return coreFrame->editor().command(commandNameForSelector(selector)); 2363 2363 } 2364 2364 … … 2368 2368 if (!coreFrame) 2369 2369 return Editor::Command(); 2370 return coreFrame->editor() ->command(name);2370 return coreFrame->editor().command(name); 2371 2371 } 2372 2372 … … 2594 2594 if ([menuItem isKindOfClass:[NSMenuItem class]]) { 2595 2595 String direction = writingDirection == NSWritingDirectionLeftToRight ? "ltr" : "rtl"; 2596 [menuItem setState:frame->editor() ->selectionHasStyle(CSSPropertyDirection, direction)];2596 [menuItem setState:frame->editor().selectionHasStyle(CSSPropertyDirection, direction)]; 2597 2597 } 2598 2598 return [self _canEdit]; … … 2611 2611 // Take control of the title of the menu item instead of just checking/unchecking it because 2612 2612 // a check would be ambiguous. 2613 [menuItem setTitle:frame->editor() ->selectionHasStyle(CSSPropertyDirection, "rtl")2613 [menuItem setTitle:frame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") 2614 2614 ? UI_STRING_INTERNAL("Left to Right", "Left to Right context menu item") 2615 2615 : UI_STRING_INTERNAL("Right to Left", "Right to Left context menu item")]; … … 2642 2642 2643 2643 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()); 2645 2645 2646 2646 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())); 2649 2649 2650 2650 if (action == @selector(performFindPanelAction:)) … … 3804 3804 3805 3805 // 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); 3807 3807 3808 3808 Page* page = frame->page(); … … 4232 4232 Frame* coreFrame = core([self _frame]); 4233 4233 NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x" 4234 attributes:coreFrame ? coreFrame->editor() ->fontAttributesForSelectionStart() : nil];4234 attributes:coreFrame ? coreFrame->editor().fontAttributesForSelectionStart() : nil]; 4235 4235 NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil]; 4236 4236 [string release]; … … 4360 4360 if (Frame* coreFrame = core([self _frame])) { 4361 4361 // 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); 4363 4363 } 4364 4364 } … … 4662 4662 if (Frame* coreFrame = core([self _frame])) { 4663 4663 // 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]); 4665 4665 } 4666 4666 } … … 4749 4749 4750 4750 if (Frame* coreFrame = core([self _frame])) 4751 coreFrame->editor() ->advanceToNextMisspelling();4751 coreFrame->editor().advanceToNextMisspelling(); 4752 4752 } 4753 4753 … … 4769 4769 4770 4770 if (Frame* coreFrame = core([self _frame])) 4771 coreFrame->editor() ->advanceToNextMisspelling(true);4771 coreFrame->editor().advanceToNextMisspelling(true); 4772 4772 [spellingPanel orderFront:sender]; 4773 4773 } … … 4837 4837 4838 4838 WritingDirection direction = RightToLeftWritingDirection; 4839 switch (coreFrame->editor() ->baseWritingDirectionForSelectionStart()) {4839 switch (coreFrame->editor().baseWritingDirectionForSelectionStart()) { 4840 4840 case LeftToRightWritingDirection: 4841 4841 break; … … 4851 4851 4852 4852 if (Frame* coreFrame = core([self _frame])) 4853 coreFrame->editor() ->setBaseWritingDirection(direction);4853 coreFrame->editor().setBaseWritingDirection(direction); 4854 4854 } 4855 4855 … … 4868 4868 4869 4869 if (Frame* coreFrame = core([self _frame])) 4870 coreFrame->editor() ->setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);4870 coreFrame->editor().setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection); 4871 4871 } 4872 4872 … … 4889 4889 4890 4890 if (Frame* coreFrame = core([self _frame])) 4891 coreFrame->editor() ->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection);4891 coreFrame->editor().setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection); 4892 4892 } 4893 4893 … … 5024 5024 NSFont *font = nil; 5025 5025 if (Frame* coreFrame = core([self _frame])) { 5026 if (const SimpleFontData* fd = coreFrame->editor() ->fontForSelection(multipleFonts))5026 if (const SimpleFontData* fd = coreFrame->editor().fontForSelection(multipleFonts)) 5027 5027 font = fd->getNSFont(); 5028 5028 } … … 5564 5564 if (!coreFrame) 5565 5565 return NSMakeRange(0, 0); 5566 NSRange result = [webFrame _convertToNSRange:coreFrame->editor() ->compositionRange().get()];5566 NSRange result = [webFrame _convertToNSRange:coreFrame->editor().compositionRange().get()]; 5567 5567 5568 5568 LOG(TextInput, "markedRange -> (%u, %u)", result.location, result.length); … … 5608 5608 { 5609 5609 Frame* coreFrame = core([self _frame]); 5610 BOOL result = coreFrame && coreFrame->editor() ->hasComposition();5610 BOOL result = coreFrame && coreFrame->editor().hasComposition(); 5611 5611 5612 5612 if (result) { 5613 5613 // A saved command can confirm a composition, but it cannot start a new one. 5614 5614 [self _executeSavedKeypressCommands]; 5615 result = coreFrame->editor() ->hasComposition();5615 result = coreFrame->editor().hasComposition(); 5616 5616 } 5617 5617 … … 5635 5635 5636 5636 if (Frame* coreFrame = core([self _frame])) 5637 coreFrame->editor() ->confirmComposition();5637 coreFrame->editor().confirmComposition(); 5638 5638 } 5639 5639 … … 5703 5703 [[self _frame] _selectNSRange:replacementRange]; 5704 5704 5705 coreFrame->editor() ->setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange));5705 coreFrame->editor().setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange)); 5706 5706 } 5707 5707 … … 5721 5721 // As in insertText:, we assume that the call comes from an input method if there is marked text. 5722 5722 RefPtr<Frame> coreFrame = core([self _frame]); 5723 bool isFromInputMethod = coreFrame && coreFrame->editor() ->hasComposition();5723 bool isFromInputMethod = coreFrame && coreFrame->editor().hasComposition(); 5724 5724 5725 5725 if (event && shouldSaveCommand && !isFromInputMethod) … … 5775 5775 NSString *text; 5776 5776 NSRange replacementRange = { NSNotFound, 0 }; 5777 bool isFromInputMethod = coreFrame && coreFrame->editor() ->hasComposition();5777 bool isFromInputMethod = coreFrame && coreFrame->editor().hasComposition(); 5778 5778 5779 5779 Vector<DictationAlternative> dictationAlternativeLocations; … … 5811 5811 } 5812 5812 5813 if (!coreFrame || !coreFrame->editor() ->canEdit())5813 if (!coreFrame || !coreFrame->editor().canEdit()) 5814 5814 return; 5815 5815 … … 5820 5820 String eventText = text; 5821 5821 eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore 5822 if (!coreFrame->editor() ->hasComposition()) {5822 if (!coreFrame->editor().hasComposition()) { 5823 5823 // An insertText: might be handled by other responders in the chain if we don't handle it. 5824 5824 // One example is space bar that results in scrolling down the page. 5825 5825 5826 5826 if (!dictationAlternativeLocations.isEmpty()) 5827 eventHandled = coreFrame->editor() ->insertDictatedText(eventText, dictationAlternativeLocations, event);5827 eventHandled = coreFrame->editor().insertDictatedText(eventText, dictationAlternativeLocations, event); 5828 5828 else 5829 eventHandled = coreFrame->editor() ->insertText(eventText, event);5829 eventHandled = coreFrame->editor().insertText(eventText, event); 5830 5830 } else { 5831 5831 eventHandled = true; 5832 coreFrame->editor() ->confirmComposition(eventText);5832 coreFrame->editor().confirmComposition(eventText); 5833 5833 } 5834 5834 … … 5885 5885 [self _updateSecureInputState]; 5886 5886 5887 if (!coreFrame->editor() ->hasComposition() || coreFrame->editor()->ignoreCompositionSelectionChange())5887 if (!coreFrame->editor().hasComposition() || coreFrame->editor().ignoreCompositionSelectionChange()) 5888 5888 return; 5889 5889 5890 5890 unsigned start; 5891 5891 unsigned end; 5892 if (coreFrame->editor() ->getCompositionSelection(start, end))5892 if (coreFrame->editor().getCompositionSelection(start, end)) 5893 5893 [[NSInputManager currentInputManager] markedTextSelectionChanged:NSMakeRange(start, end - start) client:self]; 5894 5894 else { 5895 coreFrame->editor() ->cancelComposition();5895 coreFrame->editor().cancelComposition(); 5896 5896 [[NSInputManager currentInputManager] markedTextAbandoned:self]; 5897 5897 } … … 6061 6061 return 0; 6062 6062 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); 6064 6064 } 6065 6065 … … 6069 6069 if (!coreFrame) 6070 6070 return; 6071 coreFrame->editor() ->setMarkedTextMatchesAreHighlighted(newValue);6071 coreFrame->editor().setMarkedTextMatchesAreHighlighted(newValue); 6072 6072 } 6073 6073 … … 6075 6075 { 6076 6076 Frame* coreFrame = core([self _frame]); 6077 return coreFrame && coreFrame->editor() ->markedTextMatchesAreHighlighted();6077 return coreFrame && coreFrame->editor().markedTextMatchesAreHighlighted(); 6078 6078 } 6079 6079 … … 6111 6111 return NO; 6112 6112 Frame* coreFrame = core([self _frame]); 6113 return coreFrame && coreFrame->editor() ->findString(string, coreOptions(options));6113 return coreFrame && coreFrame->editor().findString(string, coreOptions(options)); 6114 6114 } 6115 6115 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r149922 r150140 2428 2428 if (!coreFrame) 2429 2429 return; 2430 coreFrame->editor() ->command(name).execute(value);2430 coreFrame->editor().command(name).execute(value); 2431 2431 } 2432 2432 … … 5383 5383 if (!page) 5384 5384 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()); 5386 5386 } 5387 5387 … … 5444 5444 if (mainFrame) { 5445 5445 if (flag) { 5446 mainFrame->editor() ->applyEditingStyleToBodyElement();5446 mainFrame->editor().applyEditingStyleToBodyElement(); 5447 5447 // If the WebView is made editable and the selection is empty, set it to something. 5448 5448 if (![self selectedDOMRange]) … … 5731 5731 Frame* coreFrame = core(webFrame); 5732 5732 if (coreFrame) 5733 coreFrame->editor() ->deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]);5733 coreFrame->editor().deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]); 5734 5734 } 5735 5735 … … 5742 5742 // FIXME: We shouldn't have to make a copy here. 5743 5743 if (coreFrame) 5744 coreFrame->editor() ->applyStyle(core(style)->copyProperties().get());5744 coreFrame->editor().applyStyle(core(style)->copyProperties().get()); 5745 5745 } 5746 5746 … … 5789 5789 Frame* coreFrame = core([self _selectedOrMainFrame]); 5790 5790 if (coreFrame) 5791 return coreFrame->editor() ->fontAttributesForSelectionStart();5791 return coreFrame->editor().fontAttributesForSelectionStart(); 5792 5792 5793 5793 return nil; … … 5833 5833 if (coreStartNode->document() != coreFrame->document()) 5834 5834 return; 5835 return coreFrame->editor() ->simplifyMarkup(coreStartNode, core(endNode));5835 return coreFrame->editor().simplifyMarkup(coreStartNode, core(endNode)); 5836 5836 } 5837 5837 … … 6568 6568 Frame* coreFrame = core(webFrame); 6569 6569 if (coreFrame) 6570 coreFrame->editor() ->handleAlternativeTextUIResult(text);6570 coreFrame->editor().handleAlternativeTextUIResult(text); 6571 6571 } 6572 6572 #endif -
trunk/Source/WebKit/qt/ChangeLog
r150120 r150140 1 2013-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 1 21 2013-05-15 Jocelyn Turcotte <jocelyn.turcotte@digia.com> 2 22 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r148696 r150140 330 330 void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPageAdapter* adapter, const QString& name, const QString& value) 331 331 { 332 adapter->page->focusController()->focusedOrMainFrame()->editor() ->command(name).execute(value);332 adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).execute(value); 333 333 } 334 334 335 335 bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPageAdapter *adapter, const QString& name) 336 336 { 337 return adapter->page->focusController()->focusedOrMainFrame()->editor() ->command(name).isEnabled();337 return adapter->page->focusController()->focusedOrMainFrame()->editor().command(name).isEnabled(); 338 338 } 339 339 … … 375 375 return QVariantList(); 376 376 377 QRect resultRect = frame->editor() ->firstRectForRange(range.get());377 QRect resultRect = frame->editor().firstRectForRange(range.get()); 378 378 rect << resultRect.x() << resultRect.y() << resultRect.width() << resultRect.height(); 379 379 return rect; … … 752 752 return; 753 753 754 Editor *editor = frame->editor();755 if (!editor || (!editor->hasComposition() && !text))754 Editor& editor = frame->editor(); 755 if (!editor.hasComposition() && !text) 756 756 return; 757 757 758 if (editor ->hasComposition()) {758 if (editor.hasComposition()) { 759 759 if (text) 760 editor ->confirmComposition(String::fromUTF8(text));760 editor.confirmComposition(String::fromUTF8(text)); 761 761 else 762 editor ->confirmComposition();762 editor.confirmComposition(); 763 763 } else 764 editor ->insertText(String::fromUTF8(text), 0);764 editor.insertText(String::fromUTF8(text), 0); 765 765 } 766 766 -
trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r145849 r150140 207 207 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 208 208 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); 210 210 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 211 211 } 212 212 213 213 m_page->respondToChangedSelection(); 214 if (!frame->editor() ->ignoreCompositionSelectionChange())214 if (!frame->editor().ignoreCompositionSelectionChange()) 215 215 emit m_page->microFocusChanged(); 216 216 } … … 249 249 #ifndef QT_NO_UNDOSTACK 250 250 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 */)) 252 252 return; 253 253 m_page->registerUndoStep(step); … … 456 456 // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated 457 457 // (e.g. Tab that inserts a Tab character, or Enter). 458 if (frame->editor() ->command(cmd).isTextInsertion()458 if (frame->editor().command(cmd).isTextInsertion() 459 459 && kevent->type() == PlatformEvent::RawKeyDown) 460 460 return; … … 468 468 String commandName = editorCommandForKeyDownEvent(event); 469 469 if (!commandName.isEmpty()) { 470 if (frame->editor() ->command(commandName).execute()) // Event handled.470 if (frame->editor().command(commandName).execute()) // Event handled. 471 471 event->setDefaultHandled(); 472 472 return; … … 496 496 497 497 if (shouldInsertText) { 498 frame->editor() ->insertText(kevent->text(), event);498 frame->editor().insertText(kevent->text(), event); 499 499 event->setDefaultHandled(); 500 500 return; … … 527 527 String commandName = editorCommandForKeyDownEvent(event); 528 528 ASSERT(!commandName.isEmpty()); 529 frame->editor() ->command(commandName).execute();529 frame->editor().command(commandName).execute(); 530 530 event->setDefaultHandled(); 531 531 return; -
trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
r148545 r150140 310 310 if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection) 311 311 return QString(); 312 return frame->editor() ->selectedText();312 return frame->editor().selectedText(); 313 313 } 314 314 315 315 QString QWebPageAdapter::selectedHtml() const 316 316 { 317 return page->focusController()->focusedOrMainFrame()->editor() ->selectedRange()->toHTML();317 return page->focusController()->focusedOrMainFrame()->editor().selectedRange()->toHTML(); 318 318 } 319 319 … … 330 330 Frame* frame = mainFrameAdapter()->frame; 331 331 if (editable) { 332 frame->editor() ->applyEditingStyleToBodyElement();332 frame->editor().applyEditingStyleToBodyElement(); 333 333 // FIXME: mac port calls this if there is no selectedDOMRange 334 334 // frame->setSelectionFromNone(); … … 568 568 { 569 569 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()) { 573 573 ev->ignore(); 574 574 return; … … 611 611 612 612 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))); 614 614 else { 615 615 // If we are in the middle of a composition, an empty pre-edit string and a selection of zero 616 616 // 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); 619 619 } 620 620 break; … … 631 631 toHTMLTextFormControlElement(node)->setSelectionRange(start, start + ev->replacementLength()); 632 632 // Commit regardless of whether commitString is empty, to get rid of selection. 633 editor ->confirmComposition(ev->commitString());633 editor.confirmComposition(ev->commitString()); 634 634 } else if (!ev->commitString().isEmpty()) { 635 if (editor ->hasComposition())636 editor ->confirmComposition(ev->commitString());635 if (editor.hasComposition()) 636 editor.confirmComposition(ev->commitString()); 637 637 else 638 editor ->insertText(ev->commitString(), 0);638 editor.insertText(ev->commitString(), 0); 639 639 } 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()); 643 643 644 644 ev->accept(); … … 651 651 return QVariant(); 652 652 653 WebCore::Editor *editor = frame->editor();653 WebCore::Editor& editor = frame->editor(); 654 654 655 655 RenderObject* renderer = 0; … … 679 679 } 680 680 case Qt::ImCursorPosition: { 681 if (editor ->hasComposition())681 if (editor.hasComposition()) 682 682 return QVariant(frame->selection()->end().offsetInContainerNode()); 683 683 return QVariant(frame->selection()->extent().offsetInContainerNode()); … … 686 686 if (renderTextControl && renderTextControl->textFormControlElement()) { 687 687 QString text = renderTextControl->textFormControlElement()->value(); 688 RefPtr<Range> range = editor ->compositionRange();688 RefPtr<Range> range = editor.compositionRange(); 689 689 if (range) 690 690 text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get())); … … 694 694 } 695 695 case Qt::ImCurrentSelection: { 696 if (!editor ->hasComposition() && renderTextControl && renderTextControl->textFormControlElement()) {696 if (!editor.hasComposition() && renderTextControl && renderTextControl->textFormControlElement()) { 697 697 int start = frame->selection()->start().offsetInContainerNode(); 698 698 int end = frame->selection()->end().offsetInContainerNode(); … … 704 704 } 705 705 case Qt::ImAnchorPosition: { 706 if (editor ->hasComposition())706 if (editor.hasComposition()) 707 707 return QVariant(frame->selection()->start().offsetInContainerNode()); 708 708 return QVariant(frame->selection()->base().offsetInContainerNode()); … … 956 956 { 957 957 WebCore::FrameLoader* loader = mainFrameAdapter()->frame->loader(); 958 WebCore::Editor *editor = page->focusController()->focusedOrMainFrame()->editor();958 WebCore::Editor& editor = page->focusController()->focusedOrMainFrame()->editor(); 959 959 960 960 switch (action) { … … 974 974 case QWebPageAdapter::SetTextDirectionLeftToRight: 975 975 case QWebPageAdapter::SetTextDirectionRightToLeft: 976 *enabled = editor ->canEdit();976 *enabled = editor.canEdit(); 977 977 *checked = false; 978 978 break; … … 981 981 // if it's an editor command, let its logic determine state 982 982 if (commandName) { 983 Editor::Command command = editor ->command(commandName);983 Editor::Command command = editor.command(commandName); 984 984 *enabled = command.isEnabled(); 985 985 if (*enabled) … … 998 998 if (!frame) 999 999 return; 1000 Editor *editor = frame->editor();1000 Editor& editor = frame->editor(); 1001 1001 1002 1002 // Convenience … … 1029 1029 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 1030 1030 Pasteboard::generalPasteboard()->setSelectionMode(true); 1031 editor ->copyURL(hitTestResult->linkUrl, hitTestResult->linkText);1031 editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText); 1032 1032 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 1033 1033 #endif 1034 editor ->copyURL(hitTestResult->linkUrl, hitTestResult->linkText);1034 editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText); 1035 1035 break; 1036 1036 } … … 1059 1059 1060 1060 case SetTextDirectionDefault: 1061 editor ->setBaseWritingDirection(NaturalWritingDirection);1061 editor.setBaseWritingDirection(NaturalWritingDirection); 1062 1062 break; 1063 1063 case SetTextDirectionLeftToRight: 1064 editor ->setBaseWritingDirection(LeftToRightWritingDirection);1064 editor.setBaseWritingDirection(LeftToRightWritingDirection); 1065 1065 break; 1066 1066 case SetTextDirectionRightToLeft: 1067 editor ->setBaseWritingDirection(RightToLeftWritingDirection);1067 editor.setBaseWritingDirection(RightToLeftWritingDirection); 1068 1068 break; 1069 1069 #if ENABLE(INSPECTOR) … … 1076 1076 default: 1077 1077 if (commandName) 1078 editor ->command(commandName).execute();1078 editor.command(commandName).execute(); 1079 1079 break; 1080 1080 } … … 1315 1315 { 1316 1316 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()) 1319 1319 return false; 1320 1320 if (event->modifiers() == Qt::NoModifier -
trunk/Source/WebKit/win/ChangeLog
r150115 r150140 1 2013-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 1 45 2013-05-15 Patrick Gansterer <paroga@webkit.org> 2 46 -
trunk/Source/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
r148577 r150140 112 112 void WebContextMenuClient::searchWithGoogle(const Frame* frame) 113 113 { 114 String searchString = frame->editor() ->selectedText();114 String searchString = frame->editor().selectedText(); 115 115 searchString.stripWhiteSpace(); 116 116 String encoded = encodeWithURLEscapeSequences(searchString); -
trunk/Source/WebKit/win/WebFrame.cpp
r148577 r150140 1006 1006 if (!coreFrame) 1007 1007 return E_FAIL; 1008 *result = coreFrame->editor() ->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);1008 *result = coreFrame->editor().selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); 1009 1009 return S_OK; 1010 1010 } … … 1022 1022 { 1023 1023 Frame* coreFrame = core(this); 1024 if (!coreFrame || !coreFrame->editor())1024 if (!coreFrame) 1025 1025 return E_FAIL; 1026 1026 1027 1027 String directionString(direction, SysStringLen(direction)); 1028 1028 if (directionString == "auto") 1029 coreFrame->editor() ->setBaseWritingDirection(NaturalWritingDirection);1029 coreFrame->editor().setBaseWritingDirection(NaturalWritingDirection); 1030 1030 else if (directionString == "ltr") 1031 coreFrame->editor() ->setBaseWritingDirection(LeftToRightWritingDirection);1031 coreFrame->editor().setBaseWritingDirection(LeftToRightWritingDirection); 1032 1032 else if (directionString == "rtl") 1033 coreFrame->editor() ->setBaseWritingDirection(RightToLeftWritingDirection);1033 coreFrame->editor().setBaseWritingDirection(RightToLeftWritingDirection); 1034 1034 return S_OK; 1035 1035 } … … 1053 1053 return E_FAIL; 1054 1054 1055 String text = coreFrame->displayStringModifiedByEncoding(coreFrame->editor() ->selectedText());1055 String text = coreFrame->displayStringModifiedByEncoding(coreFrame->editor().selectedText()); 1056 1056 1057 1057 *result = BString(text).release(); … … 1065 1065 return E_FAIL; 1066 1066 1067 if (!coreFrame->editor() ->command("SelectAll").execute())1067 if (!coreFrame->editor().command("SelectAll").execute()) 1068 1068 return E_FAIL; 1069 1069 -
trunk/Source/WebKit/win/WebView.cpp
r149716 r150140 1813 1813 switch (LOWORD(wParam)) { 1814 1814 case SelectAll: 1815 return frame->editor() ->command("SelectAll").execute();1815 return frame->editor().command("SelectAll").execute(); 1816 1816 case Undo: 1817 return frame->editor() ->command("Undo").execute();1817 return frame->editor().command("Undo").execute(); 1818 1818 case Redo: 1819 return frame->editor() ->command("Redo").execute();1819 return frame->editor().command("Redo").execute(); 1820 1820 } 1821 1821 return false; … … 1964 1964 return false; 1965 1965 1966 Editor::Command command = frame->editor() ->command(interpretKeyEvent(evt));1966 Editor::Command command = frame->editor().command(interpretKeyEvent(evt)); 1967 1967 1968 1968 if (keyEvent->type() == PlatformEvent::RawKeyDown) { … … 1980 1980 return false; 1981 1981 1982 return frame->editor() ->insertText(evt->keyEvent()->text(), evt);1982 return frame->editor().insertText(evt->keyEvent()->text(), evt); 1983 1983 } 1984 1984 … … 3430 3430 HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR value) 3431 3431 { 3432 m_page->focusController()->focusedOrMainFrame()->editor() ->command(toString(name)).execute(toString(value));3432 m_page->focusController()->focusedOrMainFrame()->editor().command(toString(name)).execute(toString(value)); 3433 3433 3434 3434 return S_OK; … … 3657 3657 return E_FAIL; 3658 3658 3659 String frameSelectedText = focusedFrame->editor() ->selectedText();3659 String frameSelectedText = focusedFrame->editor().selectedText(); 3660 3660 *text = SysAllocStringLen(frameSelectedText.characters(), frameSelectedText.length()); 3661 3661 if (!*text && frameSelectedText.length()) … … 4242 4242 /* [retval][out] */ BOOL* enabled) 4243 4243 { 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(); 4246 4246 return S_OK; 4247 4247 } … … 4250 4250 /* [retval][out] */ BOOL* enabled) 4251 4251 { 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(); 4254 4254 return S_OK; 4255 4255 } … … 4258 4258 /* [retval][out] */ BOOL* enabled) 4259 4259 { 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(); 4262 4262 return S_OK; 4263 4263 } … … 4266 4266 /* [retval][out] */ BOOL* enabled) 4267 4267 { 4268 *enabled = m_page->focusController()->focusedOrMainFrame()->editor() ->canDelete();4268 *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canDelete(); 4269 4269 return S_OK; 4270 4270 } … … 4273 4273 /* [retval][out] */ BOOL* enabled) 4274 4274 { 4275 *enabled = m_page->focusController()->focusedOrMainFrame()->editor() ->canEdit();4275 *enabled = m_page->focusController()->focusedOrMainFrame()->editor().canEdit(); 4276 4276 return S_OK; 4277 4277 } … … 4325 4325 { 4326 4326 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); 4328 4328 m_page->mainFrame()->selection()->setBase(start); 4329 4329 return S_OK; … … 4346 4346 HRESULT STDMETHODCALLTYPE WebView::deleteSelection( void) 4347 4347 { 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()); 4350 4350 return S_OK; 4351 4351 } … … 4369 4369 /* [in] */ IUnknown* /*sender*/) 4370 4370 { 4371 m_page->focusController()->focusedOrMainFrame()->editor() ->command("Copy").execute();4371 m_page->focusController()->focusedOrMainFrame()->editor().command("Copy").execute(); 4372 4372 return S_OK; 4373 4373 } … … 4376 4376 /* [in] */ IUnknown* /*sender*/) 4377 4377 { 4378 m_page->focusController()->focusedOrMainFrame()->editor() ->command("Cut").execute();4378 m_page->focusController()->focusedOrMainFrame()->editor().command("Cut").execute(); 4379 4379 return S_OK; 4380 4380 } … … 4383 4383 /* [in] */ IUnknown* /*sender*/) 4384 4384 { 4385 m_page->focusController()->focusedOrMainFrame()->editor() ->command("Paste").execute();4385 m_page->focusController()->focusedOrMainFrame()->editor().command("Paste").execute(); 4386 4386 return S_OK; 4387 4387 } … … 4390 4390 /* [in] */ BSTR url) 4391 4391 { 4392 m_page->focusController()->focusedOrMainFrame()->editor() ->copyURL(MarshallingHelpers::BSTRToKURL(url), "");4392 m_page->focusController()->focusedOrMainFrame()->editor().copyURL(MarshallingHelpers::BSTRToKURL(url), ""); 4393 4393 return S_OK; 4394 4394 } … … 4412 4412 /* [in] */ IUnknown* /*sender*/) 4413 4413 { 4414 m_page->focusController()->focusedOrMainFrame()->editor() ->command("Delete").execute();4414 m_page->focusController()->focusedOrMainFrame()->editor().command("Delete").execute(); 4415 4415 return S_OK; 4416 4416 } … … 4494 4494 } 4495 4495 4496 core(m_mainFrame)->editor() ->advanceToNextMisspelling();4496 core(m_mainFrame)->editor().advanceToNextMisspelling(); 4497 4497 return S_OK; 4498 4498 } … … 4513 4513 } 4514 4514 4515 core(m_mainFrame)->editor() ->advanceToNextMisspelling(true);4515 core(m_mainFrame)->editor().advanceToNextMisspelling(true); 4516 4516 m_editingDelegate->showSpellingUI(TRUE); 4517 4517 return S_OK; … … 5340 5340 { 5341 5341 if (Frame* frame = m_page->focusController()->focusedOrMainFrame()) 5342 frame->editor() ->clearUndoRedoOperations();5342 frame->editor().clearUndoRedoOperations(); 5343 5343 return S_OK; 5344 5344 } … … 5455 5455 ExceptionCode ec = 0; 5456 5456 RefPtr<Range> tempRange = range->cloneRange(ec); 5457 caret = targetFrame->editor() ->firstRectForRange(tempRange.get());5457 caret = targetFrame->editor().firstRectForRange(tempRange.get()); 5458 5458 } 5459 5459 caret = targetFrame->view()->contentsToWindow(caret); … … 5473 5473 { 5474 5474 if (targetFrame) 5475 targetFrame->editor() ->cancelComposition();5475 targetFrame->editor().cancelComposition(); 5476 5476 5477 5477 if (HIMC hInputContext = getIMMContext()) { … … 5488 5488 return; 5489 5489 5490 if (!targetFrame->editor() ->cancelCompositionIfSelectionIsInvalid())5490 if (!targetFrame->editor().cancelCompositionIfSelectionIsInvalid()) 5491 5491 resetIME(targetFrame); 5492 5492 } … … 5644 5644 5645 5645 Frame* targetFrame = m_page->focusController()->focusedOrMainFrame(); 5646 if (!targetFrame || !targetFrame->editor() ->canEdit())5646 if (!targetFrame || !targetFrame->editor().canEdit()) 5647 5647 return true; 5648 5648 … … 5654 5654 return true; 5655 5655 5656 targetFrame->editor() ->confirmComposition(compositionString);5656 targetFrame->editor().confirmComposition(compositionString); 5657 5657 } else { 5658 5658 String compositionString; … … 5675 5675 int cursorPosition = LOWORD(IMMDict::dict().getCompositionString(hInputContext, GCS_CURSORPOS, 0, 0)); 5676 5676 5677 targetFrame->editor() ->setComposition(compositionString, underlines, cursorPosition, 0);5677 targetFrame->editor().setComposition(compositionString, underlines, cursorPosition, 0); 5678 5678 } 5679 5679 … … 5687 5687 // This happens after deleting the last character from inline input hole. 5688 5688 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()); 5691 5691 5692 5692 if (m_inIMEComposition) … … 5713 5713 LRESULT WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* charPos) 5714 5714 { 5715 if (charPos->dwCharPos && !targetFrame->editor() ->hasComposition())5715 if (charPos->dwCharPos && !targetFrame->editor().hasComposition()) 5716 5716 return 0; 5717 5717 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()) { 5719 5719 ExceptionCode ec = 0; 5720 5720 RefPtr<Range> tempRange = range->cloneRange(ec); 5721 5721 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()); 5723 5723 } 5724 5724 caret = targetFrame->view()->contentsToWindow(caret); … … 5753 5753 LOG(TextInput, "onIMERequest %s", imeRequestName(request).latin1().data()); 5754 5754 Frame* targetFrame = m_page->focusController()->focusedOrMainFrame(); 5755 if (!targetFrame || !targetFrame->editor() ->canEdit())5755 if (!targetFrame || !targetFrame->editor().canEdit()) 5756 5756 return 0; 5757 5757 … … 6884 6884 6885 6885 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 6886 if (!frame || !frame->editor() ->canEdit())6886 if (!frame || !frame->editor().canEdit()) 6887 6887 return E_FAIL; 6888 6888 … … 6891 6891 Vector<CompositionUnderline> underlines; 6892 6892 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); 6894 6894 6895 6895 return S_OK; … … 6905 6905 return E_FAIL; 6906 6906 6907 *result = frame && frame->editor() ->hasComposition();6907 *result = frame && frame->editor().hasComposition(); 6908 6908 6909 6909 return S_OK; … … 6916 6916 6917 6917 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 6918 if (!frame || !frame->editor() ->canEdit())6918 if (!frame || !frame->editor().canEdit()) 6919 6919 return E_FAIL; 6920 6920 … … 6922 6922 6923 6923 if (compositionStr.isNull()) 6924 frame->editor() ->confirmComposition();6925 6926 frame->editor() ->confirmComposition(compositionStr);6924 frame->editor().confirmComposition(); 6925 6926 frame->editor().confirmComposition(compositionStr); 6927 6927 6928 6928 return S_OK; … … 6935 6935 6936 6936 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(); 6941 6941 6942 6942 if (!range) … … 6979 6979 ASSERT(range->endContainer()); 6980 6980 6981 IntRect rect = frame->editor() ->firstRectForRange(range.get());6981 IntRect rect = frame->editor().firstRectForRange(range.get()); 6982 6982 resultIntRect = frame->view()->contentsToWindow(rect); 6983 6983 … … 6999 6999 return E_FAIL; 7000 7000 7001 RefPtr<Range> range = frame->editor() ->selectedRange();7001 RefPtr<Range> range = frame->editor().selectedRange(); 7002 7002 7003 7003 size_t locationSize; -
trunk/Source/WebKit/wince/ChangeLog
r149275 r150140 1 2013-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 1 11 2013-04-29 Patrick Gansterer <paroga@webkit.org> 2 12 -
trunk/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
r148702 r150140 396 396 } 397 397 398 Editor::Command command = frame->editor() ->command(interpretKeyEvent(event));398 Editor::Command command = frame->editor().command(interpretKeyEvent(event)); 399 399 400 400 if (keyEvent->type() == PlatformEvent::RawKeyDown) { … … 416 416 return false; 417 417 418 return frame->editor() ->insertText(event->keyEvent()->text(), event);418 return frame->editor().insertText(event->keyEvent()->text(), event); 419 419 } 420 420 -
trunk/Source/WebKit2/ChangeLog
r150133 r150140 1 2013-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 1 60 2013-05-15 Anders Carlsson <andersca@apple.com> 2 61 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
r145453 r150140 78 78 void WebContextMenuClient::searchWithGoogle(const Frame* frame) 79 79 { 80 String searchString = frame->editor() ->selectedText();80 String searchString = frame->editor().selectedText(); 81 81 searchString.stripWhiteSpace(); 82 82 String encoded = encodeWithURLEscapeSequences(searchString); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r149848 r150140 211 211 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 212 212 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); 214 214 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 215 215 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp
r149022 r150140 51 51 { 52 52 Frame* frame = m_page->corePage()->focusController()->focusedOrMainFrame(); 53 if (!frame || !frame->editor() ->canEdit())53 if (!frame || !frame->editor().canEdit()) 54 54 return; 55 55 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
r138544 r150140 51 51 Vector<Editor::Command> commands; 52 52 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()); 54 54 if (command.isTextInsertion() && !allowTextInsertion) 55 55 return false; … … 96 96 97 97 // 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())) { 99 99 event->setDefaultHandled(); 100 100 return; … … 103 103 104 104 // Don't allow text insertion for nodes that cannot edit. 105 if (!frame->editor() ->canEdit())105 if (!frame->editor().canEdit()) 106 106 return; 107 107 … … 120 120 return; 121 121 122 if (frame->editor() ->insertText(platformEvent->text(), event))122 if (frame->editor().insertText(platformEvent->text(), event)) 123 123 event->setDefaultHandled(); 124 124 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
r150064 r150140 64 64 void WebContextMenuClient::searchWithGoogle(const Frame* frame) 65 65 { 66 String searchString = frame->editor() ->selectedText();66 String searchString = frame->editor().selectedText(); 67 67 searchString.stripWhiteSpace(); 68 68 … … 86 86 selectionFrame = mainFrame; 87 87 88 String selectedString = selectionFrame->displayStringModifiedByEncoding(selectionFrame->editor() ->selectedText());88 String selectedString = selectionFrame->displayStringModifiedByEncoding(selectionFrame->editor().selectedText()); 89 89 90 90 if (selectedString.isEmpty()) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
r149848 r150140 137 137 { 138 138 Frame* frame = page->corePage()->focusController()->focusedOrMainFrame(); 139 if (!frame->editor() ->canEdit())139 if (!frame->editor().canEdit()) 140 140 return; 141 141 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()); 145 145 page->replaceSelectionWithText(frame, [selectedString performSelector:selector]); 146 146 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r149848 r150140 325 325 return String(); 326 326 327 return m_coreFrame->displayStringModifiedByEncoding(m_coreFrame->editor() ->selectedText());327 return m_coreFrame->displayStringModifiedByEncoding(m_coreFrame->editor().selectedText()); 328 328 } 329 329 … … 701 701 void WebFrame::setTextDirection(const String& direction) 702 702 { 703 if (!m_coreFrame || !m_coreFrame->editor())703 if (!m_coreFrame) 704 704 return; 705 705 706 706 if (direction == "auto") 707 m_coreFrame->editor() ->setBaseWritingDirection(NaturalWritingDirection);707 m_coreFrame->editor().setBaseWritingDirection(NaturalWritingDirection); 708 708 else if (direction == "ltr") 709 m_coreFrame->editor() ->setBaseWritingDirection(LeftToRightWritingDirection);709 m_coreFrame->editor().setBaseWritingDirection(LeftToRightWritingDirection); 710 710 else if (direction == "rtl") 711 m_coreFrame->editor() ->setBaseWritingDirection(RightToLeftWritingDirection);711 m_coreFrame->editor().setBaseWritingDirection(RightToLeftWritingDirection); 712 712 } 713 713 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r150046 r150140 602 602 result.isContentRichlyEditable = frame->selection()->isContentRichlyEditable(); 603 603 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(); 606 606 607 607 #if PLATFORM(QT) … … 642 642 643 643 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); 646 646 647 647 result.compositionRect = frame->view()->contentsToWindow(range->boundingBox()); … … 658 658 659 659 if (range) 660 result.cursorRect = frame->view()->contentsToWindow(frame->editor() ->firstRectForRange(range.get()));660 result.cursorRect = frame->view()->contentsToWindow(frame->editor().firstRectForRange(range.get())); 661 661 662 662 // FIXME: We should only transfer innerText when it changes and do this on the UI side. … … 769 769 } 770 770 771 frame->editor() ->command(commandName).execute(argument);771 frame->editor().command(commandName).execute(argument); 772 772 } 773 773 … … 781 781 return pluginView->isEditingCommandEnabled(commandName); 782 782 783 Editor::Command command = frame->editor() ->command(commandName);783 Editor::Command command = frame->editor().command(commandName); 784 784 return command.isSupported() && command.isEnabled(); 785 785 } … … 1779 1779 isEnabled = pluginView->isEditingCommandEnabled(commandName); 1780 1780 else { 1781 Editor::Command command = frame->editor() ->command(commandName);1781 Editor::Command command = frame->editor().command(commandName); 1782 1782 state = command.state(); 1783 1783 isEnabled = command.isSupported() && command.isEnabled(); … … 2561 2561 return false; 2562 2562 2563 Editor::Command command = frame->editor() ->command(interpretKeyEvent(evt));2563 Editor::Command command = frame->editor().command(interpretKeyEvent(evt)); 2564 2564 2565 2565 if (keyEvent->type() == PlatformEvent::RawKeyDown) { … … 2574 2574 2575 2575 // Don't allow text insertion for nodes that cannot edit. 2576 if (!frame->editor() ->canEdit())2576 if (!frame->editor().canEdit()) 2577 2577 return false; 2578 2578 … … 2581 2581 return false; 2582 2582 2583 return frame->editor() ->insertText(evt->keyEvent()->text(), evt);2583 return frame->editor().insertText(evt->keyEvent()->text(), evt); 2584 2584 } 2585 2585 #endif … … 2860 2860 { 2861 2861 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 2862 frame->editor() ->advanceToNextMisspelling(startBeforeSelection);2862 frame->editor().advanceToNextMisspelling(startBeforeSelection); 2863 2863 } 2864 2864 … … 2887 2887 void WebPage::uppercaseWord() 2888 2888 { 2889 m_page->focusController()->focusedOrMainFrame()->editor() ->uppercaseWord();2889 m_page->focusController()->focusedOrMainFrame()->editor().uppercaseWord(); 2890 2890 } 2891 2891 2892 2892 void WebPage::lowercaseWord() 2893 2893 { 2894 m_page->focusController()->focusedOrMainFrame()->editor() ->lowercaseWord();2894 m_page->focusController()->focusedOrMainFrame()->editor().lowercaseWord(); 2895 2895 } 2896 2896 2897 2897 void WebPage::capitalizeWord() 2898 2898 { 2899 m_page->focusController()->focusedOrMainFrame()->editor() ->capitalizeWord();2899 m_page->focusController()->focusedOrMainFrame()->editor().capitalizeWord(); 2900 2900 } 2901 2901 #endif … … 2934 2934 bool selectReplacement = true; 2935 2935 bool smartReplace = false; 2936 return frame->editor() ->replaceSelectionWithText(text, selectReplacement, smartReplace);2936 return frame->editor().replaceSelectionWithText(text, selectReplacement, smartReplace); 2937 2937 } 2938 2938 … … 3597 3597 if (!frame) 3598 3598 return; 3599 frame->editor() ->handleAlternativeTextUIResult(result);3599 frame->editor().handleAlternativeTextUIResult(result); 3600 3600 } 3601 3601 #endif … … 3619 3619 { 3620 3620 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 3621 if (!frame || !frame->editor() ->canEdit())3621 if (!frame || !frame->editor().canEdit()) 3622 3622 return; 3623 3623 3624 3624 Vector<CompositionUnderline> underlines; 3625 3625 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); 3627 3627 } 3628 3628 … … 3630 3630 { 3631 3631 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 3632 return frame && frame->editor() ->hasComposition();3632 return frame && frame->editor().hasComposition(); 3633 3633 } 3634 3634 … … 3636 3636 { 3637 3637 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 3638 if (!frame || !frame->editor() ->canEdit())3638 if (!frame || !frame->editor().canEdit()) 3639 3639 return; 3640 3640 3641 3641 if (compositionString.isNull()) 3642 frame->editor() ->confirmComposition();3643 frame->editor() ->confirmComposition(compositionString);3642 frame->editor().confirmComposition(); 3643 frame->editor().confirmComposition(compositionString); 3644 3644 } 3645 3645 … … 3797 3797 Frame* targetFrame = page->corePage()->focusController()->focusedOrMainFrame(); 3798 3798 3799 if (!targetFrame || !targetFrame->editor())3799 if (!targetFrame) 3800 3800 return 0; 3801 3801 3802 Editor *editor = targetFrame->editor();3803 if (!editor ->canEdit())3802 Editor& editor = targetFrame->editor(); 3803 if (!editor.canEdit()) 3804 3804 return 0; 3805 3805 3806 if (editor ->hasComposition()) {3806 if (editor.hasComposition()) { 3807 3807 // We should verify the parent node of this IME composition node are 3808 3808 // editable because JavaScript may delete a parent node of the composition 3809 3809 // node. In this case, WebKit crashes while deleting texts from the parent 3810 3810 // node, which doesn't exist any longer. 3811 if (PassRefPtr<Range> range = editor ->compositionRange()) {3811 if (PassRefPtr<Range> range = editor.compositionRange()) { 3812 3812 Node* node = range->startContainer(); 3813 3813 if (!node || !node->isContentEditable()) … … 3826 3826 } 3827 3827 3828 Editor* editor = targetFrame->editor(); 3829 editor->confirmComposition(compositionString); 3828 targetFrame->editor().confirmComposition(compositionString); 3830 3829 3831 3830 if (selectionStart == -1) { … … 3859 3858 Element* scope = targetFrame->selection()->rootEditableElement(); 3860 3859 RefPtr<Range> replacementRange = TextIterator::rangeFromLocationAndLength(scope, replacementStart, replacementLength); 3861 targetFrame->editor() ->setIgnoreCompositionSelectionChange(true);3860 targetFrame->editor().setIgnoreCompositionSelectionChange(true); 3862 3861 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); 3867 3866 send(Messages::WebPageProxy::EditorStateChanged(editorState())); 3868 3867 } … … 3871 3870 { 3872 3871 if (Frame* targetFrame = targetFrameForEditing(this)) 3873 targetFrame->editor() ->cancelComposition();3872 targetFrame->editor().cancelComposition(); 3874 3873 send(Messages::WebPageProxy::EditorStateChanged(editorState())); 3875 3874 } -
trunk/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp
r148553 r150140 179 179 return 0; 180 180 181 Editor *editor = frame->editor();182 if (!editor ->canEdit())181 Editor& editor = frame->editor(); 182 if (!editor.canEdit()) 183 183 return 0; 184 184 185 if (editor ->hasComposition()) {185 if (editor.hasComposition()) { 186 186 // We should verify the parent node of this IME composition node are 187 187 // editable because JavaScript may delete a parent node of the composition 188 188 // node. In this case, WebKit crashes while deleting texts from the parent 189 189 // node, which doesn't exist any longer. 190 if (PassRefPtr<Range> range = editor ->compositionRange()) {190 if (PassRefPtr<Range> range = editor.compositionRange()) { 191 191 Node* node = range->startContainer(); 192 192 if (!node || !node->isContentEditable()) … … 204 204 return; 205 205 206 targetFrame->editor() ->confirmComposition(compositionString);206 targetFrame->editor().confirmComposition(compositionString); 207 207 } 208 208 … … 213 213 return; 214 214 215 targetFrame->editor() ->setComposition(compositionString, underlines, cursorPosition, 0);215 targetFrame->editor().setComposition(compositionString, underlines, cursorPosition, 0); 216 216 } 217 217 … … 222 222 return; 223 223 224 frame->editor() ->cancelComposition();224 frame->editor().cancelComposition(); 225 225 } 226 226 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r150064 r150140 169 169 for (size_t i = 0; i < commands.size(); ++i) { 170 170 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()) 174 174 continue; 175 175 176 176 // An insertText: might be handled by other responders in the chain if we don't handle it. 177 177 // 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); 179 179 } else { 180 Editor::Command command = frame->editor() ->command(commandNameForSelectorName(commands[i].commandName));180 Editor::Command command = frame->editor().command(commandNameForSelectorName(commands[i].commandName)); 181 181 if (command.isSupported()) { 182 182 bool commandExecutedByEditor = command.execute(event); … … 234 234 bool haveTextInsertionCommands = false; 235 235 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()) 237 237 haveTextInsertionCommands = true; 238 238 } … … 266 266 } 267 267 268 frame->editor() ->setComposition(text, underlines, selectionStart, selectionEnd);268 frame->editor().setComposition(text, underlines, selectionStart, selectionEnd); 269 269 } 270 270 … … 276 276 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 277 277 278 frame->editor() ->confirmComposition();278 frame->editor().confirmComposition(); 279 279 280 280 newState = editorState(); … … 285 285 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 286 286 287 frame->editor() ->cancelComposition();287 frame->editor().cancelComposition(); 288 288 289 289 newState = editorState(); … … 300 300 } 301 301 302 if (!frame->editor() ->hasComposition()) {302 if (!frame->editor().hasComposition()) { 303 303 // An insertText: might be handled by other responders in the chain if we don't handle it. 304 304 // 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); 306 306 } else { 307 307 handled = true; 308 frame->editor() ->confirmComposition(text);308 frame->editor().confirmComposition(text); 309 309 } 310 310 … … 322 322 } 323 323 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); 326 326 newState = editorState(); 327 327 } … … 335 335 return; 336 336 337 RefPtr<Range> range = frame->editor() ->compositionRange();337 RefPtr<Range> range = frame->editor().compositionRange(); 338 338 size_t locationSize; 339 339 size_t lengthSize; … … 438 438 ASSERT(range->endContainer()); 439 439 440 IntRect rect = frame->editor() ->firstRectForRange(range.get());440 IntRect rect = frame->editor().firstRectForRange(range.get()); 441 441 resultRect = frame->view()->contentsToWindow(rect); 442 442 } … … 655 655 return; 656 656 } 657 frame->editor() ->readSelectionFromPasteboard(pasteboardName);657 frame->editor().readSelectionFromPasteboard(pasteboardName); 658 658 result = true; 659 659 } … … 677 677 return; 678 678 679 stringValue = frame->editor() ->stringSelectionForPasteboard();679 stringValue = frame->editor().stringSelectionForPasteboard(); 680 680 } 681 681 … … 686 686 return; 687 687 688 RefPtr<SharedBuffer> buffer = frame->editor() ->dataSelectionForPasteboard(pasteboardType);688 RefPtr<SharedBuffer> buffer = frame->editor().dataSelectionForPasteboard(pasteboardType); 689 689 if (!buffer) { 690 690 size = 0;
Note: See TracChangeset
for help on using the changeset viewer.