Commit ce2a1a3d authored by rniwa@webkit.org's avatar rniwa@webkit.org
Browse files

Rename confirmCompositionWithoutDisturbingSelection to cancelComposition

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

Reviewed by Antonio Gomes.

Source/WebCore: 

Renamed Editor::confirmCompositionWithoutDisturbingSelection to Editor::cancelComposition.
Also renamed the shared function from confirmComposition to setComposition.

* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::confirmComposition):
(WebCore::Editor::cancelComposition):
(WebCore::Editor::setComposition):
* editing/Editor.h:

Source/WebKit/chromium: 

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::unmarkText):

Source/WebKit/gtk: 

* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::respondToChangedSelection):

Source/WebKit/mac: 

* WebView/WebHTMLView.mm:
(-[WebHTMLView _updateSelectionForInputManager]):

Source/WebKit/win: 

* WebView.cpp:
(WebView::resetIME):

Source/WebKit2: 

* UIProcess/API/mac/WKView.mm:
(-[WKView resignFirstResponder]):
(-[WKView _updateTextInputStateIncludingSecureInputState:]):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::cancelComposition):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::cancelComposition):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4172e9cf
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
Renamed Editor::confirmCompositionWithoutDisturbingSelection to Editor::cancelComposition.
Also renamed the shared function from confirmComposition to setComposition.
* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::confirmComposition):
(WebCore::Editor::cancelComposition):
(WebCore::Editor::setComposition):
* editing/Editor.h:
2011-09-06 Sam Weinig <sam@webkit.org>
 
WebVTTTokenizer files in the wrong place in the Xcode project.
......@@ -775,6 +775,7 @@ __ZN7WebCore6Editor13tryDHTMLPasteEv
__ZN7WebCore6Editor14setCompositionERKN3WTF6StringERKNS1_6VectorINS_20CompositionUnderlineELm0EEEjj
__ZN7WebCore6Editor15pasteAsFragmentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbb
__ZN7WebCore6Editor16pasteAsPlainTextEv
__ZN7WebCore6Editor17cancelCompositionEv
__ZN7WebCore6Editor17insertOrderedListEv
__ZN7WebCore6Editor18confirmCompositionERKN3WTF6StringE
__ZN7WebCore6Editor18confirmCompositionEv
......@@ -804,7 +805,6 @@ __ZN7WebCore6Editor35increaseSelectionListLevelUnorderedEv
__ZN7WebCore6Editor35setIgnoreCompositionSelectionChangeEb
__ZN7WebCore6Editor38commandIsSupportedFromMenuOrKeyBindingERKN3WTF6StringE
__ZN7WebCore6Editor3cutEv
__ZN7WebCore6Editor44confirmCompositionWithoutDisturbingSelectionEv
__ZN7WebCore6Editor4copyEv
__ZN7WebCore6Editor5pasteEv
__ZN7WebCore6Editor6indentEv
......
......@@ -1469,30 +1469,29 @@ void Editor::confirmComposition()
{
if (!m_compositionNode)
return;
confirmComposition(m_compositionNode->data().substring(m_compositionStart, m_compositionEnd - m_compositionStart), false);
setComposition(m_compositionNode->data().substring(m_compositionStart, m_compositionEnd - m_compositionStart), ConfirmComposition);
}
// FIXME: This function is poorly named. Callers of this function uses this function to cancel composition,
// and don't expect it to insert the current composition as the name suggests.
void Editor::confirmCompositionWithoutDisturbingSelection()
void Editor::cancelComposition()
{
if (!m_compositionNode)
return;
confirmComposition(emptyString(), true);
setComposition(emptyString(), CancelComposition);
}
void Editor::confirmComposition(const String& text)
{
confirmComposition(text, false);
setComposition(text, ConfirmComposition);
}
void Editor::confirmComposition(const String& text, bool preserveSelection)
void Editor::setComposition(const String& text, SetCompositionMode mode)
{
ASSERT(mode == ConfirmComposition || mode == CancelComposition);
UserTypingGestureIndicator typingGestureIndicator(m_frame);
setIgnoreCompositionSelectionChange(true);
if (preserveSelection)
if (mode == CancelComposition)
ASSERT(text == emptyString());
else
selectComposition();
......@@ -1522,7 +1521,7 @@ void Editor::confirmComposition(const String& text, bool preserveSelection)
insertTextForConfirmedComposition(text);
if (preserveSelection) {
if (mode == CancelComposition) {
// An open typing command that disagrees about current selection would cause issues with typing later on.
TypingCommand::closeTyping(m_lastEditCommand.get());
}
......
......@@ -280,7 +280,7 @@ public:
void setComposition(const String&, const Vector<CompositionUnderline>&, unsigned selectionStart, unsigned selectionEnd);
void confirmComposition();
void confirmComposition(const String&); // if no existing composition, replaces selection
void confirmCompositionWithoutDisturbingSelection();
void cancelComposition();
PassRefPtr<Range> compositionRange() const;
bool getCompositionSelection(unsigned& selectionStart, unsigned& selectionEnd) const;
......@@ -409,7 +409,8 @@ private:
TextCheckingTypeMask resolveTextCheckingTypeMask(TextCheckingTypeMask);
void selectComposition();
void confirmComposition(const String&, bool preserveSelection);
enum SetCompositionMode { ConfirmComposition, CancelComposition };
void setComposition(const String&, SetCompositionMode);
void setIgnoreCompositionSelectionChange(bool ignore);
PassRefPtr<Range> firstVisibleRange(const String&, FindOptions);
......
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::unmarkText):
2011-09-06 Adam Barth <abarth@webkit.org>
[Chromium] Add WebFloatQuad.h for Android
......
......@@ -1088,7 +1088,7 @@ void WebFrameImpl::setMarkedText(
void WebFrameImpl::unmarkText()
{
frame()->editor()->confirmCompositionWithoutDisturbingSelection();
frame()->editor()->cancelComposition();
}
bool WebFrameImpl::hasMarkedText() const
......
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::respondToChangedSelection):
2011-08-30 Sheriff Bot <webkit.review.bot@gmail.com>
 
Unreviewed, rolling out r94142, r94144, r94145, and r94148.
......
......@@ -328,7 +328,7 @@ void EditorClient::respondToChangedSelection()
if (!targetFrame->editor()->getCompositionSelection(start, end)) {
// gtk_im_context_reset() clears the composition for us.
gtk_im_context_reset(priv->imContext.get());
targetFrame->editor()->confirmCompositionWithoutDisturbingSelection();
targetFrame->editor()->cancelComposition();
}
}
......
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _updateSelectionForInputManager]):
2011-09-05 Oliver Hunt <oliver@apple.com>
 
An object's structure should reference the global object responsible for its creation
......
......@@ -5940,7 +5940,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
if (coreFrame->editor()->getCompositionSelection(start, end))
[[NSInputManager currentInputManager] markedTextSelectionChanged:NSMakeRange(start, end - start) client:self];
else {
coreFrame->editor()->confirmCompositionWithoutDisturbingSelection();
coreFrame->editor()->cancelComposition();
[[NSInputManager currentInputManager] markedTextAbandoned:self];
}
}
......
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
* WebView.cpp:
(WebView::resetIME):
2011-08-29 Alexey Proskuryakov <ap@apple.com>
DumpRenderTree should begin each test with an empty cookie store
......
......@@ -5412,7 +5412,7 @@ void WebView::prepareCandidateWindow(Frame* targetFrame, HIMC hInputContext)
void WebView::resetIME(Frame* targetFrame)
{
if (targetFrame)
targetFrame->editor()->confirmCompositionWithoutDisturbingSelection();
targetFrame->editor()->cancelComposition();
if (HIMC hInputContext = getIMMContext()) {
IMMDict::dict().notifyIME(hInputContext, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
......
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
Rename confirmCompositionWithoutDisturbingSelection to cancelComposition
https://bugs.webkit.org/show_bug.cgi?id=67569
Reviewed by Antonio Gomes.
* UIProcess/API/mac/WKView.mm:
(-[WKView resignFirstResponder]):
(-[WKView _updateTextInputStateIncludingSecureInputState:]):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::cancelComposition):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::cancelComposition):
2011-09-05 Oliver Hunt <oliver@apple.com>
An object's structure should reference the global object responsible for its creation
......
......@@ -323,7 +323,7 @@ struct WKViewInterpretKeyEventsParameters {
_data->_inResignFirstResponder = true;
if (_data->_page->editorState().hasComposition && !_data->_page->editorState().shouldIgnoreCompositionSelectionChange)
_data->_page->confirmCompositionWithoutDisturbingSelection();
_data->_page->cancelComposition();
[self _resetTextInputState];
if (!_data->_page->maintainsInactiveSelection())
......@@ -2537,7 +2537,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
if (!editorState.hasComposition || editorState.shouldIgnoreCompositionSelectionChange)
return;
_data->_page->confirmCompositionWithoutDisturbingSelection();
_data->_page->cancelComposition();
[self _notifyInputContextAboutDiscardedComposition];
}
......
......@@ -299,7 +299,7 @@ public:
void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
void confirmComposition();
void confirmCompositionWithoutDisturbingSelection();
void cancelComposition();
bool insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
void getMarkedRange(uint64_t& location, uint64_t& length);
void getSelectedRange(uint64_t& location, uint64_t& length);
......
......@@ -163,12 +163,12 @@ void WebPageProxy::confirmComposition()
process()->sendSync(Messages::WebPage::ConfirmComposition(), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
}
void WebPageProxy::confirmCompositionWithoutDisturbingSelection()
void WebPageProxy::cancelComposition()
{
if (!isValid())
return;
process()->sendSync(Messages::WebPage::ConfirmCompositionWithoutDisturbingSelection(), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
process()->sendSync(Messages::WebPage::CancelComposition(), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
}
bool WebPageProxy::insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
......
......@@ -337,7 +337,7 @@ public:
void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
void confirmComposition(EditorState& newState);
void confirmCompositionWithoutDisturbingSelection(EditorState& newState);
void cancelComposition(EditorState& newState);
void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
void getMarkedRange(uint64_t& location, uint64_t& length);
void getSelectedRange(uint64_t& location, uint64_t& length);
......
......@@ -194,7 +194,7 @@ messages -> WebPage {
# Text input.
SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (WebKit::EditorState newState)
ConfirmComposition() -> (WebKit::EditorState newState)
ConfirmCompositionWithoutDisturbingSelection() -> (WebKit::EditorState newState)
CancelComposition() -> (WebKit::EditorState newState)
InsertText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (bool handled, WebKit::EditorState newState)
GetMarkedRange() -> (uint64_t location, uint64_t length)
GetSelectedRange() -> (uint64_t location, uint64_t length)
......
......@@ -252,11 +252,11 @@ void WebPage::confirmComposition(EditorState& newState)
newState = editorState();
}
void WebPage::confirmCompositionWithoutDisturbingSelection(EditorState& newState)
void WebPage::cancelComposition(EditorState& newState)
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
frame->editor()->confirmCompositionWithoutDisturbingSelection();
frame->editor()->cancelComposition();
newState = editorState();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment