Diff
Modified: trunk/Source/WebCore/ChangeLog (102626 => 102627)
--- trunk/Source/WebCore/ChangeLog 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebCore/ChangeLog 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1,3 +1,25 @@
+2011-12-12 Ryosuke Niwa <[email protected]>
+
+ WebKit code shouldn't be calling applyCommand directly
+ https://bugs.webkit.org/show_bug.cgi?id=74337
+
+ Reviewed by Darin Adler.
+
+ Make WebKit-layer code call Editor::replaceSelectionWithFragment and Editor::replaceSelectionWithText
+ instead of manually creating and applying ReplaceSelectionCommand.
+
+ The only behavioral difference is that new code will end up checking for spell checks. However, this
+ difference appears to be unintentional since the code predates http://trac.webkit.org/changeset/73886,
+ which introduced an invocation of spellcheck code.
+
+ Unfortunately no tests since there doesn't seem to be anyway to test this change.
+
+ * WebCore.exp.in:
+ * editing/EditCommand.cpp:
+ (WebCore::applyCommand):
+ * editing/EditCommand.h:
+ * editing/Editor.h:
+
2011-11-26 Adam Barth <[email protected]>
Remove platform/audio/fftw
Modified: trunk/Source/WebCore/WebCore.exp.in (102626 => 102627)
--- trunk/Source/WebCore/WebCore.exp.in 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-12-12 22:53:34 UTC (rev 102627)
@@ -302,7 +302,6 @@
__ZN7WebCore12TextIteratorC1EPKNS_5RangeENS_20TextIteratorBehaviorE
__ZN7WebCore12TextIteratorD1Ev
__ZN7WebCore12WorkerThread17workerThreadCountEv
-__ZN7WebCore12applyCommandEN3WTF10PassRefPtrINS_11EditCommandEEE
__ZN7WebCore12cacheStorageEv
__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsE
__ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
@@ -638,7 +637,6 @@
__ZN7WebCore22externalRepresentationEPNS_5FrameEj
__ZN7WebCore22externalRepresentationEPNS_7ElementEj
__ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorE
-__ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEjNS_10EditActionE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
__ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE
__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
@@ -841,6 +839,7 @@
__ZN7WebCore6Editor21isSelectionMisspelledEv
__ZN7WebCore6Editor23setBaseWritingDirectionE16WritingDirection
__ZN7WebCore6Editor24advanceToNextMisspellingEb
+__ZN7WebCore6Editor24replaceSelectionWithTextERKN3WTF6StringEbb
__ZN7WebCore6Editor24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor24isSelectionUngrammaticalEv
__ZN7WebCore6Editor26decreaseSelectionListLevelEv
@@ -848,6 +847,7 @@
__ZN7WebCore6Editor26writeSelectionToPasteboardERKN3WTF6StringERKNS1_6VectorIS2_Lm0EEE
__ZN7WebCore6Editor27handleCorrectionPanelResultERKN3WTF6StringE
__ZN7WebCore6Editor27readSelectionFromPasteboardERKN3WTF6StringE
+__ZN7WebCore6Editor28replaceSelectionWithFragmentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbb
__ZN7WebCore6Editor29canDecreaseSelectionListLevelEv
__ZN7WebCore6Editor29canIncreaseSelectionListLevelEv
__ZN7WebCore6Editor30applyParagraphStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
Modified: trunk/Source/WebCore/editing/EditCommand.cpp (102626 => 102627)
--- trunk/Source/WebCore/editing/EditCommand.cpp 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebCore/editing/EditCommand.cpp 2011-12-12 22:53:34 UTC (rev 102627)
@@ -259,7 +259,7 @@
}
#endif
-void applyCommand(PassRefPtr<EditCommand> command)
+void applyCommand(PassRefPtr<CompositeEditCommand> command)
{
command->apply();
}
Modified: trunk/Source/WebCore/editing/EditCommand.h (102626 => 102627)
--- trunk/Source/WebCore/editing/EditCommand.h 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebCore/editing/EditCommand.h 2011-12-12 22:53:34 UTC (rev 102627)
@@ -95,7 +95,7 @@
RefPtr<Element> m_endingRootEditableElement;
CompositeEditCommand* m_parent;
- friend void applyCommand(PassRefPtr<EditCommand>);
+ friend void applyCommand(PassRefPtr<CompositeEditCommand>);
};
class SimpleEditCommand : public EditCommand {
@@ -123,7 +123,7 @@
return static_cast<SimpleEditCommand*>(command);
}
-void applyCommand(PassRefPtr<EditCommand>);
+void applyCommand(PassRefPtr<CompositeEditCommand>);
} // namespace WebCore
Modified: trunk/Source/WebCore/editing/Editor.h (102626 => 102627)
--- trunk/Source/WebCore/editing/Editor.h 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebCore/editing/Editor.h 2011-12-12 22:53:34 UTC (rev 102627)
@@ -374,6 +374,8 @@
void readSelectionFromPasteboard(const String& pasteboardName);
#endif
+ void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle);
+ void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace);
bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int length) const;
void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection);
void deletedAutocorrectionAtPosition(const Position&, const String& originalString);
@@ -403,8 +405,6 @@
PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy, Frame*);
void pasteAsPlainTextWithPasteboard(Pasteboard*);
void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
- void replaceSelectionWithFragment(PassRefPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle);
- void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace);
void writeSelectionToPasteboard(Pasteboard*);
void revealSelectionAfterEditingOperation();
void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
Modified: trunk/Source/WebKit/chromium/ChangeLog (102626 => 102627)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1,3 +1,13 @@
+2011-12-12 Ryosuke Niwa <[email protected]>
+
+ WebKit code shouldn't be calling applyCommand directly
+ https://bugs.webkit.org/show_bug.cgi?id=74337
+
+ Reviewed by Darin Adler.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::replaceSelection):
+
2011-12-12 David Grogan <[email protected]>
Fix compilation error when !ENABLE(WORKERS)
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (102626 => 102627)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1122,10 +1122,9 @@
void WebFrameImpl::replaceSelection(const WebString& text)
{
- RefPtr<DocumentFragment> fragment = createFragmentFromText(
- frame()->selection()->toNormalizedRange().get(), text);
- applyCommand(ReplaceSelectionCommand::create(
- frame()->document(), fragment.get(), ReplaceSelectionCommand::SmartReplace | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
+ bool selectReplacement = false;
+ bool smartReplace = true;
+ return frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
}
void WebFrameImpl::insertText(const WebString& text)
Modified: trunk/Source/WebKit/gtk/ChangeLog (102626 => 102627)
--- trunk/Source/WebKit/gtk/ChangeLog 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/gtk/ChangeLog 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1,3 +1,13 @@
+2011-12-12 Ryosuke Niwa <[email protected]>
+
+ WebKit code shouldn't be calling applyCommand directly
+ https://bugs.webkit.org/show_bug.cgi?id=74337
+
+ Reviewed by Darin Adler.
+
+ * webkit/webkitwebframe.cpp:
+ (webkit_web_frame_replace_selection):
+
2011-12-12 Martin Robinson <[email protected]>
[GTK] gtk_widget_size_allocate for plugin widgets should happen in the WebView size-allocate method
Modified: trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp (102626 => 102627)
--- trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebframe.cpp 2011-12-12 22:53:34 UTC (rev 102627)
@@ -996,10 +996,9 @@
void webkit_web_frame_replace_selection(WebKitWebFrame* frame, const char* text)
{
Frame* coreFrame = core(frame);
- RefPtr<DocumentFragment> fragment = createFragmentFromText(
- coreFrame->selection()->toNormalizedRange().get(), text);
- applyCommand(ReplaceSelectionCommand::create(coreFrame->document(), fragment.get(),
- ReplaceSelectionCommand::SmartReplace | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
+ bool selectReplacement = false;
+ bool smartReplace = true;
+ coreFrame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
}
/**
Modified: trunk/Source/WebKit/mac/ChangeLog (102626 => 102627)
--- trunk/Source/WebKit/mac/ChangeLog 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/mac/ChangeLog 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1,3 +1,13 @@
+2011-12-12 Ryosuke Niwa <[email protected]>
+
+ WebKit code shouldn't be calling applyCommand directly
+ https://bugs.webkit.org/show_bug.cgi?id=74337
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+
2011-12-12 Brady Eidson <[email protected]>
Page cache should support pages with plugins.
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (102626 => 102627)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1048,15 +1048,7 @@
{
if (_private->coreFrame->selection()->isNone() || !fragment)
return;
- ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::PreventNesting;
- if (selectReplacement)
- options |= ReplaceSelectionCommand::SelectReplacement;
- if (smartReplace)
- options |= ReplaceSelectionCommand::SmartReplace;
- if (matchStyle)
- options |= ReplaceSelectionCommand::MatchStyle;
- applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), core(fragment), options));
- _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ _private->coreFrame->editor()->replaceSelectionWithFragment(core(fragment), selectReplacement, smartReplace, matchStyle);
}
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
Modified: trunk/Source/WebKit2/ChangeLog (102626 => 102627)
--- trunk/Source/WebKit2/ChangeLog 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit2/ChangeLog 2011-12-12 22:53:34 UTC (rev 102627)
@@ -1,3 +1,13 @@
+2011-12-12 Ryosuke Niwa <[email protected]>
+
+ WebKit code shouldn't be calling applyCommand directly
+ https://bugs.webkit.org/show_bug.cgi?id=74337
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::replaceSelectionWithText):
+
2011-12-12 Sam Weinig <[email protected]>
Remove unused getter on WKConnection.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (102626 => 102627)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-12-12 22:49:58 UTC (rev 102626)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-12-12 22:53:34 UTC (rev 102627)
@@ -2242,12 +2242,9 @@
void WebPage::replaceSelectionWithText(Frame* frame, const String& text)
{
- if (frame->selection()->isNone())
- return;
-
- RefPtr<DocumentFragment> textFragment = createFragmentFromText(frame->selection()->toNormalizedRange().get(), text);
- applyCommand(ReplaceSelectionCommand::create(frame->document(), textFragment.release(), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
- frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ bool selectReplacement = true;
+ bool smartReplace = false;
+ return frame->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
}
void WebPage::clearSelection()