Changeset 102627 in webkit
- Timestamp:
- Dec 12, 2011 2:53:34 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102622 r102627 1 2011-12-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 WebKit code shouldn't be calling applyCommand directly 4 https://bugs.webkit.org/show_bug.cgi?id=74337 5 6 Reviewed by Darin Adler. 7 8 Make WebKit-layer code call Editor::replaceSelectionWithFragment and Editor::replaceSelectionWithText 9 instead of manually creating and applying ReplaceSelectionCommand. 10 11 The only behavioral difference is that new code will end up checking for spell checks. However, this 12 difference appears to be unintentional since the code predates http://trac.webkit.org/changeset/73886, 13 which introduced an invocation of spellcheck code. 14 15 Unfortunately no tests since there doesn't seem to be anyway to test this change. 16 17 * WebCore.exp.in: 18 * editing/EditCommand.cpp: 19 (WebCore::applyCommand): 20 * editing/EditCommand.h: 21 * editing/Editor.h: 22 1 23 2011-11-26 Adam Barth <abarth@webkit.org> 2 24 -
trunk/Source/WebCore/WebCore.exp.in
r102540 r102627 303 303 __ZN7WebCore12TextIteratorD1Ev 304 304 __ZN7WebCore12WorkerThread17workerThreadCountEv 305 __ZN7WebCore12applyCommandEN3WTF10PassRefPtrINS_11EditCommandEEE306 305 __ZN7WebCore12cacheStorageEv 307 306 __ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsE … … 639 638 __ZN7WebCore22externalRepresentationEPNS_7ElementEj 640 639 __ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorE 641 __ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEjNS_10EditActionE642 640 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE 643 641 __ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE … … 842 840 __ZN7WebCore6Editor23setBaseWritingDirectionE16WritingDirection 843 841 __ZN7WebCore6Editor24advanceToNextMisspellingEb 842 __ZN7WebCore6Editor24replaceSelectionWithTextERKN3WTF6StringEbb 844 843 __ZN7WebCore6Editor24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE 845 844 __ZN7WebCore6Editor24isSelectionUngrammaticalEv … … 849 848 __ZN7WebCore6Editor27handleCorrectionPanelResultERKN3WTF6StringE 850 849 __ZN7WebCore6Editor27readSelectionFromPasteboardERKN3WTF6StringE 850 __ZN7WebCore6Editor28replaceSelectionWithFragmentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbb 851 851 __ZN7WebCore6Editor29canDecreaseSelectionListLevelEv 852 852 __ZN7WebCore6Editor29canIncreaseSelectionListLevelEv -
trunk/Source/WebCore/editing/EditCommand.cpp
r102527 r102627 260 260 #endif 261 261 262 void applyCommand(PassRefPtr< EditCommand> command)262 void applyCommand(PassRefPtr<CompositeEditCommand> command) 263 263 { 264 264 command->apply(); -
trunk/Source/WebCore/editing/EditCommand.h
r102527 r102627 96 96 CompositeEditCommand* m_parent; 97 97 98 friend void applyCommand(PassRefPtr< EditCommand>);98 friend void applyCommand(PassRefPtr<CompositeEditCommand>); 99 99 }; 100 100 … … 124 124 } 125 125 126 void applyCommand(PassRefPtr< EditCommand>);126 void applyCommand(PassRefPtr<CompositeEditCommand>); 127 127 128 128 } // namespace WebCore -
trunk/Source/WebCore/editing/Editor.h
r102553 r102627 375 375 #endif 376 376 377 void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle); 378 void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace); 377 379 bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int length) const; 378 380 void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection); … … 404 406 void pasteAsPlainTextWithPasteboard(Pasteboard*); 405 407 void pasteWithPasteboard(Pasteboard*, bool allowPlainText); 406 void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle);407 void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace);408 408 void writeSelectionToPasteboard(Pasteboard*); 409 409 void revealSelectionAfterEditingOperation(); -
trunk/Source/WebKit/chromium/ChangeLog
r102620 r102627 1 2011-12-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 WebKit code shouldn't be calling applyCommand directly 4 https://bugs.webkit.org/show_bug.cgi?id=74337 5 6 Reviewed by Darin Adler. 7 8 * src/WebFrameImpl.cpp: 9 (WebKit::WebFrameImpl::replaceSelection): 10 1 11 2011-12-12 David Grogan <dgrogan@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r102495 r102627 1123 1123 void WebFrameImpl::replaceSelection(const WebString& text) 1124 1124 { 1125 RefPtr<DocumentFragment> fragment = createFragmentFromText( 1126 frame()->selection()->toNormalizedRange().get(), text); 1127 applyCommand(ReplaceSelectionCommand::create( 1128 frame()->document(), fragment.get(), ReplaceSelectionCommand::SmartReplace | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting)); 1125 bool selectReplacement = false; 1126 bool smartReplace = true; 1127 return frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace); 1129 1128 } 1130 1129 -
trunk/Source/WebKit/gtk/ChangeLog
r102604 r102627 1 2011-12-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 WebKit code shouldn't be calling applyCommand directly 4 https://bugs.webkit.org/show_bug.cgi?id=74337 5 6 Reviewed by Darin Adler. 7 8 * webkit/webkitwebframe.cpp: 9 (webkit_web_frame_replace_selection): 10 1 11 2011-12-12 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp
r101049 r102627 997 997 { 998 998 Frame* coreFrame = core(frame); 999 RefPtr<DocumentFragment> fragment = createFragmentFromText( 1000 coreFrame->selection()->toNormalizedRange().get(), text); 1001 applyCommand(ReplaceSelectionCommand::create(coreFrame->document(), fragment.get(), 1002 ReplaceSelectionCommand::SmartReplace | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting)); 999 bool selectReplacement = false; 1000 bool smartReplace = true; 1001 coreFrame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace); 1003 1002 } 1004 1003 -
trunk/Source/WebKit/mac/ChangeLog
r102619 r102627 1 2011-12-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 WebKit code shouldn't be calling applyCommand directly 4 https://bugs.webkit.org/show_bug.cgi?id=74337 5 6 Reviewed by Darin Adler. 7 8 * WebView/WebFrame.mm: 9 (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): 10 1 11 2011-12-12 Brady Eidson <beidson@apple.com> 2 12 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r99628 r102627 1049 1049 if (_private->coreFrame->selection()->isNone() || !fragment) 1050 1050 return; 1051 ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::PreventNesting; 1052 if (selectReplacement) 1053 options |= ReplaceSelectionCommand::SelectReplacement; 1054 if (smartReplace) 1055 options |= ReplaceSelectionCommand::SmartReplace; 1056 if (matchStyle) 1057 options |= ReplaceSelectionCommand::MatchStyle; 1058 applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), core(fragment), options)); 1059 _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded); 1051 _private->coreFrame->editor()->replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle); 1060 1052 } 1061 1053 -
trunk/Source/WebKit2/ChangeLog
r102625 r102627 1 2011-12-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 WebKit code shouldn't be calling applyCommand directly 4 https://bugs.webkit.org/show_bug.cgi?id=74337 5 6 Reviewed by Darin Adler. 7 8 * WebProcess/WebPage/WebPage.cpp: 9 (WebKit::WebPage::replaceSelectionWithText): 10 1 11 2011-12-12 Sam Weinig <sam@webkit.org> 2 12 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r102619 r102627 2243 2243 void WebPage::replaceSelectionWithText(Frame* frame, const String& text) 2244 2244 { 2245 if (frame->selection()->isNone()) 2246 return; 2247 2248 RefPtr<DocumentFragment> textFragment = createFragmentFromText(frame->selection()->toNormalizedRange().get(), text); 2249 applyCommand(ReplaceSelectionCommand::create(frame->document(), textFragment.release(), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting)); 2250 frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded); 2245 bool selectReplacement = true; 2246 bool smartReplace = false; 2247 return frame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace); 2251 2248 } 2252 2249
Note: See TracChangeset
for help on using the changeset viewer.