Commit 73c1c052 authored by tonikitoo@webkit.org's avatar tonikitoo@webkit.org

2011-10-17 Antonio Gomes <agomes@rim.com>

        Pass a Frame* parameter in EditorClient::respondToChangedSelection
        https://bugs.webkit.org/show_bug.cgi?id=70248

        Reviewed by Ryosuke Niwa.

        Most of the port specific implementations of EditorClient::respondToChangedSelection
        (like EditorClient{Qt,Gtk,etc}) are wrongly relying on FocusController::focusedOrMainFrame
        method to get the Frame where the selection is happening on.

        It is not right, since a selection can be easily triggered in an inner
        frame that is not focused.

        No new tests since it is a hard thing to test without
        to hook into editor client in layout tests. We could
        change the "Dumped Delegate" messages, but it would
        require a rebasile of +1200 for a minor change.

        No new tests since it is a hard thing to test without
        to hook into editor client in layout tests. We could
        change the "Dumped Delegate" messages, but it would
        require a rebasile of +1200 for a minor change.

        Source/WebCore:
        * editing/Editor.cpp: Pass the Frame on where the selection is changing to the client.
        (WebCore::Editor::respondToChangedSelection): Ditto.
        (WebCore::Editor::changeSelectionAfterCommand): Ditto.
        (WebCore::EmptyEditorClient::respondToChangedSelection):
        * page/EditorClient.h:  Pass Frame* to indicate where the selection is happening.
        * loader/EmptyClients.h: Changed signature as per base class change.

        Source/WebKit/chromium:
        * src/EditorClientImpl.cpp: Make use of the newly added Frame* parameter.
        (WebKit::EditorClientImpl::respondToChangedSelection):
        * src/EditorClientImpl.h:

        Source/WebKit/efl:
        * WebCoreSupport/EditorClientEfl.cpp: Make use of the newly added Frame* parameter.
        (WebCore::EditorClientEfl::respondToChangedSelection):
        * WebCoreSupport/EditorClientEfl.h:

        Source/WebKit/gtk:
        * WebCoreSupport/EditorClientGtk.cpp: Make use of the newly added Frame* parameter.
        (WebKit::EditorClient::respondToChangedSelection):
        * WebCoreSupport/EditorClientGtk.h:

        Source/WebKit/mac:
        * WebCoreSupport/WebEditorClient.h: Make use of the newly added Frame* parameter.
        * WebCoreSupport/WebEditorClient.mm:
        (WebEditorClient::respondToChangedSelection):

        Source/WebKit/qt:
        * WebCoreSupport/EditorClientQt.cpp: Make use of the newly added Frame* parameter.
        (WebCore::EditorClientQt::respondToChangedSelection):
        * WebCoreSupport/EditorClientQt.h:

        Source/WebKit/win:
        * WebCoreSupport/WebEditorClient.cpp: Make use of the newly added Frame* parameter.
        (WebEditorClient::respondToChangedSelection):
        * WebCoreSupport/WebEditorClient.h:

        Source/WebKit/wx:
        * WebKitSupport/EditorClientWx.cpp: Make use of the newly added Frame* parameter.
        (WebCore::EditorClientWx::respondToChangedSelection):
        * WebKitSupport/EditorClientWx.h:

        Source/WebKit2:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp: Make use of the newly added Frame* parameter.
        (WebKit::WebEditorClient::respondToChangedSelection):
        * WebProcess/WebCoreSupport/WebEditorClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 816bf2ca
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
Most of the port specific implementations of EditorClient::respondToChangedSelection
(like EditorClient{Qt,Gtk,etc}) are wrongly relying on FocusController::focusedOrMainFrame
method to get the Frame where the selection is happening on.
It is not right, since a selection can be easily triggered in an inner
frame that is not focused.
No new tests since it is a hard thing to test without
to hook into editor client in layout tests. We could
change the "Dumped Delegate" messages, but it would
require a rebasile of +1200 for a minor change.
* editing/Editor.cpp: Pass the Frame on where the selection is changing to the client.
(WebCore::Editor::respondToChangedSelection): Ditto.
(WebCore::Editor::changeSelectionAfterCommand): Ditto.
(WebCore::EmptyEditorClient::respondToChangedSelection):
* page/EditorClient.h: Pass Frame* to indicate where the selection is happening.
* loader/EmptyClients.h: Changed signature as per base class change.
2011-11-17 Mark Rowe <mrowe@apple.com>
<http://webkit.org/b/72646> Disable deprecation warnings around code where we cannot easily
......@@ -480,7 +480,7 @@ bool Editor::shouldShowDeleteInterface(HTMLElement* element) const
void Editor::respondToChangedSelection(const VisibleSelection& oldSelection)
{
if (client())
client()->respondToChangedSelection();
client()->respondToChangedSelection(m_frame);
m_deleteButtonController->respondToChangedSelection(oldSelection);
m_spellingCorrector->respondToChangedSelection(oldSelection);
}
......@@ -2602,7 +2602,7 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, b
// does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and
// starts a new kill ring sequence, but we want to do these things (matches AppKit).
if (selectionDidNotChangeDOMPosition)
client()->respondToChangedSelection();
client()->respondToChangedSelection(m_frame);
}
String Editor::selectedText() const
......
......@@ -460,7 +460,7 @@ public:
//
virtual void didBeginEditing() { }
virtual void respondToChangedContents() { }
virtual void respondToChangedSelection() { }
virtual void respondToChangedSelection(Frame*) { }
virtual void didEndEditing() { }
virtual void didWriteSelectionToPasteboard() { }
virtual void didSetSelectionTypesForPasteboard() { }
......
......@@ -94,7 +94,7 @@ public:
virtual void didBeginEditing() = 0;
virtual void respondToChangedContents() = 0;
virtual void respondToChangedSelection() = 0;
virtual void respondToChangedSelection(Frame*) = 0;
virtual void didEndEditing() = 0;
virtual void didWriteSelectionToPasteboard() = 0;
virtual void didSetSelectionTypesForPasteboard() = 0;
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* src/EditorClientImpl.cpp: Make use of the newly added Frame* parameter.
(WebKit::EditorClientImpl::respondToChangedSelection):
* src/EditorClientImpl.h: Change the method signature, as per base class change.
2011-11-20 Adam Barth <abarth@webkit.org>
Add WebNode::hasEventListeners for Android
......
......@@ -260,10 +260,9 @@ void EditorClientImpl::didBeginEditing()
m_webView->client()->didBeginEditing();
}
void EditorClientImpl::respondToChangedSelection()
void EditorClientImpl::respondToChangedSelection(Frame* frame)
{
if (m_webView->client()) {
Frame* frame = m_webView->focusedWebCoreFrame();
if (frame)
m_webView->client()->didChangeSelection(!frame->selection()->isRange());
}
......
......@@ -37,6 +37,7 @@
#include <wtf/Deque.h>
namespace WebCore {
class Frame;
class HTMLInputElement;
class SpellChecker;
}
......@@ -72,7 +73,7 @@ public:
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*);
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(WebCore::Frame*);
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebCoreSupport/EditorClientEfl.cpp: Make use of the newly added Frame* parameter.
(WebCore::EditorClientEfl::respondToChangedSelection):
* WebCoreSupport/EditorClientEfl.h:
2011-11-17 KwangHyuk Kim <hyuki.kim@samsung.com>
[EFL] Add matrix list to reuse tile matrix for each different zoom level.
......
......@@ -133,25 +133,16 @@ void EditorClientEfl::respondToChangedContents()
ewk_frame_editor_client_contents_changed(frame);
}
void EditorClientEfl::respondToChangedSelection()
void EditorClientEfl::respondToChangedSelection(Frame* coreFrame)
{
Evas_Object* frame = ewk_view_frame_focused_get(m_view);
if (!frame)
frame = ewk_view_frame_main_get(m_view);
if (!frame)
return;
WebCore::Frame* coreFrame = EWKPrivate::coreFrame(frame);
if (!coreFrame)
return;
if (coreFrame->editor() && coreFrame->editor()->ignoreCompositionSelectionChange())
return;
ewk_frame_editor_client_selection_changed(frame);
Evas_Object* webFrame = EWKPrivate::kitFrame(coreFrame);
ewk_frame_editor_client_selection_changed(webFrame);
}
void EditorClientEfl::didEndEditing()
......
......@@ -79,7 +79,7 @@ public:
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(Frame*);
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebCoreSupport/EditorClientGtk.cpp: Make use of the newly added Frame* parameter.
(WebKit::EditorClient::respondToChangedSelection):
* WebCoreSupport/EditorClientGtk.h:
2011-11-18 Martin Robinson <mrobinson@igalia.com>
REGRESSION (r99924): broke 2 pasteboard tests on GTK
......
......@@ -302,33 +302,31 @@ static void setSelectionPrimaryClipboardIfNeeded(WebKitWebView* webView)
}
#endif
void EditorClient::respondToChangedSelection()
void EditorClient::respondToChangedSelection(Frame* frame)
{
g_signal_emit_by_name(m_webView, "selection-changed");
WebKitWebViewPrivate* priv = m_webView->priv;
WebCore::Page* corePage = core(m_webView);
Frame* targetFrame = corePage->focusController()->focusedOrMainFrame();
if (!targetFrame)
if (!frame)
return;
if (targetFrame->editor()->ignoreCompositionSelectionChange())
if (frame->editor()->ignoreCompositionSelectionChange())
return;
#if PLATFORM(X11)
setSelectionPrimaryClipboardIfNeeded(m_webView);
#endif
if (!targetFrame->editor()->hasComposition())
if (!frame->editor()->hasComposition())
return;
unsigned start;
unsigned end;
if (!targetFrame->editor()->getCompositionSelection(start, end)) {
WebKitWebViewPrivate* priv = m_webView->priv;
if (!frame->editor()->getCompositionSelection(start, end)) {
// gtk_im_context_reset() clears the composition for us.
gtk_im_context_reset(priv->imContext.get());
targetFrame->editor()->cancelComposition();
frame->editor()->cancelComposition();
}
}
......
......@@ -100,7 +100,7 @@ class EditorClient : public WebCore::EditorClient {
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(WebCore::Frame*);
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm: Make use of the newly added Frame* parameter.
(WebEditorClient::respondToChangedSelection):
2011-11-17 Mark Rowe <mrowe@apple.com>
<http://webkit.org/b/72646> Disable deprecation warnings around code where we cannot easily
......
......@@ -98,7 +98,7 @@ public:
TextCheckerClient* textChecker() OVERRIDE { return this; }
virtual void respondToChangedContents() OVERRIDE;
virtual void respondToChangedSelection() OVERRIDE;
virtual void respondToChangedSelection(WebCore::Frame*) OVERRIDE;
virtual void registerCommandForUndo(PassRefPtr<WebCore::EditCommand>) OVERRIDE;
virtual void registerCommandForRedo(PassRefPtr<WebCore::EditCommand>) OVERRIDE;
......
......@@ -290,9 +290,9 @@ void WebEditorClient::respondToChangedContents()
[[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeNotification object:m_webView];
}
void WebEditorClient::respondToChangedSelection()
void WebEditorClient::respondToChangedSelection(Frame* frame)
{
NSView<WebDocumentView> *documentView = [[[m_webView _selectedOrMainFrame] frameView] documentView];
NSView<WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
if ([documentView isKindOfClass:[WebHTMLView class]])
[(WebHTMLView *)documentView _selectionChanged];
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebCoreSupport/EditorClientQt.cpp: Make use of the newly added Frame* parameter.
(WebCore::EditorClientQt::respondToChangedSelection):
* WebCoreSupport/EditorClientQt.h:
2011-11-18 Yuta Kitamura <yutak@chromium.org>
[Qt] Enable WebSocket hybi tests
......
......@@ -201,7 +201,7 @@ void EditorClientQt::respondToChangedContents()
emit m_page->contentsChanged();
}
void EditorClientQt::respondToChangedSelection()
void EditorClientQt::respondToChangedSelection(Frame* frame)
{
if (dumpEditingCallbacks)
printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
......@@ -212,7 +212,6 @@ void EditorClientQt::respondToChangedSelection()
m_page->d->updateEditorActions();
emit m_page->selectionChanged();
Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
if (!frame->editor()->ignoreCompositionSelectionChange())
emit m_page->microFocusChanged();
}
......
......@@ -69,7 +69,7 @@ public:
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(Frame*);
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebCoreSupport/WebEditorClient.cpp: Make use of the newly added Frame* parameter.
(WebEditorClient::respondToChangedSelection):
* WebCoreSupport/WebEditorClient.h:
2011-11-15 Jochen Eisinger <jochen@chromium.org>
Rename ReferrerPolicy to clarify its meaning
......
......@@ -208,7 +208,7 @@ void WebEditorClient::respondToChangedContents()
notImplemented();
}
void WebEditorClient::respondToChangedSelection()
void WebEditorClient::respondToChangedSelection(Frame*)
{
m_webView->selectionChanged();
......
......@@ -58,7 +58,7 @@ public:
virtual void didSetSelectionTypesForPasteboard();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(WebCore::Frame*);
bool shouldShowDeleteInterface(WebCore::HTMLElement*);
bool shouldDeleteRange(WebCore::Range*);
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebKitSupport/EditorClientWx.cpp: Make use of the newly added Frame* parameter.
(WebCore::EditorClientWx::respondToChangedSelection):
* WebKitSupport/EditorClientWx.h:
2011-11-15 Anders Carlsson <andersca@apple.com>
HostWindow screenToWindow/windowToScreen should be screenToRootView/rootViewToScreen
......
......@@ -487,9 +487,8 @@ void EditorClientWx::textDidChangeInTextArea(Element*)
notImplemented();
}
void EditorClientWx::respondToChangedSelection()
void EditorClientWx::respondToChangedSelection(Frame* frame)
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
if (frame) {
wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformPageClient());
if (webKitWin) {
......
......@@ -72,7 +72,7 @@ public:
virtual void didBeginEditing();
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
virtual void respondToChangedSelection(Frame*);
virtual void didEndEditing();
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
......
2011-10-17 Antonio Gomes <agomes@rim.com>
Pass a Frame* parameter in EditorClient::respondToChangedSelection
https://bugs.webkit.org/show_bug.cgi?id=70248
Reviewed by Ryosuke Niwa.
* WebProcess/WebCoreSupport/WebEditorClient.cpp: Make use of the newly added Frame* parameter.
(WebKit::WebEditorClient::respondToChangedSelection):
* WebProcess/WebCoreSupport/WebEditorClient.h:
2011-11-17 Mark Rowe <mrowe@apple.com>
<http://webkit.org/b/72646> Disable deprecation warnings around code where we cannot easily
......
......@@ -174,11 +174,10 @@ void WebEditorClient::respondToChangedContents()
notImplemented();
}
void WebEditorClient::respondToChangedSelection()
void WebEditorClient::respondToChangedSelection(Frame* frame)
{
DEFINE_STATIC_LOCAL(String, WebViewDidChangeSelectionNotification, ("WebViewDidChangeSelectionNotification"));
m_page->injectedBundleEditorClient().didChangeSelection(m_page, WebViewDidChangeSelectionNotification.impl());
Frame* frame = m_page->corePage()->focusController()->focusedFrame();
if (!frame)
return;
......
......@@ -64,7 +64,7 @@ private:
virtual void didBeginEditing() OVERRIDE;
virtual void respondToChangedContents() OVERRIDE;
virtual void respondToChangedSelection() OVERRIDE;
virtual void respondToChangedSelection(WebCore::Frame*) OVERRIDE;
virtual void didEndEditing() OVERRIDE;
virtual void didWriteSelectionToPasteboard() OVERRIDE;
virtual void didSetSelectionTypesForPasteboard() OVERRIDE;
......
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